Skip to content

feat: let themes set how far the focused window's box reaches past the icon - #632

Merged
M4n0x merged 1 commit into
mainfrom
feat/627-focused-window-padding
Nov 13, 2026
Merged

M4n0x merged 1 commit into
mainfrom
feat/627-focused-window-padding

Conversation

@M4n0x

@M4n0x M4n0x commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Problem

The focused window's box always reaches 3 pt past the icon on each side and 2 pt above and below, so a theme can round it but not make it slimmer. Closes #627.

Changes

  • Box size. paddingHorizontal and paddingVertical on focusedWindowStyle set how far the box reaches past the icon. They default to 3 and 2 pt, so existing setups look the same. While magnification zooms the icons, the box still hugs the icon: at most 2 pt beside it and none above and below.
  • Configuration. No new keys. focusedWindowStyle is a style, so the schema and the decoder already accept both; the box ignored them until now. Older builds still load a file that sets them.
  • Tonhalle Line 1.1.1. Its workspaceDefaults.focusedWindowStyle sets cornerRadius: 4, paddingHorizontal: 2 and paddingVertical: 1: an 18 × 16 pt box with 4 pt corners instead of a square 20 × 18 pt one. Like any theme value there, it turns the box on for workspace widgets that don't set focusedWindowStyle, and null turns it off; both checked with a render. 1.1.1 needs StableBar 0.15 or later, since 0.14 doesn't know focusedWindowStyle. The presentation example selects 1.1.1, and its test expects it.
  • Docs. docs/widgets.md gives the box's default reach, the two keys and how it behaves with magnification. docs/themes.md describes 1.1.1.
  • Scene. scenes/workspace-focused-window-padding-bar.json sets the same box on the built-in look. main ignores the padding, so the screens bot shows the difference.
  • Other surfaces. Includes, templates, profiles and package overrides layer it like any focusedWindowStyle property. Settings has only the on/off toggle for this box, which is unchanged.

Testing

  • swift build --build-tests; swift test --filter on the Tonhalle example, presentation, scene, style, schema and customization tests: 84 Swift Testing and 4 XCTest tests pass. scripts/check.sh --quick and commitlint pass.
  • StableBar --validate on a scratch copy of the presentation example with 1.1.1 installed: valid, 18 widgets in 5 files. The theme's own config.json validates too.
  • Images below: offscreen renders of Tonhalle Line 1.1.0 and 1.1.1 with "windows": true and Terminal focused, in dark and light.
  • Not checked: a running bar with the new theme.

Tonhalle Line 1.1.0's square box and 1.1.1's softer, slimmer box

Merging

One commit, any merge method. #631 stops the box changing shape on hover without magnification. It touches another part of BarView.swift, and the two merge cleanly in either order.

Claude Opus 5.5 via Claude Code

…e icon

The box behind the focused window's icon always reached 3 pt past it on each side and 2 pt
above and below, so a theme could round it but not make it slimmer. paddingHorizontal and
paddingVertical on focusedWindowStyle now set that reach, 3 and 2 pt when unset. While
magnification zooms the icons, the box still hugs the icon as before.

Tonhalle Line 1.1.1 uses it for a softer, slimmer box: 4 pt corners, 2 pt past the icon on
each side and 1 pt above and below. The presentation example selects 1.1.1, and a new scene
draws the padded box so the screens bot shows the change.

Closes #627
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner November 13, 2026 14:24
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Focused-window highlights now use configurable horizontal and vertical padding. The Tonhalle Line example sets these values, updates to version 1.1.1, and documents the focused-window styling.

Changes: Focused-window styling

Layer / File(s) Summary
Apply focused-window padding
Sources/StableBar/BarView.swift, docs/widgets.md
The highlight reads padding from its style. Magnified highlights cap horizontal padding at 2 points and retain zero vertical padding. Documentation describes the padding controls and magnification behavior.
Update Tonhalle Line example and references
examples/packages/tonhalle-line/config.json, scenes/workspace-focused-window-padding-bar.json, examples/packages/tonhalle-line/package.json, examples/presentation/config.json, Tests/StableBarTests/PresentationIntegrationTests.swift, docs/themes.md
The Tonhalle Line configuration and scene set focused-window padding and corner radius. The package and presentation example use version 1.1.1. The integration test and theme documentation reflect the update.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 5d798

Focused-window highlights now follow configured padding, and the defaults are unchanged for configurations that don't set it. Turning the highlight off in Settings still works with the updated Tonhalle Line theme. No merge-blocking risk was found.

Pre-merge checks: Passed 3

