Bug 39356

Summary: Accessibility 1.3.1: There are pages where heading levels are skipped
Product: Koha Reporter: Nina Martinez <nina.martinez>
Component: AccessibilityAssignee: Nina Martinez <nina.martinez>
Status: Pushed to main --- QA Contact: Lucas Gass (lukeg) <lucas>
Severity: enhancement    
Priority: P5 - low CC: andrew.auld, caroline.cyr-la-rose, david, e.betemps, julian.maurice, 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 fixes some accessibility issues on OPAC pages where heading levels are missing or skipped. It adds headings where they are missing, or changes the heading levels in the cases where they were incorrect.
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on:    
Bug Blocks: 23003    
Attachments: Bug39356 : Change heading ranks when ranks are skipped
Bug 39356 - Change heading ranks when ranks are skipped
Bug 39356: Change heading ranks when ranks are skipped
Bug 39356: Change heading ranks when ranks are skipped
Bug 39356: Change heading ranks when ranks are skipped
Bug 39356: Change heading ranks when ranks are skipped

Description Nina Martinez 2025-03-17 11:16:16 UTC
"Skipping heading ranks can be confusing and should be avoided where possible: Make sure that a <h2> is not followed directly by an <h4>, for example. It is ok to skip ranks when closing subsections, for instance, a <h2> beginning a new section, can follow an <h4> as it closes the previous section."

For example : I found in Your summary account page in suspend Hold section a <h1> followed directly by an <h6>. 

https://www.w3.org/WAI/tutorials/page-structure/headings/
Comment 1 Nina Martinez 2025-03-17 11:18:50 UTC Comment hidden (obsolete)
Comment 2 Nina Martinez 2025-03-19 09:19:56 UTC Comment hidden (obsolete)
Comment 3 Nina Martinez 2025-03-19 13:52:37 UTC
Created attachment 179473 [details] [review]
Bug 39356 - Change heading ranks when ranks are skipped

Test plan:

1- Check all headings on the pages (you can use tools like HeadingsMap)
2- Verify that no heading ranks are skipped
3- If it's the case, the test succeeds
Comment 4 Caroline Cyr La Rose 2025-03-31 08:35:10 UTC
I get a sha1 error when trying to apply this patch.

I also noticed there is an extra character in opac-main.tt https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179465&action=diff#a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt_sec1

I would help testing to know which pages we should be looking at. :)
Comment 5 Julian Maurice 2025-03-31 09:16:42 UTC
Created attachment 179928 [details] [review]
Bug 39356: Change heading ranks when ranks are skipped

Test plan:

1- Check all headings on the pages (you can use tools like HeadingsMap)
2- Verify that no heading ranks are skipped
3- If it's the case, the test succeeds

Pages to check:
- opac-main.pl
- opac-curbside-pickups.pl
- opac-memberentry.pl
- opac-recalls.pl
- opac-user.pl
- opac-details.pl (shelf browser, the modal that open after a click on
  "Cite" in the sidebar)
Comment 6 Julian Maurice 2025-03-31 09:18:28 UTC
(In reply to Caroline Cyr La Rose from comment #4)
> I get a sha1 error when trying to apply this patch.
> 
> I also noticed there is an extra character in opac-main.tt
> https://bugs.koha-community.org/bugzilla3/attachment.
> cgi?id=179465&action=diff#a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-
> main.tt_sec1
> 
> I would help testing to know which pages we should be looking at. :)

This was caused by the first patch not being obsoleted, sorry about that!
Submitted new patch with the list of pages to check
Comment 7 Emmanuel Bétemps 2025-03-31 09:33:44 UTC
It's ok with all the pages but one : opac-details.pl

I use the HeadingsMap tool, thanks for the tip !
if I click on a record (to get its details), I just get a 2, without any 1
Comment 8 Nina Martinez 2025-03-31 12:30:49 UTC
(In reply to Emmanuel Bétemps from comment #7)
> It's ok with all the pages but one : opac-details.pl
> 
> I use the HeadingsMap tool, thanks for the tip !
> if I click on a record (to get its details), I just get a 2, without any 1

This is due to the xslt, normally there are a heading 1 for record title on the details page. Maybe we can solve this problem in an other bug ?
Comment 9 Biblibre Sandboxes 2025-03-31 14:40:00 UTC
Created attachment 180063 [details] [review]
Bug 39356: Change heading ranks when ranks are skipped

Test plan:

1- Check all headings on the pages (you can use tools like HeadingsMap)
2- Verify that no heading ranks are skipped
3- If it's the case, the test succeeds

Pages to check:
- opac-main.pl
- opac-curbside-pickups.pl
- opac-memberentry.pl
- opac-recalls.pl
- opac-user.pl
- opac-details.pl (shelf browser, the modal that open after a click on
  "Cite" in the sidebar)

Signed-off-by: Emmanuel <e.betemps@gmail.com>
Comment 10 Andrew Auld 2025-04-01 15:15:51 UTC
For the test plan, it would be useful to include what system preferences need to be turned on to allow access to pages that you need to be tested. Many people will know, but some will not and it is always good to give as much information as possible.
Comment 11 Andrew Auld 2025-04-01 16:34:00 UTC
Also tested and signed off.
Comment 12 Andrew Auld 2025-04-01 16:35:30 UTC
Created attachment 180224 [details] [review]
Bug 39356: Change heading ranks when ranks are skipped

Test plan:

1- Check all headings on the pages (you can use tools like HeadingsMap)
2- Verify that no heading ranks are skipped
3- If it's the case, the test succeeds

Pages to check:
- opac-main.pl
- opac-curbside-pickups.pl
- opac-memberentry.pl
- opac-recalls.pl
- opac-user.pl
- opac-details.pl (shelf browser, the modal that open after a click on
  "Cite" in the sidebar)

Signed-off-by: Emmanuel <e.betemps@gmail.com>
Signed-off-by: Andrew Auld <andrew.auld@openfifth.co.uk>
Comment 13 Lucas Gass (lukeg) 2025-04-02 09:10:11 UTC
Created attachment 180269 [details] [review]
Bug 39356: Change heading ranks when ranks are skipped

Test plan:

1- Check all headings on the pages (you can use tools like HeadingsMap)
2- Verify that no heading ranks are skipped
3- If it's the case, the test succeeds

Pages to check:
- opac-main.pl
- opac-curbside-pickups.pl
- opac-memberentry.pl
- opac-recalls.pl
- opac-user.pl
- opac-details.pl (shelf browser, the modal that open after a click on
  "Cite" in the sidebar)

Signed-off-by: Emmanuel <e.betemps@gmail.com>
Signed-off-by: Andrew Auld <andrew.auld@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 14 Katrin Fischer 2025-04-25 06:49:08 UTC
Pushed for 25.05!

Well done everyone, thank you!