Repository navigation
Fix the context menu doing nothing for staged files - #586
Merged
Merged
Conversation
Read the selection from the table whose contextual menu was used, so the file actions act on the files the menu was opened on. - Compare the menu item's menu against the staged table's menu, which is the comparison the menu validation already makes - Cover the mapping from either table's menu with tests The controller copies the unstaged table's menu when the view loads so the two tables can be told apart by identity. The sender lookup never used that, comparing the menu item itself against a menu, which is never equal, so every lookup resolved to the unstaged table. Opening and revealing a staged selection therefore did nothing at all, while the menu went on offering both and naming the files correctly.
goneng
marked this pull request as ready for review
August 23, 2026 12:15
goneng
marked this pull request as draft
August 23, 2026 12:26
goneng
marked this pull request as ready for review
August 23, 2026 12:26
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.
Read the selection from the table whose contextual menu was used, so
the file actions act on the files the menu was opened on.
is the comparison the menu validation already makes
The controller copies the unstaged table's menu when the view loads so
the two tables can be told apart by identity, and the menu validation
relies on exactly that.
The sender lookup never did, comparing the menu-item itself against a menu,
which is never equal, so every lookup resolved to the unstaged table.
Opening a staged selection from its contextual menu therefore did nothing at all,
while the menu went on offering the item and naming the files correctly, since
the title is built by the validation that gets the comparison right.
Revealing a staged selection in Finder was silently broken the same way.
The two remaining actions that share the lookup, moving to trash and ignoring,
are already hidden or disabled for the staged table, so neither was reachable.
Supporting Images
Context-menu
The option is available for staged files, but does not work
Top-menu
The option is grayed-out when staged files are selected
Test plan
PBGitCommitFileSelectionTestscovers both tables; the stagedcase fails before this change and passes after, and the unstaged
case passes either way
xcodebuild test -only-testing:GitXTestspasses 41/41