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

New: Required and optional labels added (Fixes #191) #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion templates/boxMenuItem.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
</div>
{{/if}}

{{#all _globals._accessibility._ariaLabels.optional _globals._accessibility._ariaLabels.required}}
<div class='menu-item__priority boxmenu-item__priority' aria-hidden="true">
Copy link
Member

@oliverfoster oliverfoster May 3, 2024

Choose a reason for hiding this comment

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

aria-hidden="true" is not something that should be used to avoid visible text reading in the wrong place. aria-hidden is more for hiding things which should not be read because they are in the background or are not part of the readable content, like icons, backgrounds, structural stuff, the content underneath popups etc.

These are the places we currently use aria-hidden:
https://github.com/search?q=org%3Aadaptlearning%20aria-hidden&type=code

You have to remember that screen readers are not primarily for people who cannot see, but for anyone who needs help reading. Partially sighted people might see various grades of text shapes and outlines, here there will be a clearly important word that is not being read and for no explicit reason.

It would be better to remove the aria-hidden here and have it read twice.

Copy link
Member

@oliverfoster oliverfoster May 3, 2024

Choose a reason for hiding this comment

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

Could you take a screenshot of what this looks like in the boxmenu item and include in the pr description? There's no styling included in the pr, so it would be nice to see what it looks like.

If this were merged and updated it would show on all boxmenu items on all old and new courses. There's no way way to turn this display on/off without removing the _globals required and optional text for the entire course - which probably isn't a good idea as they'll be needed elsewhere I'm sure. Suggest adding a flag, probably at the menu level, to hide/show required/optional on all items?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to tac on to this, we do use aria-hidden to hide furniture added by css pseudo elements even though it's permissible - that is an Adapt decision I think. But agree, we shouldn't be using this for text.

This defiantly needs some kind of switch to turn the labels on, as @oliverfoster says, we don't want these appearing randomly in other courses. We just need to be mindful of this when adding in new functionally in general. @oliverfoster suggestion seems like a good one to me. Although it might need some more thought, not sure.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<div class='menu-item__priority boxmenu-item__priority' aria-hidden="true">
<div class='menu-item__priority boxmenu-item__priority'>

<span class="label">
{{#if _isOptional}}{{{_globals._accessibility._ariaLabels.optional}}}{{else}}{{{_globals._accessibility._ariaLabels.required}}}{{/if}}
</span>
</div>
{{/all}}

{{#if duration}}
<div class="menu-item__duration boxmenu-item__duration">
<div class="menu-item__duration-inner boxmenu-item__duration-inner">
Expand All @@ -40,7 +48,7 @@
</div>

<div class="menu-item__button-container boxmenu-item__button-container">
<button class="btn-text menu-item__button boxmenu-item__button js-btn-click{{#if _isVisited}} is-visited{{/if}}{{#if _isLocked}} is-locked{{/if}}" aria-label="{{#if _isComplete}}{{_globals._accessibility._ariaLabels.complete}}. {{else _isVisited}}{{_globals._accessibility._ariaLabels.visited}}. {{/if}}{{#if _isLocked}}{{_globals._accessibility._ariaLabels.locked}}. {{else}}{{linkText}} {{/if}}{{title}}. {{{compile _globals._menu._boxMenu.itemCount}}}.{{#if _isOptional}} {{_globals._accessibility._ariaLabels.optional}}{{/if}}"{{#if _isLocked}} aria-disabled="true"{{/if}} role="link">
<button class="btn-text menu-item__button boxmenu-item__button js-btn-click{{#if _isVisited}} is-visited{{/if}}{{#if _isLocked}} is-locked{{/if}}" aria-label="{{#if _isComplete}}{{_globals._accessibility._ariaLabels.complete}}. {{else _isVisited}}{{_globals._accessibility._ariaLabels.visited}}. {{/if}}{{#if _isLocked}}{{_globals._accessibility._ariaLabels.locked}}. {{else}}{{linkText}} {{/if}}{{title}}. {{{compile _globals._menu._boxMenu.itemCount}}}.{{#if _isOptional}} {{_globals._accessibility._ariaLabels.optional}}{{else}} {{_globals._accessibility._ariaLabels.required}}{{/if}}"{{#if _isLocked}} aria-disabled="true"{{/if}} role="link">
Copy link
Member

@oliverfoster oliverfoster May 3, 2024

Choose a reason for hiding this comment

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

Is there a rationale for this? Just an issue that says "I'm intending to add required and optional text to X places for these reasons?".

This issue is the nearest adaptlearning/adapt-contrib-core#520, but there are no designs on how it will look and where it will be placed. Currently optional articles, blocks and components don't display as such except when included in the plp by saying "optional content". Could you supply a bit more of the thought please? Perhaps in an encompassing issue in adapt_framework?

I like this work. It's a bit like the completion indicators we've been slowly but collectively adding throughout. It sets up nice uniform UX for the learners.

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, we do need a discussion around what happens with optional content thoughtout the course and in the PLP in different situations. I'll try and raise a succinct separate issue for this and add a link in here. That should help answer the questions raised by @oliverfoster

{{{linkText}}}
</button>

Expand Down
Loading