-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Support multiple decorations in editor glyph margin #179725
Comments
When there is more than one decoration provided for the second lane of a line I think there should be a visual indicator to tell me it is worth hovering over or navigating to so the hidden decoration(s) appear(s). |
@joyceerhl I really like your proposal. Given this might be a lot of work, and a lot of changes, my suggestion would be to stage the work in steps and split it up across multiple PRs. |
@gjsjohnmurray good point, I think the dominant proposal for that is to render a badge, ellipses or a 🔽 next to an overflowing decoration to indicate that there are overflowing items. I'll pick one of those options in the initial exploration. cc @connor4312 @rebornix @isidorn for additional feedback since you've had input on this issue in the past/in standup |
Insightful writeup and the proposal is great 👍
Not sure if we want a wider gutter all of a sudden for all editors. Maybe we can check if there is debug adapter registered to control if breakpoint lane should be created, for example, it doesn't need to be created in markdown files in vanilla VS Code, otherwise we will have an empty lane which doesn't do anything. |
Thanks for the writeup. I agree with @rebornix - let's try to minimize doubling the gutter and only do that when it is really needed. Reading the above, option 2. ii) sounds interesting to me - "Show overflowed decorations on hover". With that we would minimize the additional real estate we need. What is downside of that approach compared to the two gutters one? |
@isidorn yeah, I proposed that we do both (have a dedicated breakpoint lane if it makes sense to render one, as well as render overflowing decorations via a hover). We need to solve the overflow problem regardless, and the dedicated lane allows that we can still show the breakpoint hover hint if there's already a decoration on that line (e.g. if you had test coverage decorations for every line in the file, you'd still be able to set breakpoints easily). |
I'll split the proposed work into the following sequence of changes:
PR for the first step is out: #179910 |
This sounds awesome! Can't wait for it all to land 😁 As an FYI, JetBrains Rider just added support to show the breakpoints over the line numbers to save horizontal real estate. https://www.jetbrains.com/help/rider/New_UI.html#gutter |
That's great news! Eager to use and contribute to it. I follow @connor4312 preference for a dedicated debug lane, and as @eamodio commented, Rider UI approach to put breakpoint over the line number is interesting. My only fear is about embracing Thank you |
In order to support share link decorations in the glyph margin for my share contribution proposal, I started down the path of reconciling multiple decorations with #179657. I missed an existing issue with discussions #114776, which Connor pointed me to in standup today. I don't think my PR can be merged as is, from standup feedback, there are two main concerns with the approach I took, which does the naive thing of expanding the glyph margin to accommodate decorations:
Therefore I'm opening this issue to discuss the approach we take, which should address the following issues (I'm creating a new issue to avoid mass-pinging all existing issue subscribers):
Summary of existing discussion
Summarizing some alternative proposals from the above issue thread #114776 and from standup, there are two main questions to solve:
zIndex
to figure out which decoration to render as the placeholder in the overflowonClick
handler, if there's only one decoration registering anonClick
handler we should execute that handler, otherwise show the context menuonClick
handlers if anyProposed approach
I'd like to rework my PR to incorporate the proposals that the team has suggested. Here's what I'm thinking of doing, please let me know what you think:
zIndex
tab
to trigger the hover, then useleft
andright
arrows to navigate between decorations. There should also be descriptive alt text for the decorations whether or not they are connected toonClick
handlersonClick
handlers in decorations and adopt them in core-contributed decorationscommand
attribute inTextEditorDecorationType
, or an eventvscode.window.onDidSelectTextEditorDecoration
cc @alexdima
The text was updated successfully, but these errors were encountered: