Skip to content

Heading structure fixes#1802

Merged
osma merged 8 commits intomainfrom
issue1801-heading-structure-fixes
Aug 27, 2025
Merged

Heading structure fixes#1802
osma merged 8 commits intomainfrom
issue1801-heading-structure-fixes

Conversation

@osma
Copy link
Member

@osma osma commented Aug 21, 2025

Reasons for creating this PR

Fix many heading level issues in Skosmos 3, see #1801.

Link to relevant issue(s), if any

Description of the changes in this PR

  • add vocab header (with the vocab name and search fields) to vocab search result page
  • make sure vocab-search and global-search pages have a h1 header: the "XX results for 'YYY'" message is now a h1 element
  • adjust heading levels on vocab-search page to avoid skipping levels: the "Search options" element is now h3 instead of h4
  • always use h2 element for the vocab header; previously it was h1 for the vocab-home page and h2 on other pages, but that causes problems with partial page loads, so keeping it always h2 is simpler (the "Vocabulary information" heading is now the only h1 element on vocab-home pages)
  • add h1 heading "Error" on the error page
  • unrelated: the error page was crashing on URLs like yso/en/page/xxxxx where xxxx is not a valid localname; this PR fixes the crash, although the resulting error page looks a bit funny (see below)
  • change h4 headings to h2 on about page in Swedish and English to avoid skipping levels (in Finnish it was already h2)

Known problems or uncertainties in this PR

I'm not 100% sure that it's a great idea to make the "XX results for 'YYY'" message on search results pages into a h1 level heading. But there is no other obvious heading on the page, unless we want to add a prominent heading like "Search results" to the page.

I fixed a PHP crash on the error page within a vocabulary (e.g. http://localhost/Skosmos/yso/en/page/xxx ), but now the sidebar looks a bit strange, probably due to some CSS issues. Also, there should probably be a vocab header on this page:

kuva

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@osma osma changed the title WIP: Heading structure fixes Heading structure fixes Aug 21, 2025
@osma osma self-assigned this Aug 21, 2025
@osma osma added the bug label Aug 21, 2025
@osma osma moved this to Needs review in Skosmos 3.x Backlog Aug 21, 2025
@osma osma marked this pull request as ready for review August 26, 2025 06:52
@miguelvaara miguelvaara self-requested a review August 26, 2025 07:16
@miguelvaara
Copy link
Contributor

The review is scheduled for the day before the last day of the ongoing psrint, right after the daily

Copy link
Contributor

@miguelvaara miguelvaara left a comment

Choose a reason for hiding this comment

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

Even though I cannot completely forget my earlier impressionss of Skosmos, I try to picture how the site and its pages would come across if someone described them to me just by using the heading levels (what kind of site it is and what the pages include).

A specialist at Celia once told me that a visually impaired person might not necessarily use a site in the "correct" way I described, but that over time assistive tools have shaped very personal habits and ways of navigating.

To avoid this mismatch I stick to my “eyes closed” experience while trusting that the chosen way of presenting the heading levels is valid and relevant. I focus on checking if the haedings work as they should.

Tip! I find HeadingsMap plugin very helpful.

Issue 1:
On http://localhost/skosmos/sv/about
there is a straight jump from level 2 to level 4.

@osma
Looks good in every way but I suggest fixing the above-mentioned issue before merging (it was the only issue I faced). After that, I think it can be merged.

@sonarqubecloud
Copy link

@osma osma added this to the 3.0-beta.1 milestone Aug 27, 2025
@osma osma merged commit f0ad610 into main Aug 27, 2025
12 checks passed
@osma osma deleted the issue1801-heading-structure-fixes branch August 27, 2025 13:23
@github-project-automation github-project-automation bot moved this from Needs review to Issue/PR closed in Skosmos 3.x Backlog Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Heading level structure issues in Skosmos 3

2 participants