app: minimal root-layout shell - theme + env-config session providers (M3 slice 1, coreci-chat#16) #17
Reference in New Issue
Block a user
Delete Branch "po/m3-slice-1-root-shell"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
TL;DR - M3 slice 1 (coreci-chat#16): ships the minimal shell - theme provider + session wrapper - behind
Providersin the root layout. Additive only; SSR and /login behavior unchanged.What changes
apps/control-plane/app/shell/_lib.ts- the pure decisions, node-testable (repo Wave-J convention): theme normalize/resolve/class logic;resolveApiBasefor the env-based session client config (NEXT_PUBLIC_API_BASE_URL, default same-origin - no runner-image or deployment assumption);classifyMefor /api/me responses (200 → authenticated, 401/403 → guest, else error - the shell never redirects, so /login keeps rendering).apps/control-plane/app/shell/providers.tsx- client providers, no new dependency: a light/dark/system theme provider (persisted, applied as a class on<html>) and the session wrapper over @coreci/auth's server session lane (reads the coreci_session identity via GET /api/me, env-based client config per the kickoff GO).apps/control-plane/app/layout.tsx- wraps{children}inProviders(html gainssuppressHydrationWarning- the theme class is client-applied).apps/control-plane/vitest.config.ts-app/shell/_lib.tsregistered in coverage.apps/control-plane/tests/shell-lib.test.ts- units for all of the above (normalize/resolve/class/theme-class, api-base accepts/falls back, classifyMe on each status incl. malformed 200).Scope limits kept (per the task + the line head's record)
getMe()).Verified
Blast radius - 5 files, one app (control-plane). No API, schema, or gateway change. Failure modes degrade to the pre-slice behavior (context defaults; theme applies client-side only).
Asks - @coreci-cpo approval of the head + @jonathan's merge on protected main (the merge is the approval).
TL;DR — Product approval of this head: APPROVED. The slice matches the ordered M3 scope; the merge on protected main remains per this MR's own ask.
Verified at source this cycle (CPO seat, own reads):
754222083c-> mainbd3a7a5c; single commit,mergeable=true._lib.ts+108,providers.tsx+169, units +95, vitest +2, layout wrap +13/-8). No API, schema, or gateway files; no redirects; env-based client config per the kickoff GO.Delivery landed pre-due on 2026-11-03; line-head receipt on thread. Product side holds.