New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preventing popup "Revision X not being visible in the revision grid" on right mouse button click #10283
Conversation
I believe this is all that's required: diff --git a/GitUI/BranchTreePanel/RepoObjectsTree.cs b/GitUI/BranchTreePanel/RepoObjectsTree.cs
index 41f6e4704..6bb0a5e34 100644
--- a/GitUI/BranchTreePanel/RepoObjectsTree.cs
+++ b/GitUI/BranchTreePanel/RepoObjectsTree.cs
@@ -541,7 +541,13 @@ protected override CommandStatus ExecuteCommand(int cmd)
private void OnNodeSelected(object sender, TreeViewEventArgs e)
{
- Node.OnNode<Node>(e.Node, node => node.OnSelected());
+ Node.OnNode<Node>(e.Node, node =>
+ {
+ if (node is not BaseBranchNode branchNode || branchNode.Visible)
+ {
+ node.OnSelected();
+ }
+ });
}
|
No |
What's missing in my snippet?
|
Have not debugged why I got the popup |
I ran various manual tests and observed no popups, so I'm curious what I
may have missed.
|
@RussKie I just tried your solution and it does the job - I don't get any popups either when I open the context menu on hidden refs. The difference in behavior between the two is that your solution suppresses the popup even if I left-click on a hidden ref while mine doesn't. @gerhardol Which is the desired behaviour? |
There are two issues:
|
IMO we shouldn't try to navigate if a ref isn't visible. |
Also for 4.0 |
The only draw-back I see is that without the popup the user won't get any feedback as to why nothing happens on left-clicking hidden refs. But it does feel a bit like watering down/neutering this new feedback popup feature right off the bat. You guys be the judges of whether you want to do that or not. I didn't read up on the full reasoning behind the new popup. |
Are you questioning the new feedback popup feature in general? If so, you may want to revert it altogether and solve #10250 that way... |
I interpreted the comment as "when we know a ref is not visible" and the user have other means of seeing that. |
...and in this case the user has a visual clue by how the hidden ref is drawn in the tree (the slashed eye icon and light gray font). |
I've reverted my solution and added @RussKie's. |
…ection events and used that to prevent popup about Revision not being visible in the revision grid; fixes 10250
…node selection events and used that to prevent popup about Revision not being visible in the revision grid; fixes 10250" This reverts commit 0855262.
…up about Revision X not being visible in the revision grid; fixes gitextensions#10250
rebased on master and commented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging tomorrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Fixes #10250 by
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.