Bug 39492

Summary: Add missing aria label on the OPAC holdings table browse shelf link
Product: Koha Reporter: Alexander Blanchard <alexander.blanchard>
Component: AccessibilityAssignee: Alexander Blanchard <alexander.blanchard>
Status: Pushed to main --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: david, lucas, martin.renvoize, matt.blenkinsop, oleonard
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
This enhancement adds an aria label to the browse shelf link in the OPAC holdings table. This provides more information about what the link does for those using assistive technology, such as screen readers.
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 39492: Browse Shelf Links on 'Publications' Pg
Bug 39492: Browse Shelf Links on 'Publications' Pg
Bug 39492: Browse Shelf Links on Publications Pg
Bug 39492: Browse Shelf Links on Publications Pg
Bug 39492: Accessibility - add aria label to the OPAC browse shelf link
Bug 39492: (follow-up) Add missing HTML filters
Bug 39492: Accessibility - add aria label to the OPAC browse shelf link
Bug 39492: (follow-up) Add missing HTML filters
Bug 39492: (QA follow-up) Update wording with suggested text

Description Alexander Blanchard 2025-03-31 11:45:51 UTC
The accessibility audit highlighted that on the accessibility page there are repeated 'Browse Shelf' links. The report indicates that these need additional context to be clear without relying on surrounding context. 

The suggested solution is to add extra context using aria-label or aria-labelledby
Comment 1 Alexander Blanchard 2025-04-02 14:58:58 UTC
Created attachment 180412 [details] [review]
Bug 39492: Browse Shelf Links on 'Publications' Pg

An accessibility audit has highlighted that the Browse Shelf link on the Publicaitons page does not provide enough context for visually impaired users. The suggested solution was to add aria-labels to provide context.

To test:
1) Ensure that you have at least one item with a call number.
2) Navigate to the item's page and scroll down to the table.
3) Right click and choose inspect on the 'Browse Shelf' link and note that there is not an aria label.
4) Apply patch.
5) Repeat the steps above.
6) Notice that there is an aria-label that adds context to the Browse Shelf link by including the title of the record.
Comment 2 Laura Escamilla 2025-04-03 13:24:40 UTC
Created attachment 180524 [details] [review]
Bug 39492: Browse Shelf Links on 'Publications' Pg

An accessibility audit has highlighted that the Browse Shelf link on the Publicaitons page does not provide enough context for visually impaired users. The suggested solution was to add aria-labels to provide context.

To test:
1) Ensure that you have at least one item with a call number.
2) Navigate to the item's page and scroll down to the table.
3) Right click and choose inspect on the 'Browse Shelf' link and note that there is not an aria label.
4) Apply patch.
5) Repeat the steps above.
6) Notice that there is an aria-label that adds context to the Browse Shelf link by including the title of the record.

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Comment 3 Lucas Gass (lukeg) 2025-04-18 15:29:40 UTC
Hey Alexander, 

-A couple minor issues here. It looks like some how a `???` got added to the Browse shelf link. 
-Fliters are missing here:

-                                            aria-label="Browse Shelf for [% title %]"
+                                            aria-label="Browse Shelf for [% title | html %]"
Comment 4 Alexander Blanchard 2025-04-25 10:40:49 UTC
Created attachment 181501 [details] [review]
Bug 39492: Browse Shelf Links on Publications Pg

An accessibility audit has highlighted that the Browse Shelf link on the Publicaitons page does not provide enough context for visually impaired users. The suggested solution was to add aria-labels to provide context.
This follow up patch addresses the missing html filter.

To test:
1) Ensure that you have at least one item with a call number.
2) Navigate to the item's page and scroll down to the table.
3) Right click and choose inspect on the 'Browse Shelf' link and note that there is not an aria label.
4) Apply patch.
5) Repeat the steps above.
6) Notice that there is an aria-label that adds context to the Browse Shelf link by including the title of the record.
Comment 5 Alexander Blanchard 2025-04-25 10:45:23 UTC
Created attachment 181502 [details] [review]
Bug 39492: Browse Shelf Links on Publications Pg

An accessibility audit has highlighted that the Browse Shelf link on the Publicaitons page does not provide enough context for visually impaired users. The suggested solution was to add aria-labels to provide context.
This follow up patch addresses the missing html filter.

