Skip to content

fix: show HEAD in the details when the selected commit left the graph - #24

Merged
Lars- merged 2 commits into
mainfrom
fix/selection-after-history-change
Nov 6, 2026
Merged

Lars- merged 2 commits into
mainfrom
fix/selection-after-history-change

Conversation

@Lars-

@Lars- Lars- commented Nov 6, 2026

Copy link
Copy Markdown
Owner

What this changes

After a reset, an undo or a rebase moved a branch back, the details panel kept showing the commit that was selected, even though it was no longer in the graph. It now shows HEAD instead, the same as when nothing is selected or the uncommitted changes are gone. The check is simply "is the selection in the graph", which covers all three cases with less code than before.

How it is tested

  • App test through the accessibility tree: with the last commit selected, a hard reset made outside GitCraft takes it out of the graph and the details; the details show HEAD. Without the fix the test fails.

  • Tried in the app: with the newest commit selected, a hard reset of two commits on the command line; the details moved to the new HEAD by themselves.

  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass

  • It adds as little code as the change needs, and removes what it makes unnecessary

  • Nothing in it comes from GitKraken or another closed-source client (see CONTRIBUTING.md)

@Lars-
Lars- merged commit 63214e7 into main Nov 6, 2026
7 checks passed
@Lars-
Lars- deleted the fix/selection-after-history-change branch November 6, 2026 10:20
@Lars- Lars- mentioned this pull request Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant