From a128005ae580272f7f9ef16620c3109bd6e1a28b Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Fri, 27 Feb 2026 09:57:19 +0800 Subject: [PATCH] Fix create-mode crash in detail panels (null entity access) The desktop detail panels are pre-mounted (always in DOM, hidden with w-0). useState(isCreating) only captures the initial value on mount (false), so when isCreating later becomes true via props, isEditing stays false. The view-mode branch then runs with a null entity, crashing on property access. Fix: use (isEditing || isCreating) for all conditionals that gate between edit/create form and view mode, ensuring the form always renders when isCreating is true regardless of isEditing state. Co-Authored-By: Claude Opus 4.6 --- frontend/src/components/calendar/EventDetailPanel.tsx | 4 ++-- frontend/src/components/reminders/ReminderDetailPanel.tsx | 4 ++-- frontend/src/components/todos/TodoDetailPanel.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/calendar/EventDetailPanel.tsx b/frontend/src/components/calendar/EventDetailPanel.tsx index de40dc1..3c0c4e4 100644 --- a/frontend/src/components/calendar/EventDetailPanel.tsx +++ b/frontend/src/components/calendar/EventDetailPanel.tsx @@ -480,7 +480,7 @@ export default function EventDetailPanel({ > - ) : isEditing ? ( + ) : (isEditing || isCreating) ? ( <>