Skip to content
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

Merged
merged 4 commits into from
Nov 19, 2020
Merged

Conversation

jaguarfi
Copy link
Contributor

@jaguarfi jaguarfi commented Nov 2, 2020

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.

  • The button "skip navigation" of the left side course menu was present in small devices and it was overlapping other elements inside the toggle menu. Therefore, that specific "skip navigation" link was removed in small devices. It is not necessary to have a "skip navigation" button inside the toggle menu.
  • The tab navigation order of the navbar elements in mobile devices was in the wrong order. Therefore, the elements were arranged to follow a logical flow from left to right.
  • The focus styles were not applied to the toggle button. Therefore, the styles were applied to the toggle button. One for keyboard navigation and other for the click/touch interaction.
  • The contrast of the links located inside the toggle menu was low. Therefore, the color property was changed.
  • The brand button was not interactive in small devices. Therefore, the brand button interaction was added to small devices.

Existing

old_navigation

NEW Changes

new_navigation

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!

  • I (developer) have created unit tests and the tests pass
  • I (developer) have created functional tests (Selenium tests) if applicable
  • I (developer) have tested the changes manually
  • Reviewer has finished the code review
  • After the review, the developer has made changes accordingly
  • Customer/Teacher has accepted the implementation of the feature

Copy link
Contributor

@markkuriekkinen markkuriekkinen left a 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">
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?
image
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

Copy link
Contributor

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.

@@ -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>
Copy link
Contributor

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?

Copy link
Contributor Author

@jaguarfi jaguarfi Nov 9, 2020

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.

<a class="navbar-brand hidden-xs" href="{% url 'home' %}">{% brand_name %}</a>
<span class="navbar-brand visible-xs">
{% brand_name %}{% if instance %} &nbsp; {{ course.name|parse_localization }}{% endif %}
</span>
</div>
<div class="collapse navbar-collapse" id="bs-navbar-collapse">
<ul class="nav navbar-nav hidden-xs">
Copy link
Contributor

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?

Copy link
Contributor Author

@jaguarfi jaguarfi Nov 9, 2020

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about this?

image

Or we can keep the dropdown menu next to the brand icon just as in the desktop version.
image
@Mankro which one do you like more?

Copy link
Contributor

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).

@jaguarfi
Copy link
Contributor Author

I applied the requested changes

@jaguarfi
Copy link
Contributor Author

@Mankro I have one commit that format the base.html file, so I think you will have to review the changes by commit :)

@jaguarfi jaguarfi marked this pull request as draft November 13, 2020 14:53
@jaguarfi
Copy link
Contributor Author

jaguarfi commented Nov 13, 2020

There is something I needed to fix!!

@jaguarfi jaguarfi marked this pull request as ready for review November 13, 2020 15:36
@jaguarfi
Copy link
Contributor Author

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.
Copy link
Contributor

@markkuriekkinen markkuriekkinen left a 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.

@markkuriekkinen
Copy link
Contributor

@jaguarfi new small issue about low contrast: #723

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.

Mobile course navigation elements are inside the main navigation
2 participants