Skip to content

feat(app): redesign theme picker with swatches and live preview - #67752

Merged
gsimone merged 1 commit into
devfrom
theme-picker
Dec 2, 2026
Merged

gsimone merged 1 commit into
devfrom
theme-picker

Conversation

@gsimone

@gsimone gsimone commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor
opencode-theme-picker-pr-1080p60.mp4

Issue for this PR

No linked issue (internal UI improvement).

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Replaces the plain theme Select in Settings → Appearance with a searchable ThemePicker that renders a proportional 5-band color swatch next to each theme name (both on the inline trigger and inside the dropdown) and live-previews themes before committing.

  • Adds resolveThemeSwatch and precomputed BUNDLED_THEME_SWATCHES in packages/ui/src/theme/swatch.ts so all 47 bundled theme swatches paint synchronously without loading every theme JSON up front.
  • Adds a pure state machine (packages/app/src/settings/appearance/theme-picker-machine.ts) and Kobalte Popover + MenuScroll picker (theme-picker.tsx) keeping the existing flat alphabetical theme order, with instant keyboard live preview, debounced pointer preview (180ms warmup / 35ms settle), Enter/click commit, and Escape/close revert.
  • Fixes a 120ms visual lag in applyThemeCss (packages/ui/src/theme/context.tsx) by temporarily suppressing CSS transitions for one paint frame when the theme or color scheme changes so tinted chrome (active Settings nav pill, font inputs, buttons) snaps cleanly with the rest of the page.

No feature flag — direct update to the existing Settings → Appearance theme selector.

How did you verify your code works?

  • Ran bun run lint:changed (0 problems in 10 changed files)
  • Ran bun test (696 pass) and bun run typecheck:tsc in packages/ui
  • Ran bun run test:unit (2,993 pass), bun run typecheck:tsc, and bun run build in packages/app
  • Tested locally in Chromium against a live server and verified via Playwright that theme switches fire 0 stray CSS transitions and settle to exact theme tokens on frame 1

Screenshots / recordings

Recorded locally against the real app (2× DPI); can attach the walkthrough clip on request.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
  • [ ]

@github-actions github-actions Bot added contributor needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant