Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

fix(a11y): show bottom nav button labels#3120

Open
shuuji3 wants to merge13 commits intomain
base:main
Choose a base branch
Loading
fromshuuji3/a11y/show-nav-botton-label

Conversation

shuuji3
Copy link
Member

@shuuji3shuuji3 commentedJan 1, 2025
edited
Loading

fix#3119

This PR includes

  • showing labels below the bottom nav button icon
  • a new option to hide them on the interface setting page (just below the nav button customization section)

With labels

Screenshot from 2025-01-01 23-46-09

Without labels (current state)

Screenshot from 2025-01-01 23-46-19

About the default setting, this change may surprise the existing users a bit if they like the current simpler interface. On the other hand, I also understand showing labels by default can provide better accessibility.

Dehelssey reacted with hooray emoji
@netlifyNetlify
Copy link

netlifybot commentedJan 1, 2025
edited
Loading

Deploy Preview forelk-zone ready!

NameLink
🔨 Latest commit7ab0c1e
🔍 Latest deploy loghttps://app.netlify.com/sites/elk-zone/deploys/6778f8321985910008147996
😎 Deploy Previewhttps://deploy-preview-3120--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify site configuration.

@netlifyNetlify
Copy link

netlifybot commentedJan 1, 2025
edited
Loading

Deploy Preview forelk-docs canceled.

NameLink
🔨 Latest commit7ab0c1e
🔍 Latest deploy loghttps://app.netlify.com/sites/elk-docs/deploys/6778f832d5f1db000893c93d

@Dehelssey
Copy link

On deploy preview the checkbox for hiding labels does nothing 👀 (i run /e/OS (Android) with Vivaldi)

@shuuji3
Copy link
MemberAuthor

@Dehelssey Unlike other settings, it seems like reloading is required to change to be effective.

@shuuji3
Copy link
MemberAuthor

OK, I figured out how to make them reactive. Now checking should be effective immediately.

@userquin
Copy link
Member

uhmmm, why isgetPreferences not reactive?

@userquin
Copy link
Member

userquin commentedJan 1, 2025
edited
Loading

I guess it will be better to move the check in the interface page to the top, betweenBottom Navigation and theChoose... paragraph:

imagen

@userquin
Copy link
Member

I guess you should also change the button layout in the interface page.

@shuuji3
Copy link
MemberAuthor

OK, I'll add labels in that preview too, and move the option belowBottom Navigation header.

uhmmm, why isgetPreferences not reactive?

I'm not sure yet 😅

@shuuji3shuuji3force-pushed theshuuji3/a11y/show-nav-botton-label branch fromfe99f78 tof9f58a8CompareJanuary 1, 2025 15:59
@shuuji3
Copy link
MemberAuthor

  • moved the checkbox
  • show labels in the preview area
    Screenshot of setting page without labels in preview
    Screenshot of setting page with labels in preview

Also, fixed the reactivity issue withcompute() and made it composable. (Thanks@userquin for the help!)

Other than that, I feel like we should add a small space between icon and label. I'll update that tomorrow.

@userquin
Copy link
Member

userquin commentedJan 1, 2025
edited
Loading

Don't merge yet, the preview buttons not being translated, I'm going to fix it.

image
preview texts not being translated

We also need to fix long texts, we shouldn't use ellispsis...@Dehelssey any idea about this? Check for example Euskera:

image
long button text (Euskera)

@userquin
Copy link
Member

https://m3.material.io/components/navigation-bar/guidelines

imagen

Dehelssey reacted with thumbs up emoji

@Dehelssey
Copy link

@userquin indeed, ellipsis is not advised. If that label can't be replaced by something shorter I'm not sure how to deal with this. French isn't as effective as english but we don't deal with that long words anyway. In my opinion, two lines label remains the best way to deal with it, but icons should be remain aligned in such a case.

@userquin
Copy link
Member

userquin commentedJan 1, 2025
edited
Loading

@userquin indeed, ellipsis is not advised. If that label can't be replaced by something shorter I'm not sure how to deal with this. French isn't as effective as english but we don't deal with that long words anyway. In my opinion, two lines label remains the best way to deal with it, but icons should be remain aligned in such a case.

