Skip to content

build: let scenes draw setup's steps - #504

Merged
M4n0x merged 2 commits into
mainfrom
build/setup-scenes
Nov 8, 2026
Merged

M4n0x merged 2 commits into
mainfrom
build/setup-scenes

Conversation

@M4n0x

@M4n0x M4n0x commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

No scene could draw setup's tour, so the screens bot reported no change on every pull request that changed setup (#492, #498, #500), and each one needed offscreen renders made by hand for its description.

Changes

  • A setup scene kind (SceneFile.Setup, scene.schema.json). A setup scene names the step to draw (placement, look, touches, permissions, tryIt) and the choices made before it (placement, preset). It also sets what setup reads from the Mac: menuBarHides, accessibility, automation, calendars and battery. Steps, placements and presets go by the app's own case names, and a test keeps the schema in step with them.
  • Drawn over a stand-in for the Mac (SceneRenderer.drawSetup). Setup's system comes from the scene, so drawing never touches the macOS menu bar or asks for a permission. Its preferences stay in memory (SceneDefaults), so nothing lands in ~/Library/Preferences.
  • Nothing runs. Setup previews its choices on the running bar, which starts the commands of the widgets a preset adds. Scenes run nothing, so SetupSystem.previewsOnTheBar turns that off: the tour shows the choices, and the bar keeps the scene's configuration, placed where the first step's choice puts it.
  • Nothing moves. At the scenes' fixed date (fixedDate), the tour's drifting backdrop and its bobbing pointer to the bar hold still, so two drawings of one commit match.
  • Setup without the app bundle. The tour takes a display and its menu bar height instead of an NSScreen, so a scene can set them. Its backdrop pictures and its Shantell Sans handwriting fall back to black and the system font when the app's resources are missing, as in tests, where they crashed.
  • Six scenes in scenes/, from the starter configuration, dark only since setup is always dark: each step, plus the presets below the menu bar.
  • Docs: the Scenes section of CONTRIBUTING lists setup and what it leaves out.

Testing

  • New tests:
    • sceneDecodesASetupStep and sceneRejectsASetupItCannotDraw: an unknown key, step, placement or preset, or setup on another kind of scene, fails.
    • sceneSchemaListsTheSamePropertiesAsTheDecoder now also checks the setup object's keys and names.
    • setupSceneDrawsTheSameStepHoweverLongItSettles draws a setup scene twice, settling 1 s and 2.2 s, and finds the same pixels, no session edits and no scripts. It failed while the pointer still moved, and while previews were on, when the Developer preset started the System provider.
    • everySceneInTheRepositoryLoads loads the six new scenes.
  • swift test locally:
    • All 719 Swift Testing tests pass.
    • In XCTest, the two package review cases that also fail on main fail.
    • Under heavy load on this Mac, settingsSceneDrawsTheThemeSection once hit its one-minute wait; it passes when run again.
  • StableBar --render-scenes from a release bundle drew all six scenes without errors; they're below. The macOS menu bar setting and ~/Library/Preferences stayed untouched.
  • Left out: setup's choices on the bar itself, as above. Open at login reads the app's own location, the same on both sides of a CI comparison.

The bot will list these scenes as added, since main can't draw a setup scene yet. From then on, setup pull requests get before and after.

Step 1, nothing chosen yet:

Setup scene: step 1

Step 2 after Replace the menu bar, and after Keep the menu bar, where Notch and Menu bar items drop out and the bar sits under the menu bar:

Setup scene: step 2 on the top edge

Setup scene: step 2 below the menu bar

Steps 3 to 5, with Accessibility not yet allowed on step 4:

Setup scene: step 3

Setup scene: step 4

Setup scene: step 5

Merging

Two build: commits, the scene kind and the scene files. build: commits don't count toward a release, and nothing changes for people using the app, so a squash and a merge commit give the same result.

Claude Opus 5.5 via Claude Code

M4n0x added 2 commits November 8, 2026 18:02
No scene could draw setup, so the screens bot showed no change on pull requests that changed it,
and each needed renders made by hand. A setup scene draws a step of the tour over a stand-in for
the Mac: the scene sets the menu bar, the permissions and the battery, setup's preferences stay in
memory, and its choices show in the tour without being previewed on the bar, which would start the
commands of the widgets they add. At the scenes' fixed date the backdrop and the pointer to the bar
hold still, so two drawings match. The tour takes a display and its menu bar height instead of a
screen, and its backdrop and handwriting fall back when the app's resources are missing.
The screens bot now draws setup's five steps, and the presets below the menu bar, from the starter
configuration, so a change to setup shows before and after on its pull request.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner November 8, 2026 17:02
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The scene format now supports setup-tour scenes with pinned setup inputs. The renderer configures simulated setup state and renders the selected tour step. Setup-tour display inputs and animation behavior have also changed.

Changes: Setup Scene Rendering

