edit icon indicating copy to clipboard operation
edit copied to clipboard

Ctrl+P or mouse click outside the file switcher dialog should close it

Open stormcrash486 opened this issue 7 months ago • 7 comments

Right now once you summon the file switcher dialog the only way to close it is to re select the current file (click or with Enter) or the Esc key. If the menu was opened with the mouse a user may want to back out of the dialog by clicking outside of the boundaries of the window, or a keyboard user want to close the dialog with the same key shortcut that summoned it.

Right now it can feel like you've become trapped it the dialog or have to pick a file again unless you make a change to a different use pattern to press Esc to close without making a new selection

stormcrash486 avatar May 22 '25 20:05 stormcrash486

I'm not going to fix this in the current state of the editor as it would not mix well with the UI architecture. But I will mark this as a part of #25, which will unify the various dialogs. Then we can make the differentiation between modals and dismissible dialogs.

lhecker avatar May 22 '25 21:05 lhecker

Since dialogs are going to be re thought out anyways then another option to consider would be to add a close button for mouse users

I've attached an image of the old DOS Borland Turbo C IDE as an example, it has the green box in the dialog and editor frames as a "Close" button. Image

Placement and symbol could of course be different but it would be a way to make mouse interaction more complete, but I also get that this is a TUI and the command line keyboard user is a major target

stormcrash486 avatar May 22 '25 21:05 stormcrash486

Yeah, that's something we could do for sure! Do you mind copying your comment into a new issue asking for close buttons?

lhecker avatar May 22 '25 23:05 lhecker

https://github.com/microsoft/edit/issues/231

stormcrash486 avatar May 22 '25 23:05 stormcrash486

Traditionally...

  • Ctrl+P or ⌘P is used for printing
  • The escape key is equivalent of pushing a cancel button
  • In CUA-89 the F3 key is used to exit the current screen

If the dialog needs a cancel button then add a cancel button.

rhubarb-geek-nz avatar May 23 '25 01:05 rhubarb-geek-nz

Edit: apologies, I see this was already discussed in the linked issue.

My vote is for clicking off the dialog to close it, if that is equally simple to implement as a close button.

That's how VS Code Command palette etc. behave and it is a very natural thing to try, requiring less precision with the mouse.

ivanovkirilg avatar May 26 '25 09:05 ivanovkirilg

I think my two main gripes with the current document switcher menu can be summed as follows

No way for a mouse user to dismiss the menu without switching to keyboard (press Esc)

Keyboard shortcut that opens the menu (be it Ctrl+P or a different binding in the future) should also close the dialog as a cancel action without making any changes to the currently selected document. This avoids having to change from one gesture (Ctrl+P) to another (Esc/Enter) to close or having to reselect the same document

stormcrash486 avatar May 27 '25 20:05 stormcrash486