Enum descriptions in new settings editor via Suggest widget#56511
Enum descriptions in new settings editor via Suggest widget#56511JacksonKearl wants to merge 18 commits intomicrosoft:masterfrom
Conversation
|
I don't know of a good way to get markdown links to work as we don't have access to the markdown |
|
Notes from sitdown:
|
|
And
I think this and the scrolling issue are blockers. |
|
It wouldn't be difficult to add hover text to the items, but then you lose markdown. Alternatively it could show the full details panel of the hovered item instead of the selected item, but that feels wrong to me, or at least in need of more discussion over how focus and hover interact |
|
"select an element when I hover it" is what I think would feel natural for mouse interaction. |
|
Okay, so same sort of thing as menus. I wonder if that should be added to |
|
It's possible, although in normal usage I think people shouldn't be using the mouse. |
|
For me the question is whether I sublclass the suggester for this or implement it for everywhere |
|
I think either subclass or put it behind an option in the control itself, whatever is most natural. I could see turning it on in the editor, since otherwise there is no way to see an enumDescription with only the mouse. |
|
Maybe @ramya-rao-a has an opinion since she has worked on the suggest widget. |
|
Turns out native behavior on Mac and Win is to remove the dropdown on scroll so this might actually be the expected behavior. |
| editor.onDidLayoutChange(() => this.onEditorLayoutChange()), | ||
| this.list.onSelectionChange(e => this.onListSelection(e)), | ||
| this.list.onFocusChange(e => this.onListFocus(e)), | ||
| this.list.onMouseOver(e => this.list.setFocus([e.index])), |
There was a problem hiding this comment.
@ramya-rao-a this adds focus on mouseover to all suggest widgets. This makes sense to me but what do you think? I could put it behind a flag somewhere.
There was a problem hiding this comment.
Looks good. Setting an item on focus then makes the docs/details part to be populated. The only concern here is that the details from certain completion providers is got by making an additional call to the provider. cc @joaomoreno @jrieken
| } | ||
| } | ||
|
|
||
| private forceRedrawHack = 0; // the actual width is fixed, toggle this in order to force redraws for the suggest dropdown to properly flow |
There was a problem hiding this comment.
@roblourens this is one hack needed to get the suggest to properly move when you resize the window. The call to layout is ignored if the new config is the same, so I add and remove a pixel each time. Alternative suggestions welcome.
|
Opting for the alternative implementation in #57050. |
Closes #55796
This is a somewhat quick and dirty initial implementation. It seems pretty slow on Code - OSS but when I made a full minified build I didn't notice anything particularly slow. It also isn't properly keyboard navigable.
If we decide to go with this idea we'd remove the input box all-together and probably replace it with a button that triggers the dropdown, or just a div and wire up the onspace, onclick, onenter, tab stopping, etc. manually.
It probably looks bad on Mac, as the rounded corners may not hide the input sufficiently, but I don't have anything with me to test.