From c2485b1307eabaf38cf54e58da2abcd06b19c95c Mon Sep 17 00:00:00 2001 From: th Date: Wed, 15 Apr 2026 22:10:17 +0200 Subject: [PATCH] fix(editor): appointment bucket-skip detects {id:null} shells too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- public/js/modules/editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/js/modules/editor.js b/public/js/modules/editor.js index 8b7cf8f..bd7ebb4 100644 --- a/public/js/modules/editor.js +++ b/public/js/modules/editor.js @@ -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 : ''));