mattermost icon indicating copy to clipboard operation
mattermost copied to clipboard

Focus the first message in the rhs when recent mentions, flagged or pinned posts are opened via the keyboard

Open mattermod opened this issue 2 years ago • 7 comments

Repro: Use the keyboard to navigate to the Recent Mentions button (or pinned posts, or flagged posts, or execute a search), hit Enter.

Observed: Focus is not moved to the first message in the pane

Expected: Focus is moved to the first message in the recent mentions list (similar to if the user hit F6 three times to navigate to the "complimentary region")


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-25148

mattermod avatar Mar 29 '22 14:03 mattermod

I can give it a try on this @amyblais @hmhealey

sinansonmez avatar Jul 02 '22 08:07 sinansonmez

@esethna I am trying to reproduce this. I would like to clarify one point.

When I use keyboard to select Recent Mentions and hit enter, as mentioned in the issue, first message is not focused. However I also see the same behavior, when I click Recent Mentions with mouse (again no focus).

The expectation in this ticket is that to create a different behavior and focus the first message when user navigates using keyboard and selects Recent Mentions or Saved Posts or Pinned Posts. Is my understanding correct?

sinansonmez avatar Jul 11 '22 20:07 sinansonmez

@sinansonmez correct. If navigating with the keyboard we would expect to see the focus effect on the first message in the pane.

image

When using the mouse we do not expect to see this effect

esethna avatar Jul 11 '22 20:07 esethna

@esethna thanks for the clarification.

I spent some time on this to figure out the implementation. Unfortunately I couldnt find an easy solutions (at least not visible to me). I could see that accessibility is mainly managed by this file

The question: Is there any similar implementation in the codebase so I can check and try to implement it here as well? If not, could someone provide some guidance on how to implement this feature?

sinansonmez avatar Jul 25 '22 17:07 sinansonmez

I'm not sure if we have any other good examples of doing something like this, but what if we just always focused that element when one of those views is opened? I'd hope that the A11yController would recognize that the focus changed and apply the correct effect since, even though the focus was changed programatically, I don't think that would stop it from adding the extra highlighting. When clicking on the button to open one of those views, it'd still change the focus, but it shouldn't apply the extra highlighting because the A11yController isn't active

hmhealey avatar Jul 27 '22 19:07 hmhealey

Thanks @hmhealey for the suggestion. I tried to implement your proposal but unfortunately no luck. Here is my branch. Anything else comes to your mind that can fix the issue?

sinansonmez avatar Aug 12 '22 21:08 sinansonmez

I am unassigning myself as I couldn't have more progress on this. Maybe someone else could tackle it.

sinansonmez avatar Sep 17 '22 20:09 sinansonmez

sinansonmez i want to try keep your progress, is the problem in the server or the frontend code?

LuizArnoldChavezBurgos avatar Apr 27 '23 01:04 LuizArnoldChavezBurgos

@LuizArnoldChavezBurgos It should be on the front end

sinansonmez avatar Apr 28 '23 17:04 sinansonmez