Skip to content

OXY-154: reusable color-theme helper (facade + pickers) - #296

Open
Kalin-Rudnicki wants to merge 2 commits into
mainfrom
OXY-154
Open

OXY-154: reusable color-theme helper (facade + pickers)#296
Kalin-Rudnicki wants to merge 2 commits into
mainfrom
OXY-154

Conversation

@Kalin-Rudnicki

Copy link
Copy Markdown
Owner

What

Implements OXY-154 (epic OXY-133 oxygen-ui-rework): a single reusable surface for Oxygen's color theme, covering both bootstrap wiring and the duplicated picker UI.

New

  • service.ColorTheme — unified facade over ColorMode + Theme. install (apply stored mode+pack, then subscribe both cross-tab) replaces the copy-pasted 4-line prePageLoad snippet; also applyStored / subscribeCrossTab. Manual ColorMode/Theme forms still work (nothing removed).
  • component.ColorModePicker — drop-in Light/Dark/System segmented control; self-contained via a shared GlobalState; calls ColorMode.setAndPersist.
  • component.ThemePicker — drop-in OxygenThemes pack-card grid (swatch + name + blurb + selected state), packs filter; calls Theme.applyAndPersist.

Constraints honored: no new storage keys / pack defs / CSS vars; reuses S.color.*; a11y via role=radiogroup + role=radio/aria-checked.

Refactors: UIMain -> ColorTheme.install; electron Renderer -> ColorTheme.applyStored; StylesPage / ThemePage / ShellPage / KitchenSinkPage -> the pickers; docs/ui/index.md + builders.md show the helper as preferred.

Verification

Compiles clean under -Werror -Wunused:all: oxygen-ui-web, example-ui-web, oxygen-ui-electron, example-ui-electron. Not run in a live browser; no Scala.js test suites executed (no tested logic changed).

Notes

  • Pickers cache selection in GlobalState seeded from localStorage; they don't subscribe to Broadcast, so cross-tab/programmatic changes don't re-highlight until re-render (theme application across tabs still works via ColorTheme.install).
  • ThemePage dropped a few extras (live-token chips, apply toast, dynamic "Active:" label) when extracting into ThemePicker.

Decisions, resolved open questions, and an honest confidence score (7.5/10) are in report/OXY-154.md.

🤖 Generated with Claude Code

Kalin-Rudnicki and others added 2 commits August 13, 2026 18:36
Unify Oxygen's two color-theme services behind one ergonomic surface:

- service.ColorTheme: install (apply stored mode+pack, then subscribe both
  cross-tab), applyStored, subscribeCrossTab. Replaces the copy-pasted 4-line
  prePageLoad snippet; ColorMode/Theme manual forms still work.
- component.ColorModePicker: drop-in Light/Dark/System segmented control,
  self-contained via a shared GlobalState, calls ColorMode.setAndPersist.
- component.ThemePicker: drop-in OxygenThemes pack-card grid (swatch/name/
  blurb/selected), packs filter, calls Theme.applyAndPersist.
- a11y: role=radiogroup + role=radio/aria-checked. No new storage keys, pack
  defs, or CSS vars; reuses S.color.* tokens.

Refactors: UIMain -> ColorTheme.install; electron Renderer -> applyStored;
StylesPage/ThemePage/ShellPage/KitchenSinkPage -> pickers; ui docs updated to
show the helper as preferred.

See report/OXY-154.md for decisions + confidence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant