mattermost / desktop

Mattermost Desktop application for Windows, Mac and Linux
Apache License 2.0
1.99k stars 812 forks source link

Switching to the app should always focus the message text box #355

Closed fibbs closed 7 years ago

fibbs commented 7 years ago

I confirm (by marking "x" in the [ ] below):


Summary

The text box on the bottom of the app's main window doesn't reliably get focussed when the app is brought to the foreground, in order to start typing without the need to focus the text box manually. This is very bad for the user experience.

Steps to reproduce

Tested on macOS Sierra, latest Mattermost Desktop App 3.4.1 on a Mattermost Server Version 3.4.0.

  1. mark some text within received messages and observe the cursor disappears from the text box
  2. hit cmd-tab to switch to any other application on your desktop
  3. send yourself a message through mattermost (from another computer or mobile device)
  4. click on the desktop notification to bring mattermost desktop app to the front
  5. observe the cursor doesn't activate in the text box

This behavior only applies if the app doesn't have to switch the channel, meaning that the channel within which the message has been received recently was already open in mattermost desktop app.

Expected behavior

Message box should be focussed (show the blinking cursor) every time the app is brought to the foreground (switched to it).

Observed behavior

The message box doesn't receive focus when the app is brought to the top, and the last action before putting the app to the background was a click within the message stream that made the focus go away from the text box.

jasonblais commented 7 years ago

@fibbs Thanks for the feedback!

As a regular Mattermost desktop app user, I share a similar sentiment. It would be nice if the app auto-focused on the message box when brought back to the foreground.

However, I think there are a few corner cases to consider where the focus shouldn't be set to the message box:

  1. an open modal like Account Settings
  2. any page that doesn't have center channel (e.g. full-page screens, backstage, System Console)
  3. focus already set to right hand sidebar input box or search box

Moreover, if right hand sidebar contains a comment thread AND right hand sidebar is expanded, focus should probably be set to the right hand sidebar instead of the center channel, complicating the situation a little.

Mattermost has an open Help Wanted issue on the server side where if a user types, the focus should always be set to the center channel text input box (apart from the scenarios given above).

Wondering if that would be a proper fix for this issue?

yuya-oc commented 7 years ago

Just for reference: #155

jasonblais commented 7 years ago

Closing the issue here, since it's not specific to the desktop app.

If you'd like see focus set automatically to the input box on typing, consider upvoting the existing feature request or participate in the discussion of the GitHub Help Wanted issue on the server side.