We cannot do that, the bottom nav should have ~67px height, we can ask if the lang has some abbr. to use in that case otherwise there is no solution for this.

(I use md, but we can just ignore that)

@shuuji3
Copy link
MemberAuthor

It seems that we need to find a short string for this new button label in some languages. For English, I think we can shorten "More menu" to "More" or something.

In various apps, developers themselves somehow come up with good short labels and if no localization is available, they fall back to English.

So how about adding new localization keys likenav_short_label next tonav keys here?
https://github.com/elk-zone/elk/blob/411fcc8/locales/en.json#L305

For example:

 "nav": {     ....     "conversations": "Conversations",     ...     "more_menu": "More menu",     ...+"nav_short_label": {+    ....+    "conversations": "Conversations",+    ...+    "more_menu": "More",

We can just copy the existingnav strings for languages that already have short labels and fall back to English while waiting for the update of other languages. What do you think?

Nav bars examples

I checked nav bars in various Android apps (in English, French, and German).

Slack

Screenshot_20250102-140357
Screenshot_20250102-140328
Screenshot_20250102-140305

Play Store

Screenshot_20250102-140728
Screenshot_20250102-135909

Contacts

Screenshot_20250102-135641
Screenshot_20250102-140653

Others

Screenshot_20250102-135534
Screenshot_20250102-140246
Screenshot_20250102-135756

Google Fit and GitHub

They failed showing a good short label in German 😅
Screenshot_20250102-141111
399644292-54b5c1a2-adba-4ad9-afb9-72351f383e70

userquin reacted with laugh emoji

@shuuji3
Copy link
MemberAuthor

shuuji3 commentedJan 2, 2025
edited
Loading

^ small style refinement (only for the preview area)

Before
Screenshot of nav button settings page

After
Screenshot of nav button settings page after adjusting spaces

@shuuji3shuuji3force-pushed theshuuji3/a11y/show-nav-botton-label branch from62e5abb to80dfd37CompareJanuary 2, 2025 09:12
@userquin
Copy link
Member

userquin commentedJan 2, 2025
edited
Loading

Maybe we can reduce the elements to 4 when showing the labels... or use ellipsible.

NOTE: X using 6 items without labels and Bluesky using 5 whitout labels.

@shuuji3
Copy link
MemberAuthor

Showing ellipsis is suboptimal but maybe we need to use ellipsis for now to avoid overflow or two lines of label. For some languages having ellipsis labels, users already have choices either reducing to four buttons or hiding labels when they don't want to see ellipsis. Later, we can encourage translators to shorten those labels to avoid ellipsis as possible.

I'd like to keep the maximum number to five since it's better to avoid reducing functionality just for this label issue and the Material guide does not recommend more than 5 buttons1.

(Aside from the guideline, I don't know the current state but X app may not be reviewed by accessibility expert team so it may not be a good example in terms of accessibility2)

Footnotes

  1. Navigation bar – Material Design 3

  2. Elon Musk just axed key Twitter teams like human rights, accessibility, AI ethics and curation | TechCrunch

Dehelssey reacted with thumbs up emoji

@shuuji3
Copy link
MemberAuthor

I'm trying to implement the ellipsis but the current CSS does not work as expected yet. But the two-line label issue was fixed.

screenshot of nav bottom labels with narrow window width, labels are overflowing without ellipsis

I referred this method: Truncate String With Ellipsis | CSS-Tricks -https://css-tricks.com/snippets/css/truncate-string-with-ellipsis/

@ayoaycoayoayco closed thisFeb 9, 2025
@ayoaycoayoayco deleted the shuuji3/a11y/show-nav-botton-label branchFebruary 9, 2025 14:24
@shuuji3shuuji3 restored the shuuji3/a11y/show-nav-botton-label branchFebruary 9, 2025 14:45
@shuuji3shuuji3 reopened thisFeb 9, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Accessibility: add label under icons on mobile navbar
4 participants
@shuuji3@Dehelssey@userquin@ayoayco

[8]ページ先頭

©2009-2025 Movatter.jp