fix(06): IN-02 document resolveDefaultView is an SSR guard, not breakpoint logic
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user