deltachat / deltachat-desktop

Email-based instant messaging for Desktop.
GNU General Public License v3.0
948 stars 169 forks source link

esc-key in group create & -edit close the whole stack, not the last dialog #2268

Open r10s opened 3 years ago

r10s commented 3 years ago

usually the "escape"-key closes the most recent dialog; in a stack of dialogs, the underlying dialog is show again then (on can regard the "escape"-key as a kind of shortcut to the "cancel" or "close" button).

however, the "escape"-key closes all dialogs in a stack of dialog - eg. if you select "New chat / New group / Add members" and add some members by hand, entering a name and an icon - and finally go to Add member to check things again there and hit "Esc" there - all your work is lost.

(this is an older issue, i checked, it exists also in 1.15.5 so, no worsening in 1.20.0. maybe the issue was introduced with https://github.com/deltachat/deltachat-desktop/issues/1743)

EDIT: the Esc-key works fine at "Settings / Show Classic mail" and "Settings / Delete message from ..." - here the dialogs are also visually stacked. maybe we can see that approach as a pattern for the other dialogs? at least for future things? Cmp. directly with "Settings / Edit profile" to get the difference.

Simon-Laux commented 3 years ago

note: this dialog is technically not stacked, its a single one.

r10s commented 3 years ago

note: this dialog is technically not stacked, its a single one.

okay. from the user-perspective, however, that does not really matter: there is a dialog opening another dialog - otherwise, also the "Cancel" button should always close the whole dialog (just to make things clear, i do not propose to do so :)

and: it is not only wrong in "Group create" and "Group edit" - it is also wrong in "Settings / Edit-profile" and "Settings / Password and account" (and maybe others) - whereas "Settings / Show classic e-mail", "Settings / Delete message from ..." and "Settings / Theme" are fine.

Jikstra commented 3 years ago

We need to kick out the canEscapeKeyClose logic of blueprint and do our own thing. We need to know more about the dialog stack, which we currently don't know (which dialog is at top...)

Simon-Laux commented 3 years ago

we need to do keybindings sometime right anyway, maybe this will already come up with improving accessibility, if an dialog is open other keybindings like with chat should be disabled and you should not be able to tap around in the main app while an dialog is open and stuff like that. But that's probably a bigger thing, for making the dialog better we could just multiple ones on top of each other or add some escape listeners with the prevent default trick/hack as workaround.

Jikstra commented 3 years ago

Any ideas how we can do it "right"?

link2xt commented 1 year ago

however, the "escape"-key closes all dialogs in a stack of dialog - eg. if you select "New chat / New group / Add members" and add some members by hand, entering a name and an icon - and finally go to Add member to check things again there and hit "Esc" there - all your work is lost.

Cannot reproduce this.

I have tried this:

  1. Click "+" in the chatlist.
  2. Click "New Group".
  3. Enter group name.
  4. Click "Add Members".
  5. Select some members, click "Ok".
  6. Click "Add Members" again.
  7. Click Esc

After that "Add Members" dialog closes, but "New Group" is still there.

"Add Members" dialog is stacked on top of "New Group" in Desktop 1.40.2.

farooqkz commented 1 year ago

I can reproduce this:

  1. Click "+"
  2. Click "New group"
  3. Click "add members"
  4. Add some members
  5. Click "OK"
  6. Press Esc