fix(06): IN-02 document resolveDefaultView is an SSR guard, not breakpoint logic

This commit is contained in:
Lucas Berger
2026-06-10 16:54:12 -04:00
parent 8b79d499f6
commit a570135a8d
+6 -2
View File
@@ -59,8 +59,12 @@ import { InstallPrompt } from './InstallPrompt.js'
// ── Helpers ────────────────────────────────────────────────────────────────
/**
* D-05: phone (≤767px) defaults to 'month-agenda'; tablet/desktop to 'month-grid'.
* Called once at render time; Schedule-X persists selected view internally after that.
* IN-02: this does NOT compute the D-05 phone/desktop default — that lives in the
* store's readPersistedView() (calendarStore.ts), which seeds selectedView with the
* breakpoint-aware default. By the time this runs, `persistedView` already carries that
* resolved default. The ONLY job here is the SSR guard: return a stable 'month-grid'
* when `window` is undefined (no breakpoint to read), otherwise pass the already-resolved
* view through unchanged. Do not expect breakpoint logic here.
*/
function resolveDefaultView(persistedView: string): string {
if (typeof window === 'undefined') return 'month-grid'