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:
1 parent
29f92dbf9e
commit
0e3088db9a
3 files changed
+10
-3
No files matched your search
@@ -226,8 +226,15 @@ export function openModal(card = null) {
|
||||
inpTitle.value = card ? card.title : (isJournal ? today : '');
|
||||
body.value = card ? card.body : '';
|
||||
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
|
||||
: (!virtualBuckets.includes(state.activeBucket) ? state.activeBucket : '');
|
||||
: (isNewAppointment ? ''
|
||||
: (!virtualBuckets.includes(state.activeBucket) ? state.activeBucket : ''));
|
||||
selectColor(card ? card.color : '#38bdf8');
|
||||
setDueDate(card?.due_date || '');
|
||||
updateDoneToggle();
|
||||
|
||||
Reference in new issue
Block a user