Repository navigation
Fix the Edit menu offering Copy SHA with nothing selected - #626
Merged
Merged
Conversation
Contributor
|
Please keep in mind, that #406 is already solved and the solution is already merged |
Copy items that cannot copy anything should not be offered. The history controller answers every action it implements with a blanket YES, and that answer comes before the check written for the copy items, so Copy, Copy SHA, Copy short SHA and Copy Patch stay enabled with an empty selection and quietly copy nothing. * Ask whether anything is selected before the blanket YES * Cover the four copy items with a test that fails on the old order
goneng
force-pushed
the
fix-copy-menu-validation
branch
from
September 13, 2026 08:42
54f7a57 to
008c5d8
Compare
Collaborator
Author
Yes, the new issue is "on top" of Issue #406 - PR #621 changes which commits the copy actions read, |
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.
Copy items that cannot copy anything should not be offered.
With no commit selected, Edit > Copy SHA, Copy short SHA, Copy Patch and Copy
stay enabled, and choosing one quietly copies nothing. The history controller
answers every action it implements with a blanket
YES, and that answer comesbefore the check written for the copy items, so the selection check below it
has never run.
The commit context menu is unaffected either way: it sets
autoenablesItems = NO, so nothing there is validated.Test plan
make unit-test: 89 tests, 0 failures, 2 of them new (inPBGitHistoryMenuValidationTests)testTheCopyItemsAreOffWithNothingSelectedfails for all four itemsSHA and friends should now be greyed out, and the commit context menu
should be unchanged