From d33a838462f0e9082b9c17ed744dd2dec5be3074 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 19 Jul 2026 00:16:17 +0200 Subject: [PATCH] docs(modules): note the registry is the checklist for new pages Review follow-up: the ordered MODULES array can't double as a compiler- enforced exhaustive Page map, so document that adding a Page means adding it here (an unregistered Page returns undefined from moduleDef/moduleLabelKey and throws in NavSidebar). No behavior change. (Platform S6b.2) --- frontend/src/lib/modules.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/lib/modules.ts b/frontend/src/lib/modules.ts index 7097735..ef4f43a 100644 --- a/frontend/src/lib/modules.ts +++ b/frontend/src/lib/modules.ts @@ -65,6 +65,10 @@ const SETTINGS_MODULE: ModuleDef = { icon: Settings, }; +// Registering a NEW Page means adding it to MODULES (or SETTINGS_MODULE) above — that's the single +// place. If a Page is left unregistered, moduleDef()/moduleLabelKey[] return undefined and NavSidebar +// throws on `.icon`; the coverage isn't compiler-enforced here because the ordered array can't also +// be an exhaustive Page map, so treat the array as the checklist when the Page union grows. const BY_ID = Object.fromEntries( [...MODULES, SETTINGS_MODULE].map((m) => [m.id, m]), ) as Record;