Skip to content

fix(theme): restore the navigation landmark, the single h1 and the result URL contrast - #3469

Merged
marevol merged 1 commit into
mainfrom
fix/theme-a11y-159
Sep 23, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/theme-a11y-159

Conversation

@marevol

@marevol marevol commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Why

The bootstrap static theme is now the default search UI. Compared with the JSP search pages it regressed on three accessibility points:

  • No navigation landmark. The header <nav> carried role="banner", which replaces its implicit navigation role, so the accessibility tree of the top page had no navigation landmark.
  • Two <h1> on the top page. The visually-hidden page heading and the logo heading (h1.mainLogo) were both exposed.
  • Result URL contrast below WCAG AA. The result URL (#result .site cite) was #009933, 3.75:1 on white. The JSP page used #00852c, 4.78:1.

What changes

  • index.html: drop role="banner" from the header <nav>; the enclosing <header> is the banner.
  • index.html / app.js: the page heading gets id="page-heading", and showView() hides it on the home view, whose logo heading is the page's h1, as on index.jsp. Every other view keeps the page heading as its only h1.
  • styles.css: the result URL uses #00852c.
  • BundledBootstrapThemeTest checks the nav role, the heading id and the cite contrast (the contrast test fails on main); app.test.js checks the heading is hidden on the home view only.

The theme version stays 1.3.0: it was set for 15.9 and has not been released yet.

Verification

  • mvn test -Dtest=BundledBootstrapThemeTest: 127 tests passed.
  • Theme JS tests (src/test/js, npx vitest run): 572 passed.
  • Headless Chromium against a distribution built with this change, OpenSearch 3.8, reading the accessibility tree and computed styles, before (main) → after:
Check Before After
Landmarks, top page banner, main, search, contentinfo banner, navigation, main, search, contentinfo
Landmarks, results page banner, search, main, complementary, navigation (pagination), contentinfo banner, navigation, search, main, complementary, contentinfo
h1 in the accessibility tree, top page 2 (Fess Search ×2) 1
h1, results page 1 1
Result URL colour / contrast #009933, 3.75:1 #00852c, 4.78:1

…sult URL contrast

Three accessibility regressions of the bootstrap static theme against the
JSP search pages:

- The header <nav> carried role="banner", which replaced its navigation
  role, so the page had no navigation landmark. The enclosing <header> is
  already the banner; drop the role.
- The top page had two h1 elements: the visually-hidden page heading and
  the big logo heading. Hide the page heading on the home view, so the
  logo is the page's only h1 as on index.jsp; every other view keeps the
  page heading as its h1.
- The result URL (cite) was #009933, 3.75:1 on white, below the WCAG AA
  4.5:1 minimum. Use #00852c (4.78:1), the colour of the JSP page.

BundledBootstrapThemeTest and app.test.js check all three.
@marevol marevol added this to the 15.9.0 milestone Sep 23, 2026
@marevol marevol self-assigned this Sep 23, 2026
@marevol
marevol merged commit abd71af into main Sep 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant