-
Notifications
You must be signed in to change notification settings - Fork 30
Fix: Add optional content visual indicator (fix #259) #260
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
base: master
Are you sure you want to change the base?
Conversation
Handle division by zero in progress calculation and add optional content check.
Added a check for division by zero when calculating completion percentage.
Removed comments about optional content and aria labeling.
cahirodoherty-learningpool
left a comment
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.
👀
kirsty-hames
left a comment
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.
Hey @joe-replin, nice additional to the PLP thank you. All works as expected except for 6 , Test with screen reader - verify it announces "Optional" before progress information. Page progress (nav bar) reads as expected but the component doesn't.
When the progress indicators are enabled on components but optional, no label is read. The PLP indicator by default is set to aria-hidden and instead the completion status is handled in core by appending complete/incomplete to the heading instead. However, completion is only appended if _isOptional is false. To avoid introducing a label that is only available to sighted users do we need to update core _isOptional condition to include an "optional" label?
Optional : "optional" label is hidden. No state label appended to heading.

@kirsty-hames I am proposing to add required/optional (a.k.a. priority) labels here. This would allow you to show priority labels globally for different types like menu items, articles, components, etc. Thoughts on this approach? I imagine we would want to remove the "optional" label here from the PLP (just at the component/block/article level) if we did that. |
|
@swashbuck, I'll update this PR to remove the optional label from menu items (conflicts with the core PR). This would leave the optional label in the PLP only. And I will adjust to opt to use the new labeling feature in core. |
|
Apologies, I misread Kirsty's comment and thought the optional label already appeared in the component-level PLP. My comment was not about the nav button PLP. The new core PR adds option/required labels above titles for different types. |
Just to clarify, this is how it looks with both PRs currently (this PR + new labeling feature in core PR):
As you've suggested @joe-replin, I think amending this PR to add the option label to the PLP nav button only makes sense to avoid duplication. Also the core PR optional label isn't dependant on a component title which makes this more flexible. |
|
@kirsty-hames, @swashbuck, @cahirodoherty-learningpool - Given the new Core PR, I'm not sure if placing a label in the PLP button is a need anymore. If this is being shown at the top of a page as well as on top of a menu item, is another label in the PLP a real user need? Even then, it gets complex because I need to script this in a way that says, "Remove the label from all PLP indicators besides the PLP Nav Button." And I'm thinking PLP has no parent models to latch onto like the others. Other reasons:
|
|
If this is being shown at the top of a page as well as on top of a menu item, is another label in the PLP a real user need? Other reasons:
Agreed. I think the core PR now makes any labelling added via this PR redundant. |



Fix
New
Testing
"_isOptional": trueon page content (manually or via diagnostic extension)