Skip to content

feat: pick theme colors from the base and recent colors, and reset settings to the base theme - #726

Merged
Seb-GRAF merged 1 commit into
mainfrom
feat/theme-creator-color-picker
Nov 16, 2026
Merged

Seb-GRAF merged 1 commit into
mainfrom
feat/theme-creator-color-picker

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

The theme creator edits colors with the browser's own color input. It looks different in every browser, can't set opacity, and gives no way back to the base theme's value except choosing the base again, which drops every other edit. Fixes #725.

Changes

  • A color picker drawn by the page (site/creator/page.mjs, creator.css). The swatch beside each hex field opens a popover with a saturation and brightness area, a hue slider and an opacity slider. It edits #RRGGBBAA directly, so the old rule that kept the previous alpha is gone. Swatches show opacity over a checkerboard. The area takes arrow keys (Shift for steps of 10%); Escape, a click outside or tabbing away closes it. On a phone, a popover that would leave the screen opens toward the left.
  • Base theme color: the picker shows the base theme's color for the appearance in the preview, to pick with one click. It's left out when the base has no single color there, such as Gruvbox's gradient strip or a cleared shadow.
  • Recent colors: the last eight colors picked or typed, newest first, kept in localStorage under recent-colors.
  • Reset beside every setting except About, shown when the setting differs from the base theme. It writes back the base's own value, token references included, for both appearances, and removes keys the base doesn't have, along with empty parents (resetControl and differsFromBase in theme.mjs).
  • site/creator/color-field.mjs holds the hex and HSV conversion and the recent-colors list, like number-field.mjs does for numbers.
  • docs/themes.md mentions the picker and Reset.

Testing

  • node --test .github/scripts/theme-creator*.test.mjs: 153 pass. New tests check that hex colors survive HSV conversion with their opacity, the order and limit of recent colors, and that resetting four kinds of settings gives back each bundled theme's exact config.json. app-release.test.mjs fails here on main too.
  • scripts/check.sh --quick passes.
  • Headless Chrome at 1440 and 390 px. Typing three colors fills Recent. Clicking a swatch opens the picker with focus on the area. Dragging past the corner clamps. Arrow keys, hue and opacity give the expected hex. The base swatch applies #007aff. Escape returns focus to the swatch. Reset brings back the base color and hides itself; Nord's bar height resets to 30. A click outside closes the picker. On a phone, the right column's popover stays on screen with no horizontal scroll. In the Dark preview, the base swatch shows the dark value.
  • Not tested: Safari and Firefox. The range thumbs have WebKit and Firefox styles, but only Chrome was checked.
  • The screens bot draws the page at rest: swatches with opacity now show a checkerboard. Screenshots of the open picker will follow in a comment.

Merging

One commit; any merge method works.

Claude Opus 5.5 via Claude Code

@Seb-GRAF
Seb-GRAF requested a review from M4n0x as a code owner November 16, 2026 13:58
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8d3088d and 5b1cf4d.

Files selected for processing: 7

  • .github/scripts/theme-creator-page.test.mjs
  • .github/scripts/theme-creator.test.mjs
  • docs/themes.md
  • site/creator/color-field.mjs
  • site/creator/creator.css
  • site/creator/page.mjs
  • site/creator/theme.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Before and after

main at 8d3088d → this pull request at 5b1cf4d · 20 screens drawn in one CI job · 4 changed

Screen Change Where (image pixels)
site/create-theme-desktop-dark 11,703 pixels 320,1314 · 526×1076
site/create-theme-desktop 11,662 pixels 320,1314 · 526×1076
site/create-theme-phone-dark 28,339 pixels 105,3372 · 582×1812
site/create-theme-phone 28,219 pixels 105,3372 · 582×1812

site/create-theme-desktop-dark

Before After
Before After

Difference, changed pixels in red:

Difference

site/create-theme-desktop

Before After
Before After

Difference, changed pixels in red:

Difference

site/create-theme-phone-dark

The images show the first 1,600 rows of this change.

Before After
Before After

Difference, changed pixels in red:

Difference

site/create-theme-phone

The images show the first 1,600 rows of this change.

Before After
Before After

Difference, changed pixels in red:

Difference

16 unchanged screens

site/404-desktop-dark, site/404-desktop, site/404-phone-dark, site/404-phone, site/index-desktop-dark, site/index-desktop, site/index-phone-dark, site/index-phone, site/privacy-desktop-dark, site/privacy-desktop, site/privacy-phone-dark, site/privacy-phone, site/terms-desktop-dark, site/terms-desktop, site/terms-phone-dark, site/terms-phone

Visual review: 4 screens changed: a maintainer adds visual-ok after looking.

@Seb-GRAF

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Seb-GRAF
Seb-GRAF merged commit ba02ebe into main Nov 16, 2026
14 of 15 checks passed
@Seb-GRAF
Seb-GRAF deleted the feat/theme-creator-color-picker branch November 16, 2026 14:11
stablebar-releases Bot pushed a commit that referenced this pull request Nov 16, 2026
## [0.17.0](v0.16.0...v0.17.0) (2026-11-16)

### Features

* add a Wi-Fi provider with the network name, signal and power by @Seb-GRAF ([41515b4](41515b4))
* build a theme on the website and download it for StableBar ([#682](#682)) by @M4n0x ([8d3088d](8d3088d))
* choose the audio output device from a popup by @Seb-GRAF ([f4be3f7](f4be3f7))
* draw a progress block as dots or segments by @Seb-GRAF ([27360e3](27360e3))
* leave a gap at the bottom of a ring by @Seb-GRAF ([f0bce8c](f0bce8c))
* link StableBar's Ko-fi page from GitHub, the README, the website and Help ([#717](#717)) by @Seb-GRAF ([c109e59](c109e59)), closes [#716](#716)
* list connected Bluetooth devices with their battery by @Seb-GRAF ([9ab0161](9ab0161))
* list every widget by category in a Store tab, and open it from the bar ([#711](#711)) by @Seb-GRAF ([e3adeb1](e3adeb1))
* open a detail view inside a popup, with a back arrow by @Seb-GRAF ([135ac07](135ac07))
* pass merged providers' temporary output on, so a merge can flash the volume by @Seb-GRAF ([1a5ea5d](1a5ea5d))
* pass merged providers' text, icon and tooltip on as fields by @Seb-GRAF ([6b75b37](6b75b37))
* pick theme colors from the base and recent colors, and reset settings to the base theme ([#726](#726)) by @Seb-GRAF ([ba02ebe](ba02ebe))
* report the battery's cycle count, maximum capacity and Low Power Mode by @Seb-GRAF ([51b0aff](51b0aff))
* set the volume, mute and Wi-Fi power from popup controls by @Seb-GRAF ([69fed2e](69fed2e))

### Bug Fixes

* keep the bar above the menu bar strip when a full-screen window sits at the menu bar level by [@alexandrebucci](https://github.com/alexandrebucci) ([3f069d5](3f069d5)), closes [#728](#728)
* stop a cancelled drag from leaving the end-stop slider editing by @Jonathanm10 ([c9cca2e](c9cca2e))
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.17.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

Development

Successfully merging this pull request may close these issues.

Pick colors in the theme creator with the base theme's and recent colors, and reset a setting to the base theme

1 participant