Skip to content

Update the UI after stash operations in a single frame - #5905

Open
stefanhaller wants to merge 5 commits into
masterfrom
sync-ui-update-for-stash-operations
Open

Update the UI after stash operations in a single frame#5905
stefanhaller wants to merge 5 commits into
masterfrom
sync-ui-update-for-stash-operations

Conversation

@stefanhaller

Copy link
Copy Markdown
Collaborator

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.

stefanhaller and others added 4 commits August 6, 2026 22:09
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 stefanhaller added the bug Something isn't working label Aug 6, 2026
@stefanhaller
stefanhaller force-pushed the sync-ui-update-for-stash-operations branch from 4ef4836 to fbaf695 Compare August 6, 2026 21:03
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
stefanhaller force-pushed the sync-ui-update-for-stash-operations branch from fbaf695 to 5296952 Compare August 7, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant