Customizable app theme (built-in palettes + CLI custom stylesheet)#282
Merged
Conversation
Make the app color palette customizable: server-stored and applied live to all open windows, orthogonal to the per-client light/dark mode. Feature: - Domain/DB/contract/server: single-row app_theme table + appThemeSchema, exposed on GET /system/config and a new PUT /settings/appearance, broadcast via config-changed (migration 0042). - SDK + CLI: `bb theme list|set|set-custom --file|show|reset`. - Frontend: built-in palettes (nord, dracula, solarized, gruvbox) as a CSS registry; useAppTheme injects a trailing <style>; pre-paint cache avoids a flash; Settings -> Appearance palette picker. Make existing chrome follow the tokens so themes render correctly: - theme.css: --surface-scrim derives from --canvas, so the frosted header bar tracks the palette instead of staying white. - PullRequestStatusPill: GitHub status hexes -> text-success / -destructive / -pr-merged / -muted-foreground tokens. - Mermaid: resolve the diagram palette from live CSS vars (probe + canvas rasterize to sRGB) and re-render on palette change via useAppThemeEpoch; the xterm terminal re-themes on the same signal. - Built-in themes set --ansi-bg-fg-* contrast colors. Docs: bb-cli skill gains references/theming.md (token model, what each variable drives, colors, fonts) with a pointer from SKILL.md. Tests: appearance route tests; migrate rewind helper also drops app_theme. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2eb21d7 to
f8367d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the app's color palette customizable — server-stored and applied live to every open window, orthogonal to the per-client light/dark mode.
app_themetable +appThemeSchema; surfaced onGET /system/configand a newPUT /settings/appearance; broadcast viaconfig-changed(migration0042).bb theme list | set <id> | set-custom --file <css> | show [--css] | reset(new@bb/sdktheme area).nord,dracula,solarized,gruvbox) as a CSS-string registry;useAppThemeinjects a trailing<style>(wins the cascade); pre-paint cache avoids a flash; Settings → Appearance palette picker.Make existing chrome follow the tokens
--surface-scrimderives from--canvas, so the frosted header bar tracks the palette (was hardcoded white).PullRequestStatusPill: GitHub status hexes →text-success/-destructive/-pr-merged/-muted-foreground.useAppThemeEpoch; the terminal re-themes on the same signal.--ansi-bg-fg-*contrast colors.Docs
bb-cliskill gainsreferences/theming.md(token model, what each variable drives, colors, fonts), pointed to fromSKILL.md.Tests
apps/server/test/system/appearance.test.ts(default, set built-in, set custom, reject unknown id, reject custom-without-css).migrate.test.tsrewind helper updated to dropapp_theme.Risks / notes
🤖 Generated with Claude Code