Skip to content

Keep selected commits stable across refreshes#5717

Open
stefanhaller wants to merge 1 commit into
masterfrom
retain-commit-selection
Open

Keep selected commits stable across refreshes#5717
stefanhaller wants to merge 1 commit into
masterfrom
retain-commit-selection

Conversation

@stefanhaller

Copy link
Copy Markdown
Collaborator

With the recently added external change detection, it happens more often now that we refresh the commits list because an agent made a commit in the background. In this case, if we keep the selection index the same, it now points at a different commit, making the main view show a different commit too, which is confusing and annoying. To fix this, track the selected commit and range anchor by hash before reloading, then restore those rows if both hashes still exist. This also allows us to get rid of some bespoke code that did this for the specific cases of reverting a commit or cherry-picking commits, because those are now handled by the generic mechanism.

With the recently added external change detection, it happens more often
now that we refresh the commits list because an agent made a commit in
the background. In this case, if we keep the selection index the same,
it now points at a different commit, making the main view show a
different commit too, which is confusing and annoying. To fix this,
track the selected commit and range anchor by hash before reloading,
then restore those rows if both hashes still exist. This also allows us
to get rid of some bespoke code that did this for the specific cases of
reverting a commit or cherry-picking commits, because those are now
handled by the generic mechanism.
@stefanhaller stefanhaller added the bug Something isn't working label Jun 21, 2026
@stefanhaller stefanhaller enabled auto-merge June 21, 2026 13:39
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