Repository navigation
perf: keep the bar moving while a widget move saves - #353
Merged
Merged
Conversation
Seb-GRAF
enabled auto-merge
October 28, 2026 08:37
Seb-GRAF
force-pushed
the
perf/150-move-save
branch
from
October 28, 2026 10:45
2b7f3e5 to
033e5aa
Compare
|
🎉 This PR is included in version 0.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Moving a widget while editing the bar in place blocked the main thread for about 220 ms with a large configuration. Since #348 nothing moves on screen during that time, but animated widgets such as the Now Playing equalizer paused, and a click or drag started then had to wait.
Fixes #150
Changes
requireSavedWidgetloads the saved file only when there are command-line changes. Without them, every widget on the bar is saved, so the check can't fail.BarStoreintoConfigurationEditing.swiftso the background task can run it with a snapshot of the store's state.BarStorekeeps the same methods, which call it.Settings and the command line still save on the main thread. A pending Settings change still saves on the main thread before a move.
Testing
Release build, on a copy of a real configuration (13 widgets, 45 JSON files, scripts replaced with
true), median of 8 moves:A move still takes about 150 ms to save. The longest gap seen on the main thread during a move was 10.2 ms.
swift test --filter "BarEditingTests|BarEditViewTests|WidgetDragSessionTests|ConfigurationHistoryTests|WidgetSetup|Customization"passes (111 XCTest, 14 Swift Testing), including the two drop tests from fix: drag and click widgets on every display while editing the bar in place #348.Merging
One commit; a merge commit keeps it as is.
GPT-6 Astra via Codex in T3 Code, reviewed by Claude Opus 5.5 via Claude Code