Update the UI after stash operations in a single frame - #5905
Open
stefanhaller wants to merge 5 commits into
Open
Update the UI after stash operations in a single frame#5905stefanhaller wants to merge 5 commits into
stefanhaller wants to merge 5 commits into
Conversation
Stashing and popping change both the stash list and the files list. With each scope updating the UI as soon as its own refresh is done, the two panels visibly change at different times; with gui.shrinkSidePanelsToContent that also means their sizes change at different times than their contents. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Pushing the files context right after kicking off the refresh moves the focus (and, with gui.shrinkSidePanelsToContent, resizes the panels) a frame before the refreshed stash and files lists arrive. Doing it from Then puts it in the same frame as the data it belongs to. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collapsing the range before kicking off the refresh paints the new selection against the list as it was before the drop, so for a frame the entries that were just dropped are still on screen (and, with gui.shrinkSidePanelsToContent, the panel is still at its old size). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
stefanhaller
force-pushed
the
sync-ui-update-for-stash-operations
branch
from
August 6, 2026 21:03
4ef4836 to
fbaf695
Compare
Creating and applying a stash both touch every changed file, so in a large repo they can take long enough to be noticeable — and running them on the UI thread meant the confirmation popup stayed on screen, frozen, for the whole operation. Run them on a worker instead, with a spinner, and keep blocking input for their duration so that the type-ahead guarantee the refresh used to provide still holds. Dropping stays on the UI thread: it only rewrites the stash reflog, so it's fast no matter how big the stashes are. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
stefanhaller
force-pushed
the
sync-ui-update-for-stash-operations
branch
from
August 7, 2026 04:55
fbaf695 to
5296952
Compare
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.
This fixes a regression in 0.64.0: before that version, creating or popping a stash would happen synchronously on the UI thread (including the refresh), blocking the UI until everything changed, including the panel focus. Blocking the UI was not nice of course, but at least the UI update was clean. With 0.64.0 this changed to a background refresh, so that the update to the two panels and the focus change all happened out of sync, which looks rather ugly. Fix this by using Refresh's mechanism to batch UI updates, and switch the panel focus in the Refresh's Then so that it updates at the same time.
While we're at it, use a waiting status spinner for these operations; they are usually fast when only few files are involved, but when stashing a large number of files in a larger repo it can be noticeable, and it looks ugly if the confirmation prompt stays on the screen while it is running.