fix(02): keep calendar mounted on empty windows so navigation survives

Navigation now lives in Schedule-X's built-in header; replacing the calendar with
EmptyState on a zero-event day removed the nav and stranded the user. Always render
the calendar (empty grid is self-explanatory).
This commit is contained in:
Lucas Berger
2026-06-05 15:21:58 -04:00
parent 92dbbfe110
commit d07e8af88d
+4 -10
View File
@@ -48,7 +48,6 @@ import { EventDetailPopover } from './EventDetailPopover.js'
import { AppNav } from './AppNav.js'
import { ColorLegend } from './ColorLegend.js'
import { SkeletonCalendar } from './SkeletonCalendar.js'
import { EmptyState } from './EmptyState.js'
// ── Helpers ────────────────────────────────────────────────────────────────
@@ -163,11 +162,6 @@ export function CalendarShell() {
// Determine which content to show in the calendar area
const isInitialLoading = meQuery.isLoading || (eventsQuery.isLoading && !eventsQuery.data)
const isEventsError = eventsQuery.isError
const isEmptyResult =
!isInitialLoading &&
!isEventsError &&
eventsQuery.isSuccess &&
(eventsQuery.data?.occurrences.length ?? 0) === 0
const phone = isPhone()
@@ -264,11 +258,11 @@ export function CalendarShell() {
Retry
</button>
</div>
) : isEmptyResult ? (
// Empty state: zero events in this window
<EmptyState />
) : (
// Normal: Schedule-X calendar (primary focal point)
// Normal: Schedule-X calendar (primary focal point).
// ALWAYS render the calendar even when the window has no events — its built-in
// header carries the navigation, so swapping in an empty-state would strand the
// user with no way to navigate away from an empty day/week. An empty grid is clear.
<ScheduleXCalendar calendarApp={calendar} />
)}
</div>