#64343·zed

git_panel: identity-keyed entry selection on top of bulk marking

Author: n24q02mCreated Sep 17, 2026Updated Sep 17, 2026
Labelsstate:needs infoarea:integrations/git/panel

Summary

#60340 added bulk marking to the git panel keyed on RepoPath. This proposes an entry-identity selection model layered on top of that marking UI: each projected entry carries a stable identity (repository + path + staging section + entry kind), and the selection set holds identities rather than paths or row indices.

What the identity layer adds over path-keyed marking:

  • Per-projection marks: the same path's staged and unstaged projections are distinct entries, so marking one does not leak onto the other.
  • Multi-repo correctness: identical paths in different repositories no longer alias in the selection set.
  • Refresh/reorder stability: marks and the selected entry survive status refresh, reordering, and entry removal; when the selected entry disappears, selection falls back to the first marked entry and the shift-range anchor re-roots instead of going stale.
  • Range-anchor hygiene: shift-click ranges anchor on the current selection rather than a cached row, so keyboard navigation can't leave a range rooted at a removed row.

Relationship to #60340

This builds on the marking model #60340 introduced — it does not replace it. Bulk stage/unstage/discard gestures and the mark UI are unchanged; the change swaps the selection key from RepoPath to a richer entry identity and adds the reconcile step that keeps the set coherent across refreshes.

Test plan

  • Identity distinguishes same-path staged/unstaged projections and same-path cross-repo entries (unit).
  • Selection survives refresh with reorder and removal (unit).
  • Shift-click range uses current selection over stale anchor (unit).
  • Manual: multi-entry mark + refresh mid-selection on a large repo.

Happy to open a PR with an implementation if the direction sounds right.