Skip to content

fix articles page sort, filter, search - #5473

Merged
ajrbyers merged 12 commits into
r-v1.9.xfrom
b-5464_fix_olh_articles_sort
Sep 18, 2026
Merged

ajrbyers merged 12 commits into
r-v1.9.xfrom
b-5464_fix_olh_articles_sort

Conversation

@StephDriver

Copy link
Copy Markdown
Member

closes #5464
closes #5471

@StephDriver
StephDriver marked this pull request as ready for review August 25, 2026 13:59
@StephDriver StephDriver assigned mauromsl and unassigned StephDriver Aug 25, 2026
@StephDriver

Copy link
Copy Markdown
Member Author

These changes are all about the articles page.

  • fix a bug in OLH that meant the sort wasn't working.
  • improve accessibility so that page is compatible with keyboard and screen reader
  • improve accessibility (readability) by changing button labels to sort, filter and search instead of a mix of apply and those terms. Nice and clear which one applies which.
  • changes css so that the clear all and apply all buttons in the filter are quieter than the filter itself.
  • tweak css so that the elements within the sort block are neatly aligned (as previously in Clarity, but not great in other themes).

Added two template tags

  • one is for including aria in form fields - this was needed to make the date fields screen reader compatible, but is likely to be useful elsewhere. A template tag is needed because you need to pass in the relevant ID to the relevant field, and hte id may only be known through loops of the calling template, i.e. not static.
  • other is for adding ids that aren't duplicates to elements that otherwise would be duplicated due to the way they are generated (e.g. in a loop). IDs being needed for describedby and labelledby but also needing to be unique on the page for valid HTML.

@mauromsl
mauromsl requested a review from joemull September 3, 2026 07:37
@mauromsl mauromsl assigned joemull and unassigned mauromsl Sep 3, 2026

@joemull joemull left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly looks good. Two questions

Comment thread src/themes/material/assets/mat.css Outdated
.btn-outline:hover,
.btn-outline:focus {
background-color: rgba(0, 0, 0, 0.05);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought we weren't changing this theme any more? Visual changes to the Material theme will interfere with people's custom styling (they often use Material for custom styling) and increase the volume of support queries during the 1.x LTS term

@StephDriver StephDriver Sep 14, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

During the previous 1.9 work I got the focus-visible working across Material. for some reason this part was either missed, or the change lost during a rebase, so this felt like it was simply fixing something already supposed to be complete.

@joemull joemull Sep 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry, I'm not talking about focus-visible styles, I'm talking about the secondary quieter button styles. The visual change there will be something that stands out on the page, won't it? Is it strictly necessary? With this change we'd be effectively introducing a new style of button for a theme that we want to reduce the maintenance burden for, and it might have the opposite effect.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I mostly did that because it looked pretty confusing to me without that change. But I take the point, it's not strictly necessary, more something that was quick while I was there on a page that is unlikely to get more attention any time soon. Having go the rest of it working, the two minutes that required seemed a good use of time to reduce confusion (and the other themes were like that, so not unprecidented. It felt like fixing an oversight.

But I take your point. And I certainly don't think it's worth debating so I've remove that change.

{% with described_by_id=field.auto_id|add:"-label" %}
<div class="form-group">
<label id="{{ described_by_id }}" for="{{ field.auto_id }}">{{ field.label }}</label>
{% field_aria field describedby=described_by_id css_class="form-control" %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is aria needed here? Do we know why VO does not use the standard relationship established by id and for to create the expected behavior?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, this came from actual testing with VO. And then some digging into why it wasn't working, trying of different solutions until I found one that did provide the right information.

@joemull joemull Sep 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Testing it only establishes that it is happening, but have you been able to discover why it does that? Asking why is relevant because manually overriding the relationship between elements with ARIA in this way goes against well-accepted guidance and good practice about how to use HTML and ARIA for accessibility. At the least, it is worth uncovering why so that we can be sure we are not working against a VO feature. At most, we can document the reason in a code comment so that when reading this code in the future, we will not think it is a mistake and remove it.

@StephDriver StephDriver Sep 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is from my browser history when I was investigating this problem.

Collectively from these I concluded:

  1. My test results were not unique - the root cause had been a known problem for some time.
  2. Aria could not be relied upon for Date fields.
  3. a work around to make the field usable with screen readers that didn't rely on the standard "lable for" OR a custom date input field was needed. The workaround was the smaller code-change.

@joemull joemull assigned StephDriver and unassigned joemull Sep 13, 2026
@StephDriver StephDriver assigned joemull and unassigned StephDriver Sep 14, 2026
@joemull joemull assigned StephDriver and unassigned joemull Sep 15, 2026

@joemull joemull left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See comments above (not attached to this review but separate--apologies)

@StephDriver StephDriver removed their assignment Sep 18, 2026
@StephDriver StephDriver assigned ajrbyers and unassigned joemull Sep 18, 2026
@ajrbyers
ajrbyers merged commit 91c7eb9 into r-v1.9.x Sep 18, 2026
4 checks passed
@ajrbyers
ajrbyers deleted the b-5464_fix_olh_articles_sort branch September 18, 2026 12:34
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.

filter date fields not providing labels to screen readers Articles "sort" not working

4 participants