editor: new appointments never inherit the active bucket

The modal's default-bucket logic dropped new cards into the current
real bucket when opened from one. Calendar-created appointments
(body pre-seeded with #termin / #geburtstag) would then land in e.g.
"work" instead of living bucket-less as calendar entries should.
Detect the pre-filled tag on open and force inpBucket empty for
those; regular new cards still inherit the active bucket.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thandClaude Opus 4.6 committed 2026-04-15 22:04:39 +02:00
1 parent 29f92dbf9e
commit 0e3088db9a
3 files changed
+10 -3

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
<?php <?php
define('APP_NAME', 'hyprcrd'); define('APP_NAME', 'hyprcrd');
define('APP_VERSION', '1.9.16'); define('APP_VERSION', '1.9.17');
// Database path — writable directory, outside webroot // Database path — writable directory, outside webroot
// DB_PATH / UPLOAD_DIR can be pre-defined by the Electron router for app isolation // DB_PATH / UPLOAD_DIR can be pre-defined by the Electron router for app isolation
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hyprcrd", "name": "hyprcrd",
"version": "1.9.16", "version": "1.9.17",
"description": "hyprcrd — self-hosted card manager", "description": "hyprcrd — self-hosted card manager",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
+8 -1
View File
@@ -226,8 +226,15 @@ export function openModal(card = null) {
inpTitle.value = card ? card.title : (isJournal ? today : ''); inpTitle.value = card ? card.title : (isJournal ? today : '');
body.value = card ? card.body : ''; body.value = card ? card.body : '';
const virtualBuckets = ['all', 'none', 'current', 'favorites', 'journal']; const virtualBuckets = ['all', 'none', 'current', 'favorites', 'journal'];
// New appointments (#termin / #geburtstag pre-filled from the
// calendar's day-popup template) must never inherit the active
// bucket — they belong to a calendar, not a kanban column. For
// every other new card, inherit the active real bucket if we're
// in one so the user doesn't have to re-pick it.
const isNewAppointment = !card && /#(termin|geburtstag)\b/.test(body.value);
inpBucket.value = card?.bucket_id ? card.bucket_id inpBucket.value = card?.bucket_id ? card.bucket_id
: (!virtualBuckets.includes(state.activeBucket) ? state.activeBucket : ''); : (isNewAppointment ? ''
: (!virtualBuckets.includes(state.activeBucket) ? state.activeBucket : ''));
selectColor(card ? card.color : '#38bdf8'); selectColor(card ? card.color : '#38bdf8');
setDueDate(card?.due_date || ''); setDueDate(card?.due_date || '');
updateDoneToggle(); updateDoneToggle();