Skip to content

feat: give themes light and dark colors and organize Customize around the bar's look - #31

Merged
Seb-GRAF merged 4 commits into
mainfrom
feat/customize-appearance
Oct 16, 2026
Merged

Seb-GRAF merged 4 commits into
mainfrom
feat/customize-appearance

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

Changing how the bar looks was hard to follow. Colors that StableBar wrote on its own hid a chosen theme (#28). A color was one fixed value, so any color you set stopped following light or dark mode, a theme's dark profile beat your own tokens, and the built-in look wasn't a theme at all (#29). Customize hid the theme picker in a popover, left most styles to JSON and never showed what overrides the theme (#30). The bar's menus also listed five configuration actions next to each other.

Fixes #28
Fixes #29
Fixes #30

The three issues share one pull request on request, plus the menu change raised while trying the branch. Each has its own commit.

Changes

Colors and themes (feat, #29)

  • A color is "#RRGGBB[AA]" or { "light": "#…", "dark": "#…" }. Pairs render as a dynamic NSColor, and tokens carry them unchanged.
  • bar.appearance (light or dark) keeps the bar and its popups in one appearance and decides which when.appearance profiles match, including when it comes from a token. Setup's Light and Dark set it instead of writing five colors into defaults, and setup now offers Appearance for every theme.
  • Themes ship in Resources/themes, which scripts/build.sh copies into the app: Built-in (the old hard-coded look plus the nine shared tokens), Slate (moved from examples/themes, converted to pairs), Paper and Graphite. "theme": { "id": "slate" } without a version selects one; with a version, theme still selects an installed package.
  • Built-in loads after widget packages and before the selected theme. Shared tokens always resolve, a theme only needs what it changes, and your own tokens beat a theme in both appearances. WidgetStyle.light/.dark and the systemColor fallbacks are gone.
  • Schema: color pairs, bar.appearance and theme without a version. README: "Layout and style", "Theme tokens and automatic profiles", "Themes" (formerly "Theme packages"), setup and command-line controls.

Colors StableBar wrote (fix, #28)

  • The starter configuration no longer sets defaults.accent; Built-in supplies it.
  • The first time the new version starts, migrateEarlierColors replaces setup's old Light and Dark colors with bar.appearance, removes the null widget colors that setup's Automatic choice wrote, and removes the starter's #007aff accent. Only exact values change, and only once, so colors set by hand stay, including a #007aff accent added later.

Customize (feat, #30)

  • A sidebar replaces the tabs: Appearance, Widgets, Profiles, Packages and Diagnostics (formerly Inspector).
  • Appearance: theme cards with light and dark previews, the appearance switch, the nine theme colors as light and dark wells saved in tokens, default colors, font, weight, size, padding and corners, and the bar's size and position.
  • Widgets: text, background, hover, border and accent colors follow a theme color or a custom pair; font, weight, size, padding, corners and border width.
  • Every style control says where its value comes from, using BarStore.origins, which now records the token behind a value. A value set in the main file shows Reset to default.
  • New edit actions, shared with --batch: tokens, and unset, which removes keys from the main file so the inherited value applies again (unlike null, which clears it). unset never removes a parent that a token supplies.
  • Rendering and the weight picker share one font-weight table.
  • The editing checklist in AGENTS.md names the new sections.

Menus (feat)

  • The menu-bar icon and the bar's right-click menu keep Customize StableBar…, the current error and Quit. Running setup, opening, showing and reloading the configuration file, and reconnecting the workspace source move to a new General section in Customize. Setup's last step, the installer note and the README point there.

Breaking for existing configurations

This stays on 0.x, so no commit uses !.

  • A token named text, surface, surfaceRaised or accent must be a color, because Built-in's defaults use those names. A string or object token with one of these names now fails to load with an error about defaults.
  • An explicit null color in defaults means no color instead of the built-in one. The first start removes the nulls that setup wrote.
  • Configurations without defaults.accent get Built-in's system blue (#007aff, #0a84ff in dark mode) instead of the orange fallback.
  • The bar's menus no longer offer setup, the configuration file, reload or reconnect; they are in Customize → General.

Testing

  • swift test: 114 passed, and each commit builds and passes on its own.
    • ThemePackageTests: color pairs and their errors; Built-in under every theme, replacing package fallbacks while package-only tokens survive; your tokens beating Slate in light and dark; bundled theme selection, unknown themes and package selections without a version; every bundled theme defines all nine tokens with different light and dark values; bar.appearance, set directly or through a token, deciding appearance profiles; migrating setup's Light, Dark and Automatic colors, partial nulls and the starter accent, after which Slate's colors show, while hand-set colors stay byte for byte.
    • RuntimeControlTests: tokens and unset edits, reset falling back to an included file's value, unset leaving a token reference intact, and source captions.
    • WidgetTests: setup writes bar.appearance and selects bundled themes by ID.
  • Built the app into a temporary folder with scripts/build.sh and ran --validate on Resources/config.json, examples/modular, examples/interactive and a configuration for each bundled theme with bar.appearance set to dark. An unknown theme fails with its message.
  • Ran the build as the maintainer's own bar against their configuration: it loaded without errors, and theme, appearance and default changes saved from Customize kept the file's formatting.
  • Rendered the real views offscreen from these sources with a scratch configuration, without putting a second bar on screen: the old and new Customize window, setup's appearance step, and the bar under each theme in light and dark and with a forced appearance. Screenshots to follow.
  • Not checked: the color panel and popups in a forced appearance.

Merging

Use a merge commit or a rebase merge so each of the four commits reaches the changelog.

Claude Opus 5.5 via Claude Code

@Seb-GRAF
Seb-GRAF requested a review from M4n0x as a code owner October 16, 2026 08:15
@Seb-GRAF
Seb-GRAF merged commit b0353b5 into main Oct 16, 2026
4 checks passed
@Seb-GRAF
Seb-GRAF deleted the feat/customize-appearance branch October 16, 2026 08:18
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

1 participant