Description
Scenarios:
- The attach context in Chat:
- Git branch status bar item:
- Language, Encoding, Tab Size status bar items:
All of these open Quick Picks that are aligned at the top... and we've gotten wishes that the quick pick could be rendered closer to these items.
Explorations
Explore simply moving the existing quick pick closer to what's invoking it
Hacked up in 88f4209 if you click in the Chat input and click the paper clip, the quick pick renders closer to it:
another example if your cursor was in the Search:
and another example if you use the branch picker:
There are a few things to iron out:
- this commit only renders things close to things if they're in the outer 30% of the screen. This would be modified to logic that says " always render close to the thing... if you're in the main editor part, render in the middle".. but requires additional layer work since WorkbenchLayerService is in
workbench
and quick pick is inplatform
- Clicking on buttons does not take focus... so if my cursor was in the Search bar, and I clicked the Attach Context with my mouse, the quick pick will render close to Search
- current logic breaks D&D and that would need to come back
Those are things that could be solved with some work... but I think the big problem is that........ it just doesn't look that great. I was really expecting it to look and feel nicer, but I don't think it does. I wish that the quick pick felt more attached to the thing that is opening it... like the attach context, or the Git status bar item.
That inspired the 2nd exploration.
Explore a new kind of widget
For the attach context and the status bar items, the wish is for something that really feels attached to that. Something like the label picker on GitHub:
but with a tail like a hover (like the Language Status Bar item):
It could look something like this (please forgive my bad Figma skills):
Writing down a loose idea from notes:
* make a QuickContextWidget that is similar to a quick pick, but smaller and attachable to a UI component (it could use shared code with QP)
* adopt this in Core for the attach context
* adopt this for all Core contributed Status Bar Items
* add a `showQuickContext(items: QuickContextItem[]): Promise<QuickContextItem | undefined>`
* adopt the `showQuickContext` in git extension
I think we need more mockups... open questions:
- What would the height of these be?
- Could we render the input at the bottom?
- What do InputBoxes look like (instead of QuickPicks)?