Repository navigation
Description
What happens
While editing the bar in place, every move of a widget (dragging it, Move Left/Right or the arrow keys) freezes the bar until the change is saved. With a real setup (about 15 widgets from 6 packages and a theme), a move takes about 1.1 seconds on current main.
The time goes into composing the whole configuration again: includes, packages and themes are read and merged, then decoded. One composition of that setup takes about 270 ms, and a move runs it 4 times:
WidgetSetup.requireSavedWidgetcomposes the saved file to check the widget isn't a command-line one.BarStore.customizationDatacomposes the file before the move to read the widget ids (editedDocument).- It composes the file after the move to validate it.
writeCustomizationcomposes the file after the move again to show it.
Steps 1–2 and 3–4 compose the same document twice. A paused change in Settings does the same: 4 compositions to show it, then 3 more to save it.
Builds before #143, such as 0.5.0, compose 14 times per move: about 4 seconds with the same setup.
Steps to reproduce
- Use a configuration with several widget packages and a theme.
- Choose Edit Bar in Place and drag a widget to another place.
Expected
The widget lands right away.
Environment
StableBar 0.6.0-beta.20261021125338.170 (cd0d42d), macOS 26.
Evidence
Measured in an optimized build on a copy of the configuration, with scripts not started:
| Time | |
|---|---|
| One composition | 268 ms |
One move on main (median of 6) |
1,123 ms |
Diagnosis
- Within one edit, the documents before and after it are composed over and over:
WidgetSetup.move→ConfigurationHistory.save→BarStore.customizationDataandBarStore.writeCustomization(Sources/StableBar/BarStore.swift). - Each composition is slow in itself.
ConfigurationValue.decoded(_:)(Sources/StableBar/ConfigurationLoader.swift) converts by encoding to JSON and decoding again, and the loader does this to whole documents several times per composition.ConfigurationValue.init(from:)finds a value's type by trying object, array, string and bool withtry?, so each failed attempt builds an error. Returning values that are already the requested type cut one composition from about 267 ms to about 118 ms in a quick experiment.
These are two separate fixes: compose each document once per edit, and make a composition cheaper.
Related
- feat: redesign Settings with per-screen bars and themes #143 already saves a completed change without first showing it as pending, which brought a move from 14 compositions to 4.
- Measure and publish StableBar's idle CPU, wakeups and memory #95 is about idle CPU, not edits.
Triaged by Claude Code (Claude Opus 5.5).
Activity
M4n0x commentedon Oct 22, 2026
Addressed by #161, which composes the configuration fewer times per edit and makes each composition cheaper, and #167, which saves after the drop animation. Reopen if a move still stalls.
Seb-GRAF commentedon Oct 28, 2026
A move still freezes the bar, now for less time: 170–440 ms on the main thread with a large configuration (main at 2df97ea, macOS 26). Since #348, nothing moves during the freeze, but animated widgets such as the Now Playing equalizer pause, and a click or drag started then waits.
A move still loads the configuration three times, about 140 ms each:
WidgetSetup.requireSavedWidget(Sources/StableBar/WidgetSetup.swift) loads the saved file to check that the widget doesn't come from the command line.customizationHistory.changecomposes the document twice more to save it.Two possible fixes: skip the load in
requireSavedWidgetwhen there are no command-line changes, or compose and save off the main thread.Triaged by Claude Code (Claude Opus 5.5).
stablebar-releases commentedon Oct 29, 2026
🎉 This issue has been resolved in version 0.9.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