To test:
1) Ensure that you have at least one item with a call number.
2) Navigate to the item's page and scroll down to the table.
3) Right click and choose inspect on the 'Browse Shelf' link and note that there is not an aria label.
4) Apply patch.
5) Repeat the steps above.
6) Notice that there is an aria-label that adds context to the Browse Shelf link by including the title of the record.
Comment 6 Alexander Blanchard 2025-04-25 10:48:04 UTC
(In reply to Lucas Gass (lukeg) from comment #3)
> Hey Alexander, 
> 
> -A couple minor issues here. It looks like some how a `???` got added to the
> Browse shelf link. 
> -Fliters are missing here:
> 
> -                                            aria-label="Browse Shelf for [%
> title %]"
> +                                            aria-label="Browse Shelf for [%
> title | html %]"

Thanks Lucas, addressed these issues and resubmitted.
Comment 7 David Nind 2025-04-27 20:37:21 UTC
Created attachment 181572 [details] [review]
Bug 39492: Accessibility - add aria label to the OPAC browse shelf link

An accessibility audit highlighted that the browse shelf link on a
record's holding page does not provide enough context for visually
impaired users. The suggested solution was to add aria labels to provide
context.

Test plan:
1. Ensure that you have at least one item with a call number.
2. Navigate to the records's page and scroll down to the holdings table.
3. Right click and choose inspect on the 'Browse shelf' link and note
   that there is not an aria label.
4. Apply the patch.
5. Refresh the page and repeat step 3.
6. Note that there is now an aria label that adds context to the browse shelf
   link - it now includes the title of the record, for example:
   ...aria-label="Browse Shelf for Programming Perl /"...

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2025-04-27 20:37:24 UTC
Created attachment 181573 [details] [review]
Bug 39492: (follow-up) Add missing HTML filters

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2025-04-27 20:46:08 UTC
I've amended the commit messages to be a bit more in line with the commit message guidelines (https://wiki.koha-community.org/wiki/Commit_messages) - particularly for the follow-up patch, as there is no need to repeat what is in the other patches.

I confess to not fully understanding aria labels, however would better wording for the aria label be "Browse the shelf for items near XXXXX"? (Where XXXXX is the title for the item.)

To me, that would give more context to what the link does.
Comment 10 Martin Renvoize (ashimema) 2025-05-13 19:47:28 UTC
*** Bug 39471 has been marked as a duplicate of this bug. ***
Comment 11 Martin Renvoize (ashimema) 2025-05-13 19:49:04 UTC
(In reply to David Nind from comment #9)
> I've amended the commit messages to be a bit more in line with the commit
> message guidelines (https://wiki.koha-community.org/wiki/Commit_messages) -
> particularly for the follow-up patch, as there is no need to repeat what is
> in the other patches.
> 
> I confess to not fully understanding aria labels, however would better
> wording for the aria label be "Browse the shelf for items near XXXXX"?
> (Where XXXXX is the title for the item.)
> 
> To me, that would give more context to what the link does.

I like this suggestion
Comment 12 Martin Renvoize (ashimema) 2025-05-13 19:52:57 UTC
Created attachment 182414 [details] [review]
Bug 39492: Accessibility - add aria label to the OPAC browse shelf link

An accessibility audit highlighted that the browse shelf link on a
record's holding page does not provide enough context for visually
impaired users. The suggested solution was to add aria labels to provide
context.

Test plan:
1. Ensure that you have at least one item with a call number.
2. Navigate to the records's page and scroll down to the holdings table.
3. Right click and choose inspect on the 'Browse shelf' link and note
   that there is not an aria label.
4. Apply the patch.
5. Refresh the page and repeat step 3.
6. Note that there is now an aria label that adds context to the browse shelf
   link - it now includes the title of the record, for example:
   ...aria-label="Browse Shelf for Programming Perl /"...

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 13 Martin Renvoize (ashimema) 2025-05-13 19:53:00 UTC
Created attachment 182415 [details] [review]
Bug 39492: (follow-up) Add missing HTML filters

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 14 Martin Renvoize (ashimema) 2025-05-13 19:53:03 UTC
Created attachment 182416 [details] [review]
Bug 39492: (QA follow-up) Update wording with suggested text

This patch updates the wording for the aria-label to that suggested by
David. It clarifies context.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 15 Martin Renvoize (ashimema) 2025-05-13 19:54:13 UTC
Lots of eyes, including QA people... QA scripts passing, accessibility tools passing.

Passing QA
Comment 16 Katrin Fischer 2025-05-15 05:57:40 UTC
Shortened the bug title a little as it will appear in the "accessibility" section on the release notes - thanks for taking care! :)
Comment 17 Katrin Fischer 2025-05-15 06:00:57 UTC
Fixing this author line in the first patch to read "Alexander Blanchard", especially since we have a mailmap for mapping john.doe to Kyle, which would be wrong here:

From: John Doe <you@example.com>
Comment 18 Katrin Fischer 2025-05-15 06:35:51 UTC
Pushed for 25.05!

Well done everyone, thank you!