test(themes): end-to-end theme-picker recolor verification (k5a.5)#49
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end regression test for epic k5a done-gate #1, verifying that clicking a theme picker option recolors the entire bar live by replicating the daemon's per-render basePalette resolution.
Changes:
- New test file exercises real spine:
registerDslConfig+renderDsl+parseHandlerUrl+VERBS. - Asserts whole-bar background SGR footprint changes (disjoint dark↔light), the non-picker
plainsegment recolors, and active-marking tracks the rendered theme.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proves epic k5a done-gate #1: a set-state `theme` click recolors the WHOLE bar live. The existing widget test passes a STATIC basePalette into renderDsl, so it verifies the click writes SessionState but never the recolor — which lives in the daemon's per-render basePalette resolution (effectiveThemeName -> resolverForThemeName), OUTSIDE renderDsl. This test replicates that resolution exactly as src/daemon/server.ts does, so a click changes the bytes a non-picker segment renders. Asserts: whole-bar bg-color footprint changes (dark<->light disjoint), the non-picker segment itself recolors, and active-marking tracks the rendered theme (config-default bold initially, picked option bold after the click). [LAW:verifiable-goals][LAW:single-enforcer] drives the real spine — registerDslConfig + renderDsl + parseHandlerUrl + VERBS, no parallel rig. Follow-up k5a.6 owns the paginated-menu widget (collapse + width-paginated navigation) that replaces the flat overflowing picker.
5bc4e6f to
34e6a64
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.
What
Adds an end-to-end regression test proving epic k5a done-gate #1: a set-state
themeclick recolors the whole bar live.Why this test is needed
The existing widget test (
test/dsl-widgets.test.ts) passes a staticbasePaletteintorenderDsl, so it verifies the click writes SessionState and active-marking moves — but never the recolor. The recolor lives in the daemon's per-renderbasePaletteresolution (effectiveThemeName -> resolverForThemeName), which is outsiderenderDsl. This test replicates that resolution exactly assrc/daemon/server.tsdoes, so it proves the loop a real daemon runs.Asserts
plainsegment itself recolors (not just the picker).[LAW:verifiable-goals][LAW:single-enforcer]— drives the real spine (registerDslConfig+renderDsl+parseHandlerUrl+VERBS), no parallel rig.Scope note
The theme picker was also added to the user's live
~/.config/cc-candybar/config.json5(outside the repo) and verified end-to-end through the real installed click path (daemon + URL handler both rebuilt — both were stale pre-widgets/pre-set-statebuilds). The picker's collapse + overflow UX (a width-paginatedmenuwidget) is tracked as follow-up k5a.6, which keeps epic k5a open until the picker is genuinely usable.