Skip to content

fix(ui): name the table page buttons and move the AS path text to web.text - #544

Merged
jsenecal merged 2 commits into
mainfrom
fix/541-a11y-text
Nov 21, 2026
Merged

jsenecal merged 2 commits into
mainfrom
fix/541-a11y-text

Conversation

@jsenecal

@jsenecal jsenecal commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

  • components/table/button.tsx: TableIconButton set aria-label="Table Icon Button" after {...props}, so the first, previous, next and last page buttons under every result table all had that one name, and a caller could not override it.
  • components/path/path.tsx: the AS path modal heading was the hard-coded template `Path to ${displayTarget}`.
  • components/path/controls.tsx: the chart's "Zoom In", "Zoom Out" and "Fit Nodes" button names were hard-coded English.
  • components/header/title.tsx in logo_only mode: the home button's only content is the logo. The logo <img> has alt={web.text.title}, so the button is named once the image loads. Until then, or if both the configured logo and the fallback logo fail to load, Chakra's Image renders its fallback skeleton instead, which had no text alternative, so the button had no accessible name. jsdom never loads images, so a test sees this state every time.

Change

  • TableIconButton now takes IconButtonProps as is, so aria-label is required and the caller's label is the one used. Table names the four page buttons from new web.text fields.

  • New web.text fields, defaults equal to the previous English where there was any:

    Field Default
    as_path_title Path to {target}
    zoom_in Zoom In
    zoom_out Zoom Out
    fit_nodes Fit Nodes
    first_page First Page
    previous_page Previous Page
    next_page Next Page
    last_page Last Page

    as_path_title is formatted in the UI with useStrf, the same way as complete_time and cache_icon; {target} is the query target as displayed in the form. Like those fields, the model does not validate the placeholder; a title without {target} is shown as written.

  • The page buttons keep no tooltip, and the zoom controls still have none, as before; only their names change. The chevron icons are a common convention, and a tooltip would open on every hover over the table footer.

  • components/header/logo.tsx: the skeleton that stands in for the logo gets role="img" and aria-label={web.text.title}, the logo's own text alternative. This uses existing configuration rather than a new field, and also covers logo_subtitle and all modes, where the logo is part of the button's name.

  • Text model, types/config.ts, .samples/sample_config.yaml, the sample and table in complete-config.mdx, and the web.text table in web-ui.mdx list the new fields. The UI test fixture is regenerated with .tests/ui-fixture/generate.py.

Tests

New: table/main.test.tsx (each page button by role and name, in order; each button moves to the page it is named for; configured text), table/button.test.tsx (a given aria-label names the button), path/controls.test.tsx (each control by role and name; configured text), path/path.test.tsx (modal named Path to 192.0.2.0/24, Path to 2001:db8::/32, and a configured Chemin vers {target} with an IPv6 target; the chart is mocked because React Flow needs ResizeObserver), header/title.test.tsx (button named while the logo loads, named by the <img> alt once it loads, configured title). Backend: test_web_config.py checks the defaults and the camelCase export.

With #534's components and the new tests, 8 tests fail:

 FAIL  components/header/title.test.tsx > Title > names the logo-only button while the logo loads
 FAIL  components/header/title.test.tsx > Title > uses the configured title
 FAIL  components/path/controls.test.tsx > Controls > uses the configured text
 FAIL  components/path/path.test.tsx > Path > uses the configured text
 FAIL  components/table/button.test.tsx > TableIconButton > is named by the aria-label it is given
 FAIL  components/table/main.test.tsx > Table pagination > moves to the page each button is named for
 FAIL  components/table/main.test.tsx > Table pagination > names each page button from web.text
 FAIL  components/table/main.test.tsx > Table pagination > uses the configured text
      Tests  8 failed | 9 passed (17)

With the fix:

  • Frontend: biome format, biome lint and tsc --noEmit clean; Test Files 31 passed (31), Tests 226 passed (226).
  • Backend: 4150 passed, 4 skipped; ruff check . clean.

Mutation checks, each applied alone with the tests kept: restoring the fixed label in TableIconButton fails 4 tests; dropping any one of the four page button labels fails 3; swapping the next and previous labels fails 2; restoring the hard-coded modal heading fails 1; hard-coding any one of the three zoom labels fails 1; removing the skeleton's label fails 2.

Changelog

Notes

Found in the same files, not changed here:

  • components/table/page-select.tsx: the page size <select> has no label, and its options read Show {n}, hard-coded English. It is hidden on mobile.
  • components/table/main.tsx: the "Page n of m" text is hard-coded English.
  • components/path/path.tsx: ModalCloseButton uses Chakra's built-in English name "Close".
  • components/header/title.tsx: the home button sets _focus={{ boxShadow: 'none' }}, so it shows no focus indicator when reached with Tab.

Closes #541

@jsenecal jsenecal added bug Confirmed bug or unexpected behavior frontend Next.js UI and the runtime UI build labels Nov 21, 2026
@jsenecal jsenecal self-assigned this Nov 21, 2026
@jsenecal
jsenecal requested a review from WilhelmZA November 21, 2026 05:24
@github-actions github-actions Bot added docs Improve documentation backend Python backend: API, models, state, execution labels Nov 21, 2026
@coveralls

coveralls commented Nov 21, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 85.559% (+0.2%) from 85.367% — fix/541-a11y-text into main

In the logo_only title mode the home button's only content is the logo.
The logo image is named by web.text.title, but until it loads, or if it
and the fallback logo both fail to, Chakra renders a skeleton in its
place, which had no text alternative. The button then had no accessible
name.

Give the skeleton role="img" and the same web.text.title label as the
image it stands in for. This also covers the logo_subtitle and all
modes, where the logo is part of the button's name.
….text

TableIconButton set aria-label="Table Icon Button" after spreading its
props, so the first, previous, next and last page buttons all had that
one name. It now requires an aria-label from its caller, and the table
names the four buttons from the new web.text fields first_page,
previous_page, next_page and last_page.

The AS path modal heading "Path to <target>" and the chart's "Zoom In",
"Zoom Out" and "Fit Nodes" button names were hard-coded English. They
move into web.text as as_path_title (with a {target} placeholder,
formatted in the UI like complete_time), zoom_in, zoom_out and
fit_nodes, with the previous English as defaults.

The new fields are documented with the other web.text fields, and the
UI test fixture is regenerated.
@jsenecal
jsenecal changed the base branch from fix/533-icon-button-names to main November 21, 2026 05:50

@WilhelmZA WilhelmZA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving at cdff6b7f.

I read the table, path and header changes and the new web.text fields. TableIconButton has one caller and all four call sites now pass an aria-label. The new fields have defaults, so existing configuration files still validate, and the target is passed to the heading as a format value and rendered as text. CI gate passes and both commits are verified.

#564 adds web.text fields in the same model block, docs tables and UI fixture, and #565 removes the form store from path.tsx, which this PR reads for the heading. The second one to merge has to resolve those and regenerate the fixture.

Nits:

  • The body has a Changelog section with two entries but CHANGELOG.md is not edited. Please add them under [Unreleased], here or in the release PR.

@WilhelmZA WilhelmZA added the reviewing Issue is being reviewed by maintainers label Nov 21, 2026
@jsenecal
jsenecal merged commit abc5d0d into main Nov 21, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Python backend: API, models, state, execution bug Confirmed bug or unexpected behavior docs Improve documentation frontend Next.js UI and the runtime UI build reviewing Issue is being reviewed by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table pagination buttons share one accessible name, and the AS path modal text is hard-coded

3 participants