Context
#21951 makes the catalog's ?theme= request open each example in the requested scheme, through resolveStartTheme in its app.mjs. Sophie's review of #21953 found six examples where that wiring breaks the example's own theme toggle: Calendar, Dialog, COVID, Big Data, Tree Big Data and Nested Record Fields. #21953 therefore leaves these six on dev's start path, and this ticket carries them.
The Problem
Each of the six toggles assumes the app starts on themes[0]:
- Calendar and COVID flip on a hard-coded button label ("Theme Dark" / "Theme Light"). After a dark launch, the first click re-applies the dark theme and only flips the label.
- Dialog toggles the body class with
setBodyCls. Once the viewport carries its own theme class from resolveStartTheme, the viewport's class wins over the body's, so the switch shows nothing.
- Big Data and Tree Big Data check their Dark radio by default, whatever the launch theme.
- COVID also swaps its logo and map style from the label.
- Nested Record Fields reads the current theme, but its control still starts from the default.
The Architectural Reality
src/util/Theme.mjs resolveStartTheme picks the start theme. A root viewport given theme mirrors it onto the body through Viewport#syncBodyTheme.
- The toggles live in each example:
examples/calendar/basic/MainContainerController.mjs#onSwitchThemeButtonClick
examples/dialog/MainContainer.mjs#switchTheme
apps/covid/view/MainContainerController.mjs#onSwitchThemeButtonClick
examples/grid/{bigData,treeBigData}/ControlsContainer.mjs, the theme radios
examples/grid/nestedRecordFields/ViewportController.mjs#onSwitchThemeButtonClick
- Design authority: #21835, "An example opens on the theme of the catalog that launched it". #21953's review sets the bar for the toggles.
The Fix
For each of the six:
- Start through
resolveStartTheme.
- Initialize the toggle's label, icon, checked state and theme-bound chrome (COVID's logo and map style, Calendar's header color) from the theme the app actually started in.
- Make the toggle switch the viewport's
theme from the current theme, not from a label or the body class, so body and viewport stay aligned.
Acceptance Criteria
Out of Scope
The 15 examples #21953 wires, and any new theme control.
Related
Parent #21140. #21951 and #21953, where the review found it. #21835, the catalog theme link.
Live latest-open + closed sweep: checked latest 20 open (74 open, orange band; parent #21140) + open and closed search (theme toggle, resolveStartTheme, switchTheme; #21951 and #21835 are the source, and no other ticket covers these six toggles) at 2026-11-22T16:15Z; no equivalent found. A2A in-flight sweep: no claim on these examples. MC sweep: covered by the review that found it. Own-assignment sweep: none covers it.
unowned-rationale: claimable by any maintainer after the Engine 14 cut. Each toggle differs, and the fix wants a browser spec per toggle style.
Decision Record impact: none.
Origin Session ID: 1563f974-0d41-4096-a8cf-0a5cd5a12533
⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code
Context
#21951 makes the catalog's
?theme=request open each example in the requested scheme, throughresolveStartThemein itsapp.mjs. Sophie's review of #21953 found six examples where that wiring breaks the example's own theme toggle: Calendar, Dialog, COVID, Big Data, Tree Big Data and Nested Record Fields. #21953 therefore leaves these six on dev's start path, and this ticket carries them.The Problem
Each of the six toggles assumes the app starts on
themes[0]:setBodyCls. Once the viewport carries its own theme class fromresolveStartTheme, the viewport's class wins over the body's, so the switch shows nothing.The Architectural Reality
src/util/Theme.mjsresolveStartThemepicks the start theme. A root viewport giventhememirrors it onto the body throughViewport#syncBodyTheme.examples/calendar/basic/MainContainerController.mjs#onSwitchThemeButtonClickexamples/dialog/MainContainer.mjs#switchThemeapps/covid/view/MainContainerController.mjs#onSwitchThemeButtonClickexamples/grid/{bigData,treeBigData}/ControlsContainer.mjs, the theme radiosexamples/grid/nestedRecordFields/ViewportController.mjs#onSwitchThemeButtonClickThe Fix
For each of the six:
resolveStartTheme.themefrom the current theme, not from a label or the body class, so body and viewport stay aligned.Acceptance Criteria
?theme=neo-theme-neo-dark) and after a light one, each control shows the state that matches the visible theme.Out of Scope
The 15 examples #21953 wires, and any new theme control.
Related
Parent #21140. #21951 and #21953, where the review found it. #21835, the catalog theme link.
Live latest-open + closed sweep: checked latest 20 open (74 open, orange band; parent #21140) + open and closed search (theme toggle,
resolveStartTheme,switchTheme; #21951 and #21835 are the source, and no other ticket covers these six toggles) at 2026-11-22T16:15Z; no equivalent found. A2A in-flight sweep: no claim on these examples. MC sweep: covered by the review that found it. Own-assignment sweep: none covers it.unowned-rationale: claimable by any maintainer after the Engine 14 cut. Each toggle differs, and the fix wants a browser spec per toggle style.
Decision Record impact: none.
Origin Session ID: 1563f974-0d41-4096-a8cf-0a5cd5a12533
⚖️ Ada ·
@neo-opus-ada· Claude Opus 5.5 · Claude Code