Skip to content

fix: offer the Notch preset only on Macs with a notch - #548

Merged
Seb-GRAF merged 1 commit into
mainfrom
fix/457-notch-preset-needs-notch
Nov 11, 2026
Merged

Seb-GRAF merged 1 commit into
mainfrom
fix/457-notch-preset-needs-notch

Conversation

@M4n0x

@M4n0x M4n0x commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Problem

SetupPreferences.Preset.offered(on:keeping:) checked only the placement, so a Mac mini, an iMac or a MacBook without a notch saw the Notch preset whenever the bar was on the top edge. Its theme is a black bar meant to blend into a MacBook's notch.

Fixes #457

Changes

  • offered(on:hasNotchedDisplay:keeping:) offers Notch only on the top edge and when a connected display has a notch. A Notch preset that's already chosen stays offered, so it can still be deselected.
  • SetupSystem.hasNotchedDisplay uses the bar's own notch detection (BarDisplay(screen:).notch), so setup offers Notch exactly where the bar leaves a notch gap and displays: "notched" matches. It's injectable for tests and scenes.
  • Setup re-reads it on the screen-change notification it already observes: plugging in or unplugging a display, or opening or closing the lid, updates the tiles without polling.
  • Scenes: a notch stub in the setup block (default true, so existing drawings don't change) and a new setup-look-no-notch scene.
  • docs/getting-started.md says when Notch appears.

Testing

  • setupOffersTheNotchPreset… (every placement, with and without a notch) and setupKeepsTheSelectedNotchPreset….
  • setupUpdatesNotchPresetsWhenDisplaysChange: refresh, unplugging with Notch chosen, deselecting, plugging back in, and a placement change. Its first expectation fails on main.
  • SceneFile and scene tests: the new key decodes and defaults to a notch; everySceneInTheRepositoryLoads passes.
  • 123 setup and scene tests pass; scripts/check.sh --quick and commitlint pass.
  • With a notch, setup-look renders byte-identical before and after.

The screens bot draws the PR's scenes with main's build too. main can't read the new notch key, so it will report setup-look-no-notch as a base error rather than a before image. These are local renders from main and from this branch, drawn as a Mac without a notch with the bar on the top edge:

Before After
Five preset tiles including Notch Four preset tiles, no Notch

Not checked in the running app: plugging in a display while setup is open.

Merging

One commit; any merge method works. Other open setup PRs also add stubs to SceneFile, SceneRenderer and scene.schema.json; whichever merges later needs a small rebase.

GPT-6.1-sol via Codex, reviewed by Claude Opus 5.5 via Claude Code

Setup checked only the bar's placement, so unnotched Macs offered a preset
intended to blend into a display's notch. Check all connected displays with the
bar's own notch detection, through the setup system, and refresh on screen
changes without clearing a chosen preset.

Cover notch availability and display changes, add a no-notch setup scene, and
document when the preset appears.

Fixes #457
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner November 11, 2026 00:36
@M4n0x M4n0x self-assigned this Nov 11, 2026
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Setup scenes now carry an optional notch value, and setup preset availability reflects connected-display notch state. A selected Notch preset remains available when the display or bar placement no longer meets the offering conditions.

Changes: Notch-aware setup

Layer / File(s) Summary
Scene notch data
Sources/StableBar/SceneFile.swift, Sources/StableBar/SceneRenderer.swift, scene.schema.json, scenes/setup-look-no-notch.json, Tests/StableBarTests/SceneFileTests.swift
The setup scene model and schema accept an optional notch value that defaults to true. The renderer passes the scene value to the setup system. The added scene sets notch to false, and decoding tests cover the explicit and default values.
Display-aware preset availability
Sources/StableBar/SetupPreferences.swift, Sources/StableBar/SetupWindow.swift, Sources/StableBar/SetupTour.swift, Tests/StableBarTests/SetupNotchPresetTests.swift, Tests/StableBarTests/WidgetTests.swift, docs/getting-started.md
The setup session tracks and refreshes connected-display notch state. The Notch preset is offered when placement is .top and a connected display has a notch, or when Notch is already selected. The setup view uses the session’s offered presets. Tests and documentation cover these conditions and the retained selection.

Possibly related PRs

  • Seb-GRAF/StableBar#504: This PR extends the setup-scene decoder and renderer introduced in #504 with the notch field.
  • Seb-GRAF/StableBar#438: Both PRs update Notch preset availability and keep an already selected Notch preset available.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 9dc1c

No actionable merge-blocking issue was established. The change is ready to merge after normal checks.

Security architecture risk: Low · up to 9dc1c

The change is limited to preset availability and scene rendering. No introduced security issue was identified, and display changes preserve the selected preset and its deselection path. Overall security coverage remains incomplete, so the assessment retains some uncertainty.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected new input propagates to local setup presentation eligibility. It does not become a persisted preference or supply authority to accessibility, automation or calendar operations. Scene-file provenance and deployment exposure were not established.

Trust Boundaries and Controls

  • observed — The scene decoder retains unknown-key rejection and typed Boolean decoding. The renderer injects notch state into hasNotchedDisplay separately from its permission-related simulation closures; the new field does not replace those controls.

Resilience and Maintainability Implications

  • observed — Refresh changes only transient eligibility state. Selection remains independently owned, allowing deselection after display loss. Apply and cancellation retain their existing preference-save and restoration paths. Source-level tests cover display loss, repeated refresh, reconnect, deselection and placement changes; no physical-display runtime test was executed during this assessment.
Pre-merge checks: Passed 3

Check name Status Explanation
Description check Passed The description includes the required Problem, Changes, Testing, and Merging sections. It states the issue, summarizes the changes, reports test results and limitations, describes the merge requiremen…
Linked Issues check Passed Issue #457 requires Setup to offer Notch only when placement is top and a connected display has a notch. SetupPreferences.Preset.offered applies both conditions and retains an already selected Notch…
Out of Scope Changes check Passed The scene stub, schema, no-notch scene, scene tests, and Getting Started documentation support or verify the Notch availability behavior in issue #457. No unrelated change is established by the suppli…
Full details: Description check

Explanation

The description includes the required Problem, Changes, Testing, and Merging sections. It states the issue, summarizes the changes, reports test results and limitations, describes the merge requirement, and ends with the model and harness.

Full details: Linked Issues check

Explanation

Issue #457 requires Setup to offer Notch only when placement is top and a connected display has a notch. SetupPreferences.Preset.offered applies both conditions and retains an already selected Notch preset for deselection. SetupSystem.hasNotchedDisplay uses BarDisplay.notch, and SetupSession.refreshDisplays() updates the value on screen-parameter changes. The reported tests cover placement, notch presence, retained selection, and display changes.

Full details: Out of Scope Changes check

Explanation

The scene stub, schema, no-notch scene, scene tests, and Getting Started documentation support or verify the Notch availability behavior in issue #457. No unrelated change is established by the supplied change summary or inspected setup code.

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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 67753e5 and 9dc1cc0.

Files selected for processing: 11

  • Sources/StableBar/SceneFile.swift
  • Sources/StableBar/SceneRenderer.swift
  • Sources/StableBar/SetupPreferences.swift
  • Sources/StableBar/SetupTour.swift
  • Sources/StableBar/SetupWindow.swift
  • Tests/StableBarTests/SceneFileTests.swift
  • Tests/StableBarTests/SetupNotchPresetTests.swift
  • Tests/StableBarTests/WidgetTests.swift
  • docs/getting-started.md
  • scene.schema.json
  • scenes/setup-look-no-notch.json

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

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Before and after

main at 67753e5 → this pull request at 9dc1cc0 · 61 screens drawn in one CI job · 1 changed

Screen Change Where (image pixels)
scenes/setup-look-no-notch-dark new the whole screen

scenes/setup-look-no-notch-dark

The base couldn't draw this scene: setup.notch: Unknown property.

After

60 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/app-menu-popup-dark, scenes/app-menu-popup-light, scenes/apple-menu-settings-dark, scenes/apple-menu-settings-light, scenes/crowded-edit-bar-dark, scenes/crowded-edit-bar-light, scenes/dock-badges-bar-dark, scenes/dock-badges-bar-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/notch-flare-bar-dark, scenes/notch-flare-bar-light, scenes/settings-bar-dark, scenes/settings-bar-light, scenes/settings-bar-placement-dark, scenes/settings-bar-placement-light, scenes/settings-general-dark, scenes/settings-general-light, scenes/settings-general-spaces-dark, scenes/settings-general-spaces-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/setup-look-below-menu-bar-dark, scenes/setup-look-dark, scenes/setup-permissions-dark, scenes/setup-placement-dark, scenes/setup-touches-dark, scenes/setup-try-dark, scenes/slider-end-stop-popup-dark, scenes/slider-end-stop-popup-light, scenes/starter-bar-dark, scenes/starter-bar-light, scenes/starter-edit-bar-dark, scenes/starter-edit-bar-light, scenes/update-popup-dark, scenes/update-popup-light

Visual review: 1 screen changed: a maintainer adds visual-ok after looking.

@Seb-GRAF Seb-GRAF added the visual-ok A maintainer looked at the changed screens and approves them label Nov 11, 2026
@Seb-GRAF
Seb-GRAF merged commit 3fef60f into main Nov 11, 2026
15 of 16 checks passed
@Seb-GRAF
Seb-GRAF deleted the fix/457-notch-preset-needs-notch branch November 11, 2026 07:06
stablebar-releases Bot pushed a commit that referenced this pull request Nov 11, 2026
## [0.13.0](v0.12.0...v0.13.0) (2026-11-11)

### Features

* answer common questions and send feedback from a Help section ([#564](#564)) ([325083e](325083e))
* apply migrations to includes, packages and every screen setup's bar ([#539](#539)) ([6cc59f4](6cc59f4))
* check in setup that Workspaces can reach yabai or OmniWM ([#552](#552)) ([3a9ef7e](3a9ef7e)), closes [#463](#463)
* check the Switch to Desktop shortcuts in setup and Settings ([#551](#551)) ([92c11e1](92c11e1)), closes [#447](#447)
* follow Reduce Transparency and Increase Contrast ([#542](#542)) ([3ea111b](3ea111b))
* guide Accessibility access with a panel to drag StableBar into System Settings ([#559](#559)) ([29f000c](29f000c))
* pause scripts and providers while the displays sleep or the screen is locked ([#538](#538)) ([a09513d](a09513d))
* sign updates with an EdDSA key as well as the Developer ID ([#540](#540)) ([7e34d56](7e34d56))
* turn on Keep windows clear in setup when no window manager runs ([#553](#553)) ([a80b001](a80b001)), closes [#466](#466) [#439](#439)

### Bug Fixes

* follow Reduce Motion in setup's steps, theme row and tiles ([9c3f0c4](9c3f0c4)), closes [#465](#465)
* install packages when the configuration folder is a symbolic link ([#531](#531)) ([7e4f88b](7e4f88b)), closes [#530](#530)
* keep setup's later choices when the preset changes ([3318ae0](3318ae0)), closes [#461](#461)
* keep the website's Store review sheet inside its window ([9519645](9519645)), closes [#526](#526)
* leave windows alone until setup finishes ([#547](#547)) ([c9b75cf](c9b75cf)), closes [#466](#466)
* let a group wider than its tray scroll sideways while editing the bar in place ([#543](#543)) ([f6e6e25](f6e6e25))
* make setup's tiles, closing card and permission buttons work with the keyboard and VoiceOver ([#554](#554)) ([0944100](0944100)), closes [#464](#464)
* offer Keep notifications clear only on macOS 26 and later ([#550](#550)) ([5fd428a](5fd428a)), closes [#458](#458)
* offer the Notch preset only on Macs with a notch ([#548](#548)) ([3fef60f](3fef60f)), closes [#457](#457)
* open an app's own menu when Menu bar items can't draw its rows ([#541](#541)) ([24f16d7](24f16d7))
* shorten long errors in the bar's menus and open Status from them ([#536](#536)) ([5710a3e](5710a3e))
@stablebar-releases

Copy link
Copy Markdown

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

Setup offers the Notch preset on Macs without a notch

2 participants