Check name Status Explanation
Description check Passed The description covers the problem (fixed 3 pt / 2 pt box reach, with a reference to issue #627), the changes (new paddingHorizontal and paddingVertical keys, Tonhalle Line 1.1.1, docs, scene, and oth…
Linked Issues check Passed Issue #627 has two coding requirements. (1) paddingHorizontal and paddingVertical on focusedWindowStyle must set the box reach. Defaults are 3 pt and 2 pt. While magnifying, the box reaches at most 2 …
Out of Scope Changes check Passed All changed files relate to #627. BarView.swift changes the highlight padding to use the two new style keys. The Tonhalle Line package and config files and the presentation example version bump delive…
Full details: Description check

Explanation

The description covers the problem (fixed 3 pt / 2 pt box reach, with a reference to issue #627), the changes (new paddingHorizontal and paddingVertical keys, Tonhalle Line 1.1.1, docs, scene, and other surfaces), and the testing performed (build, test filters, check script, commitlint, StableBar --validate, and renders), and it names what was not checked. It also covers the merging method (one commit, any merge method) and ends with the agent line required by the template. The Merging section is brief but gives the needed information, and the template asks for a squash-message check only when squashing, which the author addresses by saying one commit. The Problem section does not use the template's 'Fixes #' phrasing, but it links the issue with 'Closes #627'. The description is complete enough to pass.

Full details: Linked Issues check

Explanation

Issue #627 has two coding requirements. (1) paddingHorizontal and paddingVertical on focusedWindowStyle must set the box reach. Defaults are 3 pt and 2 pt. While magnifying, the box reaches at most 2 pt beside the icon and none above or below. The reviewed summary of Sources/StableBar/BarView.swift states that FocusedWindowHighlight reads style.paddingHorizontal (default 3, capped at 2 when magnifying) and style.paddingVertical (default 2, zero when magnified). This matches the requirement. (2) The Tonhalle Line theme must move to 1.1.1 with focusedWindowStyle cornerRadius 4, paddingHorizontal 2 and paddingVertical 1 in workspaceDefaults. The summary of examples/packages/tonhalle-line/config.json and package.json confirms this. Documentation in docs/widgets.md is also updated, as the issue requests. No configuration format change is needed, and the summary reports none. The test expectation for the 1.1.1 manifest is updated. The issue does not ask for new automated tests. Limitation: the BarView.swift diff could not be read (changed blobs unavailable), and the file read was truncated before FocusedWindowHighlight. The verdict relies on the AI-generated summary for that code.

Full details: Out of Scope Changes check

Explanation

All changed files relate to #627. BarView.swift changes the highlight padding to use the two new style keys. The Tonhalle Line package and config files and the presentation example version bump deliver the requested 1.1.1 theme. The presentation test expectation follows the version bump. docs/widgets.md and docs/themes.md document the new keys and theme. The scene file scenes/workspace-focused-window-padding-bar.json demonstrates the box for the same feature. It has no effect beyond the feature. The PR description states that Settings, the on/off toggle and the configuration schema are unchanged. The linked issue #626 (hover shape) and PR #631 are not implemented here, and no change in this PR addresses them. Limitation: the BarView.swift hunk could not be read directly, so the absence of unrelated edits there rests on the summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0b4d4ed and 5d7985a.

Files selected for processing: 8

  • Sources/StableBar/BarView.swift
  • Tests/StableBarTests/PresentationIntegrationTests.swift
  • docs/themes.md
  • docs/widgets.md
  • examples/packages/tonhalle-line/config.json
  • examples/packages/tonhalle-line/package.json
  • examples/presentation/config.json
  • scenes/workspace-focused-window-padding-bar.json

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

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Before and after

main at 0b4d4ed → this pull request at 5d7985a · 150 screens drawn in one CI job · 2 changed

Screen Change Where (image pixels)
scenes/workspace-focused-window-padding-bar-dark 340 pixels 164,22 · 40×36
scenes/workspace-focused-window-padding-bar-light 340 pixels 164,22 · 40×36

scenes/workspace-focused-window-padding-bar-dark

Before After
Before After

Difference, changed pixels in red:

Difference

scenes/workspace-focused-window-padding-bar-light

Before After
Before After

Difference, changed pixels in red:

Difference

148 unchanged screens

docs/essentials-clock-settings-dark, docs/essentials-clock-settings-light, docs/essentials-dark, docs/essentials-light, docs/essentials-settings-dark, docs/essentials-settings-light, docs/hero-dark, docs/hero-light, docs/popups-dark, docs/popups-light, docs/settings-dark, docs/settings-light, docs/themes-dark, docs/themes-light, scenes/accessibility-guide-dark, scenes/accessibility-guide-light, scenes/app-menu-popup-dark, scenes/app-menu-popup-light, scenes/apple-menu-settings-dark, scenes/apple-menu-settings-light, scenes/bottom-bar-popup-dark, scenes/bottom-bar-popup-light, scenes/chat-popup-dark, scenes/chat-popup-light, scenes/crowded-edit-bar-dark, scenes/crowded-edit-bar-light, scenes/dock-badges-bar-dark, scenes/dock-badges-bar-light, scenes/edit-bar-wide-group-dark, scenes/edit-bar-wide-group-light, scenes/essentials-clock-popup-dark, scenes/essentials-clock-popup-light, scenes/gruvbox-bar-dark, scenes/gruvbox-bar-light, scenes/horizontal-list-popup-dark, scenes/horizontal-list-popup-light, scenes/increase-contrast-bar-dark, scenes/increase-contrast-bar-light, scenes/increase-contrast-popup-dark, scenes/increase-contrast-popup-light, scenes/input-source-popup-dark, scenes/input-source-popup-light, scenes/notch-flare-bar-dark, scenes/notch-flare-bar-light, scenes/privacy-both-bar-dark, scenes/privacy-both-bar-light, scenes/privacy-hide-when-idle-bar-dark, scenes/privacy-hide-when-idle-bar-light, scenes/privacy-idle-bar-dark, scenes/privacy-idle-bar-light, scenes/privacy-microphone-bar-dark, scenes/privacy-microphone-bar-light, scenes/privacy-settings-dark, scenes/privacy-settings-light, scenes/reduce-transparency-bar-dark, scenes/reduce-transparency-bar-light, scenes/reduce-transparency-glass-bar-dark, scenes/reduce-transparency-glass-bar-light, scenes/settings-bar-dark, scenes/settings-bar-light, scenes/settings-bar-placement-bottom-dark, scenes/settings-bar-placement-bottom-light, scenes/settings-bar-placement-dark, scenes/settings-bar-placement-light, scenes/settings-crashes-dark, scenes/settings-crashes-light, scenes/settings-feedback-dark, scenes/settings-feedback-light, scenes/settings-general-dark, scenes/settings-general-light, scenes/settings-general-macos15-dark, scenes/settings-general-macos15-light, scenes/settings-general-move-dark, scenes/settings-general-move-failed-dark, scenes/settings-general-move-failed-light, scenes/settings-general-move-light, scenes/settings-general-move-moving-dark, scenes/settings-general-move-moving-light, scenes/settings-general-move-replace-dark, scenes/settings-general-move-replace-light, scenes/settings-general-setup-open-dark, scenes/settings-general-setup-open-light, scenes/settings-general-spaces-dark, scenes/settings-general-spaces-light, scenes/settings-help-dark, scenes/settings-help-light, scenes/settings-help-starred-dark, scenes/settings-help-starred-light, scenes/settings-narrow-dark, scenes/settings-narrow-light, scenes/settings-package-dark, scenes/settings-package-light, scenes/settings-package-widget-dark, scenes/settings-package-widget-light, scenes/settings-theme-dark, scenes/settings-theme-light, scenes/settings-uninstall-dark, scenes/settings-uninstall-failed-dark, scenes/settings-uninstall-failed-light, scenes/settings-uninstall-light, scenes/settings-widget-backgrounds-dark, scenes/settings-widget-backgrounds-light, scenes/settings-workspace-hidden-dark, scenes/settings-workspace-hidden-light, scenes/setup-look-below-menu-bar-dark, scenes/setup-look-dark, scenes/setup-look-no-notch-dark, scenes/setup-move-existing-dark, scenes/setup-move-failed-dark, scenes/setup-move-ready-dark, scenes/setup-move-replace-dark, scenes/setup-omniwm-connection-dark, scenes/setup-permissions-dark, scenes/setup-permissions-spaces-dark, scenes/setup-permissions-spaces-ready-dark, scenes/setup-placement-bottom-dark, scenes/setup-placement-dark, scenes/setup-touches-dark, scenes/setup-touches-macos15-dark, scenes/setup-touches-spaces-dark, scenes/setup-try-dark, scenes/setup-yabai-connection-dark, scenes/slider-end-stop-popup-dark, scenes/slider-end-stop-popup-light, scenes/stablebar-widget-bar-dark, scenes/stablebar-widget-bar-light, scenes/stablebar-widget-settings-dark, scenes/stablebar-widget-settings-light, scenes/starter-bar-dark, scenes/starter-bar-light, scenes/starter-edit-bar-dark, scenes/starter-edit-bar-light, scenes/system-monitor-memory-bar-dark, scenes/system-monitor-memory-bar-light, scenes/system-monitor-shows-settings-dark, scenes/system-monitor-shows-settings-light, scenes/update-popup-dark, scenes/update-popup-light, scenes/update-popup-star-github-cli-dark, scenes/update-popup-star-github-cli-light, scenes/update-popup-star-thanks-dark, scenes/update-popup-star-thanks-light, scenes/workspace-badges-bar-dark, scenes/workspace-badges-bar-light, scenes/workspace-focused-window-bar-dark, scenes/workspace-focused-window-bar-light, scenes/workspace-hidden-apps-bar-dark, scenes/workspace-hidden-apps-bar-light

Visual review: 2 changed screens approved.

@M4n0x M4n0x added the visual-ok A maintainer looked at the changed screens and approves them label Nov 13, 2026
@M4n0x
M4n0x merged commit badfea6 into main Nov 13, 2026
16 checks passed
@M4n0x
M4n0x deleted the feat/627-focused-window-padding branch November 13, 2026 15:06
@stablebar-releases

Copy link
Copy Markdown

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

released visual-ok A maintainer looked at the changed screens and approves them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let a theme set how far the focused window's box reaches past the icon

1 participant