-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Introduce GlyphWidgets and tackle overlapping decorations in gutter #114776
Comments
@connor4312 it would be cool if you could share your ideas behind the test decorations. What would they be and how would they fit in our above ideas. |
I'm guessing Alex shared my use case, which is being able to show breakpoints on lines where the test runner icon is also present For me implementing this experience with
I'm having trouble picturing what the "hover expands" scenario would look like, though I see that having the actual breakpoint widget available somewhere is important for the drag+drop scenario. I think the context menu is good (and is what I am doing manually with test decorations and the breakpoint menu today.) For another reference, I looked at what intellij does yesterday: they just permanently expand the gutter when extra icons are added. This works but feels bad to me: |
My concern with that approach is that it removes the ability to see the gutter icons at a glance |
Another idea (taking the combining icon approach) is making half the glyph area clickable for one action and the other half for setting a breakpoint. Once we have two glyphs, we show a context menu for the various actions. Here's a simple prototype: Screen.Recording.2021-01-22.at.9.56.50.AM.mov |
@misolori I think the half half idea does not really scale, since if there are 3 it would not work. If you think it is resonable to expect that mutliple decorations can be merged and this looks good then we should go down that approach. I personally think this will automatically not look good, and we should have some icons prepared for some known overlapps. So for example when a test decoration overlaps with a breakpoint we show our previously designed icon by using the intellij approach of expadning the whole margin looks ugly to me. |
So we either need to find a generic icon that means "more than 1 glyph" but for @connor4312 that doesn't work. We can't show all glyphs as we don't have space for it. |
Then yea, showing highest z-index with some indicator (like 🔽 ) beside it, and have click actions--which are not formalized for the glyph margin right now, but could be--always open the context menu. This would require that the breakpoint drag action be startable from the context menu, which I think is less intuitive but probably fine for the edge case. Without expanding the margin (which I don't think is a good idea) there'll never be my happy case of seeing all icons at a glance, so option 2 is the best alternative 😛 |
Thanks for ideas! Let's assign this to February, and I plan to bring it up in our first UX meeting in that milestone so we can continue the discussion there. @connor4312 Agree, being able to drag and drop a breakpoint when there are multiple decorations there is a bit of an edge case and I would not really worry about it at the moment. Agree that option 2 is a good start, GlyphWidgets could have |
We did not have cycles this milestone, pushing out to April for now. |
Not happening this milestone -> On deck. Connor feel free to move to august if you would like to tackle next mielstone. |
If you use the vscode-go plugin and set coverage decorator to "go.coverageDecorator": {
"type": "gutter",
} overlapping.decorations.in.gutter.movMaybe the extension should not offer the configuration |
@isidorn Any update on this? We're facing the same issue as @lukas9393 and had to switch to highlight to show coverage as a temporary workaround. |
No updates, sorry. |
Is this considered part of the same bug? When a test is running, the custom decoration ( You can see it with this extension - https://github.com/ryanluker/vscode-coverage-gutters Here's my code:
|
Related discussion #25174
So far we have never tackled the problem of mutliple decorations on the same line.
@alexdima and me have started a discussion and here's are things that came up:
Overlapping decorations
What to render in the Glyph Margin once there are multiple decorations, here are some options:
Once we have something rendered, here are two options how the interaction could look llike:
GlyphWidgets
One thing is that we might need to add a new concept to the editor where glyph margins are not just decorations since you need so much interaction with them. One option is to add the concept of “glyphWidget” similar to “contentWidget” where you pass in a dom node to the editor. That would give you a chance to add dom event listeners on your own and then the editor can just be responsible with positioning them.
The
glyphWidgets
would give more control to the decoration author, one use case would be #88227The text was updated successfully, but these errors were encountered: