Skip to content

fix: draw text-only focused workspaces without a fill in theme previews - #401

Merged
M4n0x merged 2 commits into
mainfrom
fix/400-theme-preview-text-only-focus
Nov 1, 2026
Merged

M4n0x merged 2 commits into
mainfrom
fix/400-theme-preview-text-only-focus

Conversation

@M4n0x

@M4n0x M4n0x commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Problem

Gruvbox and Notch show the focused workspace by text color alone ("indicator": "none"). Their theme cards, the large preview on the Theme page, setup's theme cards and a theme's package page still drew a filled block behind it. On Gruvbox the orange block hid the orange focused number. Picking either theme then made the bar look as if it didn't mark the focused workspace.

Fixes #400

Changes

  • fix: ThemeSampleBar fills the focused workspace only for the background indicator, which is the default when a theme sets none. That is the rule BarView follows. Every preview built on ThemeSampleBar follows: theme cards, the Theme page preview, setup's tour and demo, and package pages.
  • build: a new scene, scenes/settings-theme.json, draws Settings → Theme with every bundled theme's card, so the screens bot shows this change.

The themes are unchanged: Notch keeps the text-only focus decided in #127, and the website already draws both themes this way.

Testing

  • New test testSampleBarFillsTheFocusedWorkspaceOnlyForTheBackgroundIndicator renders the sample bar with a magenta accent. It failed before the fix, with 425 accent pixels for none. It now finds none for none, and a fill for background and for no indicator.
  • swift test --filter "ThemeCardTests|ThemePreviewTests|ThemeGalleryTests|SetupTour|SetupDemo" passes, 29 tests.
  • Drew the new scene and the Theme page with Gruvbox selected, using --render-scenes from main and from this branch:
Before After
Theme page, Gruvbox
Gruvbox card
Notch card

Not checked: the setup tour and the package page, which use the same ThemeSampleBar code.

Merging

Two commits, a fix and a build. A merge commit or rebase merge keeps both in the changelog.

Claude Opus 5.5 via Claude Code

M4n0x added 2 commits November 1, 2026 13:25
The sample bar in theme cards, the Theme page, setup and package pages filled
the focused workspace for every indicator but `underline`, including `none`.
Gruvbox and Notch use `none`, so their previews showed a block the bar never
draws, and Gruvbox's orange block hid its orange focused number.

The sample bar now fills the cell only for the `background` indicator, the
default, as the bar does.

Closes #400
The screens bot now draws Settings > Theme with every bundled theme's card.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner November 1, 2026 12:26
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 8cc7921 and 984e0d8.

Files selected for processing: 3
  • Sources/StableBar/ThemeCard.swift
  • Tests/StableBarTests/ThemeCardTests.swift
  • scenes/settings-theme.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

Theme previews now draw a focused workspace background only for the background indicator. A rendering test checks unset, background, and default indicator configurations. A new scene configuration targets the Settings theme view.

Changes: Theme preview focus rendering

Layer / File(s) Summary
Focused workspace rendering and validation
Sources/StableBar/ThemeCard.swift, Tests/StableBarTests/ThemeCardTests.swift, scenes/settings-theme.json
workspaceCell applies the focused label background for the background indicator, not for an unset indicator. The rendering test checks unset, background, and default configurations. The new scene configuration targets the Settings theme view.

Possibly related PRs

  • Seb-GRAF/StableBar#396: Adds the Settings scene format and renderer used by the new scene configuration.
  • Seb-GRAF/StableBar#397: Adds scene rendering for pull-request screen comparisons, which can capture the Settings theme view.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 984e0

No actionable merge-blocking risk remains after resolving the preview configuration concern.

Pre-merge checks: Passed 3
Check name Status Explanation
Description check Passed The description includes all required sections: Problem, Changes, Testing, and Merging. It links issue #400, explains the implementation and rationale, reports automated and manual testing, documents …
Linked Issues check Passed PR #400 requires previews to match bar behavior for none indicators. ThemeSampleBar.workspaceCell now fills a focused workspace only when (workspace?.indicator ?? .background) == .background. Th…
Out of Scope Changes check Passed The changed source and test implement PR #400. The new scenes/settings-theme.json supports the stated screen-rendering verification for the Settings → Theme preview. No unrelated behavior or theme d…
Full details: Description check

Explanation

The description includes all required sections: Problem, Changes, Testing, and Merging. It links issue #400, explains the implementation and rationale, reports automated and manual testing, documents untested areas, states the merge requirement, and ends with the model and harness used.

Full details: Linked Issues check

Explanation

PR #400 requires previews to match bar behavior for none indicators. ThemeSampleBar.workspaceCell now fills a focused workspace only when (workspace?.indicator ?? .background) == .background. This removes the fill for Gruvbox and Notch while preserving the default background indicator. The shared component covers the listed theme cards, Settings → Theme preview, setup views, and package views. testSampleBarFillsTheFocusedWorkspaceOnlyForTheBackgroundIndicator verifies none, background, and the default case.

Full details: Out of Scope Changes check

Explanation

The changed source and test implement PR #400. The new scenes/settings-theme.json supports the stated screen-rendering verification for the Settings → Theme preview. No unrelated behavior or theme data changes appear in the whole-PR diff.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@M4n0x
M4n0x merged commit cf80635 into main Nov 1, 2026
13 checks passed
@M4n0x
M4n0x deleted the fix/400-theme-preview-text-only-focus branch November 1, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theme previews draw a focus block for themes whose focused workspace is text only

1 participant