Repository navigation
fix(ui): name the table page buttons and move the AS path text to web.text - #544
Merged
Merged
Conversation
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
force-pushed
the
fix/541-a11y-text
branch
from
November 21, 2026 05:50
0c7cfa8 to
cdff6b7
Compare
WilhelmZA
approved these changes
Nov 21, 2026
WilhelmZA
left a comment
Collaborator
There was a problem hiding this comment.
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.mdis not edited. Please add them under[Unreleased], here or in the release PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
components/table/button.tsx:TableIconButtonsetaria-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.tsxinlogo_onlymode: the home button's only content is the logo. The logo<img>hasalt={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'sImagerenders itsfallbackskeleton 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
TableIconButtonnow takesIconButtonPropsas is, soaria-labelis required and the caller's label is the one used.Tablenames the four page buttons from newweb.textfields.New
web.textfields, defaults equal to the previous English where there was any:as_path_titlePath to {target}zoom_inZoom Inzoom_outZoom Outfit_nodesFit Nodesfirst_pageFirst Pageprevious_pagePrevious Pagenext_pageNext Pagelast_pageLast Pageas_path_titleis formatted in the UI withuseStrf, the same way ascomplete_timeandcache_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 getsrole="img"andaria-label={web.text.title}, the logo's own text alternative. This uses existing configuration rather than a new field, and also coverslogo_subtitleandallmodes, where the logo is part of the button's name.Textmodel,types/config.ts,.samples/sample_config.yaml, the sample and table incomplete-config.mdx, and theweb.texttable inweb-ui.mdxlist 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 givenaria-labelnames the button),path/controls.test.tsx(each control by role and name; configured text),path/path.test.tsx(modal namedPath to 192.0.2.0/24,Path to 2001:db8::/32, and a configuredChemin vers {target}with an IPv6 target; the chart is mocked because React Flow needsResizeObserver),header/title.test.tsx(button named while the logo loads, named by the<img>alt once it loads, configured title). Backend:test_web_config.pychecks the defaults and the camelCase export.With #534's components and the new tests, 8 tests fail:
With the fix:
biome format,biome lintandtsc --noEmitclean;Test Files 31 passed (31),Tests 226 passed (226).4150 passed, 4 skipped;ruff check .clean.Mutation checks, each applied alone with the tests kept: restoring the fixed label in
TableIconButtonfails 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
web.text(as_path_title,zoom_in,zoom_out,fit_nodes,first_page,previous_page,next_page,last_page) (Table pagination buttons share one accessible name, and the AS path modal text is hard-coded #541).logo_onlymode while the logo loads or if it fails to load (Table pagination buttons share one accessible name, and the AS path modal text is hard-coded #541).Notes
Found in the same files, not changed here:
components/table/page-select.tsx: the page size<select>has no label, and its options readShow {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:ModalCloseButtonuses 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