Skip to content

feat: add navigation menu for mobile #436

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

Merged
merged 7 commits into from
May 1, 2024

Conversation

ryuapp
Copy link
Contributor

@ryuapp ryuapp commented Apr 23, 2024

close #40
If horizontal width of a navigation list exceeds a window size, it will store them in a small menu.

Preview
image

@ryuapp ryuapp changed the title Add navigation menu for mobile feat: add navigation menu for mobile Apr 23, 2024
Copy link
Member

@donjo donjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! so happy to see this get cleaned up.

One thing I'd like to see fixed before we merge is how this handles using tab to navigate. Right now I can't seem to navigate to the items available in the dropdown by hitting tab unless the dropdown is already open. I would expect to be able to tab to the dropdown and open it to view the contents inside right after tab is focusing on Versions.

Mobile users won't necessarily see this but a lot of people use mobile viewport widths on their desktop to have reference docs alongside their editor so it would be nice to have this working for keyboard-only users in that setting.

@josh-collinsworth
Copy link
Contributor

josh-collinsworth commented Apr 24, 2024

While this does address the original problem, I'm concerned it creates another.

I worry it isn't obvious that the dropdown button is related to the menu of visible items, and I don't think having some menu items outside a dropdown menu and others inside is a conventional or obvious pattern. It could easily look to users like the dropdown button is something unrelated to the items they can see, and they might not consider checking inside it for the other items, given that tenuous connection between the button and the menu.

This being the case, I would personally champion one of the following alternatives:

  1. The items could sit together on one line that scrolls horizontally (given obvious enough scroll indicators); or
  2. All of the items could be in a single dropdown/select menu.

I'm open to other solutions I haven't considered as well, if they're intuitive enough. I just don't think the tradeoff here—saving some vertical real estate—is worth introducing a potentially confusing UI pattern.

@iuioiua
Copy link
Contributor

iuioiua commented Apr 27, 2024

This being the case, I would personally champion one of the following alternatives:

  1. The items could sit together on one line that scrolls horizontally (given obvious enough scroll indicators); or
  2. All of the items could be in a single dropdown/select menu.

My $0.02 (not that anyone asked) is I like option 1.

@ryuapp
Copy link
Contributor Author

ryuapp commented Apr 29, 2024

One thing I'd like to see fixed before we merge is how this handles using tab to navigate. Right now I can't seem to navigate to the items available in the dropdown by hitting tab unless the dropdown is already open. I would expect to be able to tab to the dropdown and open it to view the contents inside right after tab is focusing on Versions.

I fixed the accessibility issue.

This being the case, I would personally champion one of the following alternatives:

  1. The items could sit together on one line that scrolls horizontally (given obvious enough scroll indicators); or
  2. All of the items could be in a single dropdown/select menu.

Option 1 is user-friendly on mobile, but it is very painful on PC because there is no mouse wheel for horizontal scrolling.
So I prefer option 2 to 1. However, it is easier to navigate between screens if items of the menu is partially displayed.
If it change from ... to More..., the problem may be slightly improved.

@lucacasonato
Copy link
Member

One further bit of data:

image

GitHub also does the Tab bar with overflow into a ... menu.

@donjo donjo added this pull request to the merge queue May 1, 2024
Merged via the queue into jsr-io:main with commit 0cf3de5 May 1, 2024
6 checks passed
@ryuapp ryuapp deleted the mobile-navigation-menu branch May 2, 2024 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Render smaller truncated menu in mobile view
5 participants