-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
navbar: Fix left/right arrow key navigation between menus. #29781
Conversation
Thanks for the fix! Could you please update your commit message to match the commit style guidelines? Please also complete the self-review checklist (as applicable), and post a comment to request a review when ready. |
I think it's ready for review now :). |
@amanagr Could you please take a look at this one? I haven't tested. |
@rs545837 The commit title still does not follow the guidelines. You changed the PR title, not the commit message. |
@alya, I actually did change both of them. Can you please tell the specific changes, I should consider while writing it. |
@rs545837 thanks for working on this. Can you make the fix for user list toggle icon on top of #29167 and also address this comment? You can push your changes in this PR. |
Ya I can work on that. |
Hello @rs545837, it seems like you have referenced #29465 in your pull request description, but you have not referenced them in your commit message description(s). Referencing an issue in a commit message automatically closes the corresponding issue when the commit is merged, which makes the issue tracker easier to manage. Please run An example of a correctly-formatted commit:
To learn how to write a great commit message, please refer to our guide. |
The issue for the left and right navigation from the help menu to the userlist toggle button and back respectively is working with this PR.
This commit builds on the changes from zulip#29167 to fix the user list toggling with the left and right arrow key navigation
Let me know when this is ready for review. |
d5243a8
to
4e5b39f
Compare
This commit fixes the issue of the arrow navigation with the login button while in the spectator mode, with a narrow viewport setting, this was left unresolved in the PR zulip#29167 and is taken up here.
@amanagr it's ready for review. |
Heads up @rs545837, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
Sorry, it looks like it will require some significant work on my part to get this in a good state, so I will likely take over it later. |
Yeah, this feels like too much code for what we're trying to do here; I'm going to close this one as I think we need a different approach. |
I am also an applicant of GSOC this year.
This PR is built above and is a continuation of #29167.
The left and right arrow keys now allow navigating between the userlist sidebar, help menu popover, and gear menu popover. Pressing the right arrow key from the userlist sidebar toggle button will open the help menu popover. Pressing the left arrow key from the help menu will hide it and re-focus the userlist sidebar toggle button.
I faced issues with the right arrow keypress while the user list was focused. I initially tried using event_name == "right_arrow" to detect the right arrow key press, but it wasn't being recognized when the userlist toggle button was focused.
To overcome these issues, I decided to directly handle the keydown event on the userlist toggle button using the $("#userlist-toggle-button").on("keydown", ...) event listener. By attaching the event listener directly to the toggle button, I ensured that the right arrow key press would be captured when the button was focused.
Inside the keydown event handler, I used e.key === "ArrowRight" to check if the pressed key was the right arrow key. This approach relies on the key property of the event object, which provides a string representation of the pressed key. Using "ArrowRight" as the comparison value ensures that the right arrow key is correctly detected.
Fixes: #29465.
Screenshots and screen captures:
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: