Repository navigation
fix(a11y): main menu a11y updates - #45137
Conversation
|
👀 Review this PR in a CodeSee Review Map |
For what it's worth, the different languages in production are entirely different instances - there's not really a way to test switching them locally without rebuilding the entire client. |
|
Thanks for the hard work here. Here are a few nitpicks.
In order to be more conventional with the lang selector, I suggest having a span with the word “Language:” followed by “English” and aria-label of “Change language" or “Select Language”. I completely agree on implementing a consistent focus state. And —blue mid would be a great candidate for the reason you mentioned above. After completing the ui library, a color system audit is due where we evaluate our accent colors and their usage. For the time being, let us have the focus state represented as an For navigating between clients, if the new language selector links to a similar url as before, it should be good to go. Other than that the navigation is coming tougher neatly here. |
|
The font in the menu is currently set to |
This is actually a violation of WCAG 2.5.3 Label in Name. (Yes, Khan Academy is in violation of this guideline.) This guideline says that the accessible name (which would be the text in The way I have it implemented now, there is no need for I think what would be more useful would be to find an icon that represents a language picker (I'm not sure what that would be at the moment) and then if somebody accidentally switches to a language they can't read at least they would be able to find the language picker easily by recognizing the icon. |
I have fixed these issues and also a few minor touch-ups of issues I overlooked initially. Eagerly awaiting more feedback. If everyone feels that the language picker needs to show the current language then I will work on making that as accessible as possible. |
|
I agree with your reasoning, let's keep it as "change language". I think the globe icon is a good candidate. We might consider replacing it with the drop down icon. On a second thought, let's change the background of the language menu to a lighter gray shade( between gray-85 to gray-75), and keep the hover state on nav menu and language menu identical to what it was previously. This seems to be coming together nicely. Thanks a lot for your efforts. |
|
I searched for "language icon" and found a possible candidate which I have added to the main menu. Let me know if you like it or if you want me to keep trying. As for the colors on the language menu, FCC is currently using a |
|
Everything looks great. Here are the final touches:
color: var(--theme-color);
background-color: var(--gray-10);(We will incorporate that blue background further in the component library.) Here are a few quick mocks. (the checkmark is missing) |
|
@ahmadabdolsaheb Thank you for the mock-ups, this made it much clearer as to what you want. I believe I got it all but let me know if I missed something. If this looks good to go I believe we just need to add a translation for "Change Language". |
5ef5004 to
c85c7a5
Compare
|
In addition to adding the Since the tests are tightly coupled with the previous structure of the navigation components, I wonder if they should be replaced with cypress tests instead. |
901d3e6 to
426e60b
Compare
|
@ahmadabdolsaheb Good call on changing the name of |
…tton and user clicks into search
057e69b to
e6bd7ea
Compare
|
@emmalearnscode, thanks for taking a look. Yes we will gradually roll out the focus styles to all of our components in this repository. @bbsmooth, thanks for all the hard work. Looking forward to see this in production. |
There was a problem hiding this comment.
Well, I looked over this pretty hard. There's a lot of conversation here - I tried to read, or at least skim over, all of it - I apologize if I missed some context or explanation - here's everything I found...
I was a little confused with using the tab key then switching to the arrows for the menu, too. I picked up on it quick.
The language links all look to be working.
On Safari 13.1.2 - pretty old version - there's quite a few issues with it. Tab order seems off - I hit enter on the menu and then tab takes me to 'night mode', and 'change language' after that. All the other options get skipped. It also skips over the avatar/profile icon. Well, none of it is even reachable on production with that version of Safari - so it’s an improvement - since that’s the case, I wouldn’t let that hold back this PR. I tried looking into it a little, didn’t see what the cause was. Did anyone else (@ahmadabdolsaheb) get a chance to test this on a newer Safari? I do think this might be something to try and look into with another PR - The nav is heavily used so it might be worth making it more compatible than other things like a lone curriculum test.
There did seem to be a minor style issue with the search on smaller windows...
Production - search lines up with whatever button is above it:

This PR - search goes behind the scroll bar:

I left a few minor suggestions below.
That's really all I found? I must be losing it - or this just looks really good. It looks real good @bbsmooth 🎉 Nice job 👍 Here's some quotes from you: "I'm not a React expert" ... "Same with TypeScript." Whatever you say. I would be good with merging it like this if we want.
Edit: This has been around a while and had a lot of work put in. All the things I found are quite minor - if you're ready to be done with it, @bbsmooth - let me know and we can merge it.
Wow, I was not expecting that. I know that there can be issues with the VoiceOver screen reader and Safari if the list has had the default bullet styling removed, but I don't think I've heard of it being a problem when not using VO. The solution for the VO issue is to add |
You'd think by now all browsers would handle CSS the same but of course this is an instance where it looked good in FF but not the others. Someday I'll learn that you've got to test everything in every browser. I think I've got this looking good in all of them now. |
Oh ya, I completely forgot about that issue. I had heard of it before, but since I don't have a mac it just wasn't one that popped into my head. I'll remove the extraneous list role and I think we are ready to to. |
moT01
left a comment
There was a problem hiding this comment.
LGTM 🎉
Want to take one last look and get this in when you get up @ahmadabdolsaheb



Checklist:
Update index.md)mainbranch of freeCodeCamp.Closes #45106
This is a big one. There are several a11y issues with the current main menu that I have attempted to fix.
--blue-midcolor from the predefined color pallet for the menu because it has accessible contrast with both dark and light themes and I just think it looks nice. You'll also notice that you will only see the focus outline if you are using the keyboard to navigate the menu. The ability to do this easily with CSS has been added rather recently (and has a safe fallback for those browsers who don't recognize it).I was not able to figure out how to get the various languages to serve properly, so I was not able to do an official test on the language picker to make sure it takes you to the language you pick. I would appreciate it if someone would test this for me. Also, I don't have access to Safari, so it would be great if someone who does would test this, especially the language picker, to make sure it behaves properly.
This PR is not quite ready to go as-is but it is definitely good enough for preliminary testing. There are some translations that will need to be set up. And I'm not a React expert (yet), so if I have done some things that go against best practices I'm more than happy to hear about it. Same with TypeScript. And I'm sure not every change I made will be perfect.