Layer / File(s) Summary
Setup scene contract
Sources/StableBar/SceneFile.swift, scene.schema.json, Tests/StableBarTests/SceneFileTests.swift, CONTRIBUTING.md, scenes/setup-*.json
The scene model and schema accept setup scenes and validate their inputs. Tests cover decoding and schema consistency. Six scene files define setup-tour configurations.
Setup-tour display and preview behavior
Sources/StableBar/SetupTour.swift, Sources/StableBar/SetupWindow.swift, Sources/StableBar/FeltPen.swift
SetupTourView now uses a BarDisplay and menu-bar height. Fixed dates and reduced motion control animations. Missing font and backdrop resources use fallbacks. SetupSession can skip previews on the running bar.
Setup scene rendering
Sources/StableBar/SceneRenderer.swift, Tests/StableBarTests/SceneRendererTests.swift
The renderer applies scene inputs to simulated setup state and renders the selected tour step. SceneDefaults stores values in a locked in-memory dictionary. A rendering test checks image dimensions, pixel stability, and session state.

Possibly related PRs

Merge Risk: Minimal · up to 82300

No concrete merge-blocking failure has been established for setup-scene rendering.

Security architecture risk: Low · up to 82300

Setup snapshots use simulated permissions and disable previews that could start widget commands. No new privileged execution path was identified in the inspected flow, but complete preference isolation still needs confirmation on macOS.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected new exposure is within the local rendering process and its host dependencies. The unresolved preference-write question concerns the named org.stablebar.scene suite; no inspected path establishes a write to the application's standard preferences or the live menu-bar setting.

Trust Boundaries and Controls

  • observed — The new data-to-control transition is constrained by strict setup decoding, injected permission and menu-bar closures, disabled live previews, and empty completion callbacks. These controls separate scene-selected simulated approvals from the corresponding privileged setup actions.

Resilience and Maintainability Implications

  • inferred — Complete preference isolation remains unproven. SceneDefaults implements generic reads, writes, and removals with a locked dictionary, but reachable bookkeeping uses Boolean UserDefaults methods. Without supported macOS dispatch evidence, these overrides alone do not establish that every operation stays in memory. This is an isolation proof gap, not a verified persistence bypass.

Hardening Proposals

  • proposed — Make preference isolation explicit through an injectable preferences interface rather than relying on inherited UserDefaults accessor dispatch. Validate placement bookkeeping and repeated or failed renders on macOS against both the scene suite and live preferences.
Pre-merge checks: Passed 3

Check name Status Explanation
Description check Passed The description is thorough and follows the template. It has Problem, Changes, Testing, and Merging sections. It links the problem to PRs #492, #498, and #500, and it lists the new scene kind, rendere…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is thorough and follows the template. It has Problem, Changes, Testing, and Merging sections. It links the problem to PRs #492, #498, and #500, and it lists the new scene kind, renderer changes, scenes, and docs. The Testing section names the new tests, the local swift test results, and the --render-scenes run, and it says what was not checked. The Merging section states the commit strategy. The final line names the model and harness, so the check reads it. No required section is missing. Two small gaps remain. The Problem section does not use the template's 'Fixes #N' wording, and the description does not link an issue that this PR closes. The template asks for a linked issue, but the PR is a build change that may not close one. The description also has the template's 'Problem' heading, which is present, so this gap does not block the check.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1

Tests/StableBarTests/SceneRendererTests.swift: 1

217-242: Trivial · Maintainability & Code Quality · Low value

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Test depends on wall-clock settle durations.

The test draws after 1 s and 2.2 s of settle and compares bytes. Under heavy CI load, the main actor can fall behind the sleep, and asynchronous loads can finish at different times. The path instruction says wall-clock bounds on main-actor work fail randomly on CI. The author already reported one timeout under load in a related test. Here, equality holds when nothing moves, so the risk is lower. Keep the test, and watch for flakes.

Source: Path instructions

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ed119f7 and 8230080.

Files selected for processing: 15

  • CONTRIBUTING.md
  • Sources/StableBar/FeltPen.swift
  • Sources/StableBar/SceneFile.swift
  • Sources/StableBar/SceneRenderer.swift
  • Sources/StableBar/SetupTour.swift
  • Sources/StableBar/SetupWindow.swift
  • Tests/StableBarTests/SceneFileTests.swift
  • Tests/StableBarTests/SceneRendererTests.swift
  • scene.schema.json
  • scenes/setup-look-below-menu-bar.json
  • scenes/setup-look.json
  • scenes/setup-permissions.json
  • scenes/setup-placement.json
  • scenes/setup-touches.json
  • scenes/setup-try.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 8, 2026 •

Copy link
Copy Markdown

Before and after

main at ed119f7 → this pull request at 8230080 · 56 screens drawn in one CI job · 6 changed

Screen Change Where (image pixels)
scenes/setup-look-below-menu-bar-dark new the whole screen
scenes/setup-look-dark new the whole screen
scenes/setup-permissions-dark new the whole screen
scenes/setup-placement-dark new the whole screen
scenes/setup-touches-dark new the whole screen
scenes/setup-try-dark new the whole screen

scenes/setup-look-below-menu-bar-dark

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

After

scenes/setup-look-dark

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

After

scenes/setup-permissions-dark

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

After

scenes/setup-placement-dark

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

After

scenes/setup-touches-dark

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

After

scenes/setup-try-dark

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

After

50 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/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/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: 6 changed screens approved.

@M4n0x M4n0x added the visual-ok A maintainer looked at the changed screens and approves them label Nov 8, 2026
@M4n0x
M4n0x merged commit 5f8ff16 into main Nov 8, 2026
16 checks passed
@M4n0x
M4n0x deleted the build/setup-scenes branch November 8, 2026 17:19
@stablebar-releases

Copy link
Copy Markdown

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

1 participant