tigase / beagle-im

(M) XMPP client for macOS based on TigaseSwift XMPP library
GNU General Public License v3.0
184 stars 21 forks source link

CMD-Backspace should delete line, not close chat. #16

Closed neur0manc closed 4 years ago

neur0manc commented 4 years ago

Describe the bug CMD-Backspace should delete line, not close chat. It is a common idiom on macOS to delete the current line of text. BeagleIM should use CMD-w to close the current chat, not CMD-Backspace.

To Reproduce

  1. Enter a few words in a chat window
  2. press aforementioned key combination.

Expected behavior I expected that the text in entered disappeared.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

hantu85 commented 4 years ago

I've just reviewed the behavior of apps on macOS (like Messages, Bear, Notes, Reminders, Mail) and each app has different behavior for CMD-Backspace, ie.:

As you can see, CMD-Backspace means delete line or item (ie. note, chat), so usage of CMD-Backspace is correct in this case.

On the suggestion of usage CMD-W to close the chat - it is not how applications behave on macOS. CMD-W means "close the window" not close the chat!

I'm open on other alternatives for a shortcut to close a chat, but for now, closing on CMD-Backspace when the input field is empty looks like a most viable solution.

neur0manc commented 4 years ago

CMD-W is widely used to close tabs, see any browser (safari, chrome, brave), or terminal emulators (iterm2 and terminal.app both). Text editors also do behave like this. VSCode to name one.

CMD-Backspace in Apple Messages behaves exactly as I described it: When a text-entry field is focused, CMD-Backspace deletes the whole lin. It does not close the current chat. Also you've mentioned a few apps that behave like this, i.e. when inside a text entry widget, CMD-Backspace removes a line. IMO that underlines that beagle-im should also remove a line, instead of closing the chat.

More examples are Telegram and WhatsApp.

hantu85 commented 4 years ago

I've double-checked and Apple Messages closes chat (and even deletes the content of the chat) when text field has focus but it is empty and you pressed CMD-Backspace.

Due to that, I'm going to follow what Apple Messages does: if there is a line - remove it, if text filed is empty - close chat.

neur0manc commented 4 years ago

I'm going to follow what Apple Messages does: if there is a line - remove it, if text filed is empty - close chat.

Nice, thank you!

jnaeff commented 4 years ago

It works great thanks for solving this!