LearnNewsExamplesConnect
Frontmatter
assignees[]
createdAtNov 21, 2026, 2:46 AM
updatedAtNov 21, 2026, 9:55 PM
githubUrlhttps://github.com/neomjs/neo/issues/21704
authorneo-gemini-maryam
commentsCount4
parentIssuenull
subIssues
21705 Add Neo.button.ThemeSwitcher with wave toggle and multi-theme dropdown
21706 Add ThemeSwitcher to all Board, Scheduler, Gantt and Timeline examples
21707 Add ThemeSwitcher to Grid, Dashboard, Desktop and Menu standalone examples
21708 Add ThemeSwitcher to Form, Component, Charts and StateProvider examples
21785 Three planning examples merged after the rollout get the ThemeSwitcher
subIssuesCompleted5
subIssuesTotal5
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 21, 2026, 4:10 PM

Standalone examples ship an interactive theme switcher with wave reveal

Closed v14.0.0/archive-v14-0-0-chunk-6 enhancementepicdesignaiportal
neo-gemini-maryam
neo-gemini-maryam commented on Nov 21, 2026, 2:46 AM

Terminal predicate: Every published non-workbench Neo example exposes an interactive theme switcher — a circular-reveal light/dark toggle when two themes are configured and a circular-reveal theme dropdown when three or more themes are configured — backed by one reusable Neo.button.ThemeSwitcher engine component, with zero published standalone examples locked to a URL-only ?theme= parameter.

Problem Scope

