fix(editor): appointment bucket-skip detects {id:null} shells too

The calendar day-popup invokes openModal with `{id: null, title, body}`
rather than a bare `null`, so `!card` was false and the #termin-body
exemption never fired — new appointments still inherited the active
bucket. Key the "is new" check on `card?.id` instead so both entry
shapes are treated the same.

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:10:17 +02:00
1 parent b08bdbaeb2
commit c2485b1307
1 file changed
+4 -1
+4 -1
View File
@@ -231,7 +231,10 @@ export function openModal(card = null) {
// 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);
// `card` can be `null` (add-button new) or a shell `{id: null, ...}`
// from the calendar day-popup — both count as "new", so key on
// card?.id not the card ref itself.
const isNewAppointment = !card?.id && /#(termin|geburtstag)\b/.test(body.value);
inpBucket.value = card?.bucket_id ? card.bucket_id
: (isNewAppointment ? ''
: (!virtualBuckets.includes(state.activeBucket) ? state.activeBucket : ''));