-
Notifications
You must be signed in to change notification settings - Fork 75
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
Fix navigation in mobile devices #702
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! There are some issues to fix.
- very low contrast: mobile menu, focus during keyboard tabbing, yellow background and white font. Font color must be changed in the focus style.
- very low contrast: gray "course staff" text (not link) in the mobile menu. Also very small font size warning. The same for text "Course" and "Site" in the mobile menu.
- "Course" text is not well aligned with the language button
- The language selection menu (Finnish/English) does not look good in the mobile menu. You must fix the background and font colours. You can set language "|en|fi|" in the A+ course settings even if the course is only defined in one language like the aplus-manual.
@@ -8,7 +8,7 @@ | |||
{% prepare_course_menu %} | |||
|
|||
<li> | |||
<a href="#course-content" class="skip-link page-skip-link"> | |||
<a href="#course-content" class="skip-link page-skip-link hidden-xs"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that mobile users don't have any skip links (except the first skip link for skipping all navigation)? The skip links are intended for keyboard users and small mobile devices don't have any keyboards, so it would make sense in that regard. I wonder if there is any accessible technology that would be used with small screens and the mobile versions of web sites. Can you find out whether skip links are usually included even in mobile web pages?
After testing this myself, I think it works well right now. The mobile course menu is easy to skip with the tab key because the menu does not open unless you hit the Enter key. If you don't open the mobile menu, pressing tab skips the whole menu without needing any skip link.
Can you verify how screen readers behave with the mobile course menu? What does it say on top of the mobile menu open button?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The language menu must be also tested with the screen reader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like mobile devices have certain features that allow users to navigate websites with certain gestures.
https://developer.mozilla.org/en-US/docs/Learn/Accessibility/Mobile. But, I was also checking some websites, and they keep the main "skip navigation" link in small devices. You can check in bootstrap, GOV.UK and GitHub websites.
Can you verify how screen readers behave with the mobile course menu? What does it say on top of the mobile menu open button?
It says "toggle navigation button collapsed" if the menu is closed or "toggle navigation button open" if it is open. I think that is the expected behaviour, or at least that message is used also in bootstrap and Github webpages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The language menu must also be tested with the screen reader.
Which language menu? This?
If so, I tested the behaviour of that button in production, and it works as intended, but we can take a closer look at that button when solving this issue #428
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I mean the language menu that selects between Finnish and English.
templates/base.html
Outdated
@@ -79,6 +79,10 @@ | |||
<nav class="topbar navbar navbar-inverse navbar-static-top" aria-label="{% trans "Main" %}"> | |||
<div class="container-fluid"> | |||
<div class="navbar-header"> | |||
<a class="navbar-brand" href="{% url 'home' %}">{% brand_name %}</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this change do? Would you clarify in the discussion here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The brand button had an anchor
pointing to the home page, but the anchor
is removed for small devices, and that makes no sense. Users in small devices also expect the brand button to behave as a link to the home page. That is the reason I remove the code below. The code that is shown in green already existed, but the changes in indentation makes the code looks like a new piece of code. I only replaced the hidden-xs
class with the visible-xs
class, and move it the brand button before the toggle menu.
templates/base.html
Outdated
<a class="navbar-brand hidden-xs" href="{% url 'home' %}">{% brand_name %}</a> | ||
<span class="navbar-brand visible-xs"> | ||
{% brand_name %}{% if instance %} {{ course.name|parse_localization }}{% endif %} | ||
</span> | ||
</div> | ||
<div class="collapse navbar-collapse" id="bs-navbar-collapse"> | ||
<ul class="nav navbar-nav hidden-xs"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the course instance selection menu could be shown in the mobile view too. Could you try this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can include the drop-down menu
in the toggle menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the second one (separate course instance menu and the toggle menu like in the desktop version).
I applied the requested changes |
@Mankro I have one commit that format the base.html file, so I think you will have to review the changes by commit :) |
There is something I needed to fix!! |
Now is ready 👍🏽 |
Currently, in small devices it is not possible to change the course instance directly from the navbar. This commit add a dropdown menu with the course instances for small devices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work! I will make a new issue about too low contrast in the new notification dropdown of the mobile course menu. Let's merge this now.
Description
In the issue #627 it was reported that the use of the toggle button for mobile devices was breaking the landmarks and logical of the page content. In addition, some other small issues were addressed in this PR.
color
property was changed.Existing
NEW Changes
Fixes #627
Testing
The changes were testes manually.
Have you updated the README or other relevant documentation?
...
Is it Done?
Clean up your git commit history before submitting the pull request!