Engine 14 ships multi-theme support across its component families (neo-theme-neo-light, neo-theme-neo-dark, neo-theme-light, neo-theme-dark, neo-theme-cyberpunk), and recent example PRs (#21677, #21678, #21680, #21681, #21687, etc.) attach multi-theme verification screenshots — yet a visitor opening those standalone examples in the browser has no UI control to switch themes without manually editing ?theme= in the URL.

Why this missed until @tobiu's release-blocker audit on 2026-11-21:

  • Earlier theme tickets #20879 and #20932 explicitly placed "Adding a UI theme switcher to the examples" in Out of Scope while the 5 theme stylesheets were being authored, and no follow-up epic or leaf was ever filed once the stylesheets landed.
  • Live transitive census on dev (6952886dce, 176 top-level example apps excluding childapp secondary windows):
    • 76 workbench examples extend Neo.examples.ConfigurationViewport (directly or via examples/form/field/MainContainer.mjs), which already provides theme controls in its inspector panel.
    • 100 standalone non-workbench examples do not use ConfigurationViewport: only 19 currently expose a theme toggle (calendar/basic, code/livePreview, component/video, dialog, table/nestedRecordFields, tableFiltering, and 13 grid/* examples hand-rolling onThemeButtonClick + Neo.main.DomAccess.startViewTransition), while 81 standalone examples (including 65 entries in the Portal catalog and every 5-theme board/*, scheduler/*, gantt/*, and timeline/* example) have zero theme switcher UI.

Why an Epic (multi-sub coordination) rather than a single ticket:

  • Delivering a clean engine-grade Neo.button.ThemeSwitcher primitive first (src/button/ThemeSwitcher.mjs) and then mounting it across ~80+ standalone examples (plus expanding single-theme neo-config.json manifests where needed) spans multiple example families (board / scheduler / gantt / timeline, grid / table / dashboard / desktop / toolbar / menu, and form / component / charts / stateProvider) that are actively being edited in parallel by the swarm ahead of the 2026-11-23 Engine 14 cut. Splitting into one prerequisite engine component leaf + disjoint family rollout leaves lets multiple peers execute in parallel with zero merge collisions (#21140 already holds 42 subs and #20874 holds 26 subs, both past epic-create Procedure 1's ~25-sub threshold).

Intended Solution Shape

  1. One reusable Engine primitive (Neo.button.ThemeSwitcher, ntype: 'theme-switcher' in src/button/ThemeSwitcher.mjs):
    • Reads configured themes from this.themes || Neo.config.themes (falling back to ['neo-theme-neo-light', 'neo-theme-neo-dark'] when Neo.config.themes has < 2 entries and themes is explicitly supplied, or hiding/disabling only if < 2 themes are loaded).
    • Resolves its target theme host via this.target || this.up('viewport') (getTheme() / set({theme}), propagating across open child windows where multi-window apps register secondary viewports or state providers).
    • 2-theme mode (themes.length === 2): Acts as a single-click light/dark toggle button (matching apps/portal/view/ViewportController.mjs:302 and apps/workstation/view/Workspace.mjs:882), calling Neo.main.DomAccess.startViewTransition({delay: 100, reveal: {x: data?.clientX, y: data?.clientY}, windowId: this.windowId}).catch(() => {}) before flipping theme and updating its sun/moon icon + accessible label.
    • Multi-theme mode (themes.length > 2, e.g. 4 or 5 themes): Renders a compact theme dropdown (menu list via Neo.button.Base / Neo.menu.List with human-readable labels — Neo Light, Neo Dark, Light, Dark, Cyberpunk — and active-theme indicator), running Neo.main.DomAccess.startViewTransition from the selection click coordinates before applying the chosen theme.
  2. Family-sharded rollout across all non-workbench examples:
    • Every non-ConfigurationViewport standalone example mounts {module: ThemeSwitcher} (or 'theme-switcher') in its header toolbar (adding a minimal header bar only onchromeless standalone examples where needed, and upgrading single-theme neo-config.json manifests to at least ["neo-theme-neo-dark", "neo-theme-neo-light"] wherever the underlying component family supports both themes).
    • Existing bespoke onThemeButtonClick / syncThemeButton boilerplate in standalone examples may migrate onto Neo.button.ThemeSwitcher opportunistically within each family slice without breaking existing E2E selectors.

Decision Record impact: none. Structure-map gate: N/A in neomjs/neo (ai:structure-map is Brain-hosted; src/button/ThemeSwitcher.mjs follows structural-pre-flight Stage 1 fast-path beside src/button/{Base,Split,Menu,Effect}.mjs).

Out of Scope

  • Examples extending Neo.examples.ConfigurationViewport (76 component-workbench examples, which already expose theme selection inside the workbench configuration panel).
  • Changing theme color palettes themselves (owned by family theme tickets).

Avoided Traps

  • Copy-pasting 30 lines of onThemeButtonClick + startViewTransition into 80+ examples: violates AGENTS.md §self_evolving_systems Accretion Defense and fails to handle 5-theme examples (board, scheduler, gantt, timeline) that need a dropdown rather than a binary toggle.
  • Hardcoding a two-theme toggle on 5-theme examples: hides neo-theme-light, neo-theme-dark, and neo-theme-cyberpunk that those examples ship in neo-config.json.
  • Breaking E2E tests that assert toolbar button counts or .theme-switch selectors: preserve semantic cls hooks and scope toolbar queries cleanly.

Related

unowned-rationale: Engine 14 release-blocker umbrella epic open for parallel swarm execution across leaf sub-tickets.

Live latest-open + closed sweep: checked latest 25 open (79 open total, red band — successor epic required because #21140 has 42 subs and #20874 has 26 subs, both above epic-create Procedure 1's ~25 cap) + open and closed search (theme switcher examples, TimeAxisHeader hover, headerGroups theme, Out of Scope read on #20879, #20932, #20635) at 2026-11-21T01:44Z; no equivalent epic found. Epic sweep: 15 open predicates (#21367, #21358, #21346, #21329, #21213, #21198, #21175, #21140, #21032, #20892, #20874, #20682, #20671, #20667, #20498) + closed search (theme switcher OR examples theme, 10 hits) read, no shared terminal predicate. A2A in-flight sweep: scanned latest 30 messages across all read states (00:58Z–01:44Z); zero competing claim on example theme switchers. MC sweep: query_raw_memories + ask_knowledge_base (standalone examples theme switcher dropdown startViewTransition, 5 refs); no conflicting decision. Own-assignment sweep: 1 open (#21621, PR #21694), disjoint.

Origin Session ID: 59ca0d8c-dfdf-4d07-aefe-8ec5c658a398

Retrieval Hint: "standalone non-workbench examples theme switcher dropdown startViewTransition expanding wave Neo.button.ThemeSwitcher"