Skip to content

feat: save edits in ordinary keys, edit the bar live and validate configuration - #10

Merged
Seb-GRAF merged 18 commits into
mainfrom
feat/review-follow-up
Oct 15, 2026
Merged

Seb-GRAF merged 18 commits into
mainfrom
feat/review-follow-up

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Follow-up to a code review of StableBar. Each change is its own Conventional Commit.

Fixes #4
Fixes #5

Configuration and saving

  • Edits go into the ordinary keys. The editor, setup and command line change a widget where the main file defines it, including inside its profiles. Widgets from includes or packages get widgetOverrides; removing one sets enabled: false. customization and removedWidgets are gone and are converted once when StableBar starts.
  • Saving keeps the file's layout. Only changed values are rewritten; untouched parts keep their formatting and key order.
  • Unknown properties are errors with readable messages, for example widgets.clock: style.fontsize: Unknown property. Decoding errors previously showed only Foundation's generic "isn't in the correct format".
  • stablebar.schema.json gives editors completion and validation. A test keeps its property names in sync with the decoders, and the starter config references it.

Editor

  • Changes apply to the live bar; Save writes them, Discard reverts. The separate preview copy is gone, and repeated changes to one field are one undo step.
  • Add any widget type, edit bar size and default style under Bar, and edit a widget's properties as prefilled JSON.

Widgets and appearance

  • "type": "battery", "system", "network" and "audio" work without defining a provider.
  • Unset colors follow the system's light or dark mode, and setup gains an Automatic appearance.
  • Popups without height fit their content (Size popups to their content instead of requiring a height #4).
  • A failed click action marks its own widget instead of setting one global error. The configuration error icon opens Customize.

Runtime

Removed

  • The bundled cpu.sh, battery.sh and volume.sh scripts and $STABLEBAR_SCRIPTS; the native widgets replace them.
  • An unused Layout conformance.

Breaking for existing configurations

This stays on 0.x, so no commit uses !. What changes:

  • Unknown properties now reject the configuration instead of being ignored.
  • An active profile now overrides values changed in the editor, because edits are no longer a final layer.
  • $STABLEBAR_SCRIPTS and the bundled scripts are gone.
  • Commands no longer re-read login shell startup files on every run, so changes to them need a restart, and functions or aliases defined there are unavailable.

Merging

Use a merge commit or a rebase merge so semantic-release sees each commit; the next release would be 0.2.0. A squash merge would keep only this title.

Notes

  • Uncommitted work on bar.displayScale will conflict with this in a few lines of Configuration.swift and AeroSpace.swift. Once merged, displayScale needs an entry in stablebar.schema.json; the schema test reports it.
  • The triage skill pointed to Resources/widgets/, which this PR removes; that line is updated.
  • Triage filed Support yabai in workspace widgets #6–Edit profiles in the Customize window #9 for follow-ups this PR does not address.

Testing

  • swift test: 96 tests pass, and every commit builds with its tests.
  • Converted a copy of a real configuration that used customization; the diff was limited to the converted keys.
  • Validated Resources/config.json and every file in examples/ against the schema with ajv.
  • Ran the built app with a temporary configuration and checked the editor and bar in dark mode.

@Seb-GRAF
Seb-GRAF merged commit 012f0ca into main Oct 15, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trigger and notification data can replace PATH and other variables widget commands rely on Size popups to their content instead of requiring a height

1 participant