Repository navigation
fix(ui): localise the route table's age and make its tooltips keyboard-reachable - #614
Merged
Merged
Conversation
…d-reachable Add web.locale (BCP 47 language, script and region; default en). The Age column formats the relative age with the matching dayjs locale, loaded on demand as its own chunk, falling back to the language and then English, and the tooltip's UTC time with Intl.DateTimeFormat in that locale. The Age and Weight tooltips now sit on a focusable trigger, like the markers from #581, so they open on keyboard focus and stay open on tap. Closes #605
…d table The age tooltip gets its own Intl options (weekday, date, 24-hour time, UTC) instead of the cached-time defaults, and asks for [locale, 'en'] so an unknown locale falls back to English rather than the browser's. The copied table uses the same formatting as the cells. dayjs locale lookup also tries language-region without the script (zh-Hant-TW loads zh-tw), and only a successful load is cached, so a failed chunk is retried. FocusableTooltip gives screen readers the tooltip text as a permanent visually hidden description, since Chakra only sets aria-describedby while the tooltip is open. Refs #605
…load A locale file the bundle doesn't have (MODULE_NOT_FOUND from webpack's context, ERR_MODULE_NOT_FOUND under Node) is permanent: cache English for the tag and warn once per page load. Any other failure, such as a ChunkLoadError, stops the lookup without caching so the next mount retries the same locale. Refs #605
jsenecal
marked this pull request as ready for review
November 25, 2026 21:48
WilhelmZA
approved these changes
Nov 25, 2026
WilhelmZA
left a comment
Collaborator
There was a problem hiding this comment.
Approving at 5de3a704.
Checked the web.locale model, type, fixture, sample and embedded config, the dayjs locale lookup and fallback, the shared formatter in the copy path, and the focusable tooltips. All commits are verified and the CI gate passed.
Two notes, neither blocks the merge:
- With
web.localeset to a language that dayjs has no file for but the browser can format, such aszu, the age is English and the tooltip is in that language. The docs, sample config and CHANGELOG say both are English. zh-Hantwithout a region loads the Simplifiedzhfile for the age.
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.
Closes #605
The route table's Age column was always English. Its tooltip and the Weight tooltip could only be opened with a mouse.
Locale. A new
web.localesetting (defaulten) takes a BCP 47 tag made of a language, an optional script and an optional region, such asfr,pt-BRorzh-Hant-TW. Anything else is rejected at startup: the browser throws on a malformed tag, and the UI loads a file named after it.2 hours) still comes from dayjs, now in the matching dayjs locale.pt-BRloadspt-br,zh-Hant-TWloadszh-tw,de-LUloadsde.MODULE_NOT_FOUNDfrom webpack's context module): it is cached as English and warned about once per page load. Any other failure, such as aChunkLoadError, stops the lookup without caching, so the next mount retries the same locale.Intl.DateTimeFormat([locale, 'en'], ...), so an unknown locale falls back to English, not the browser's language. It uses fixed options: short weekday, date, 24-hour time (hourCycle: 'h23'), in UTC with the zone name. In English it readsTue, Nov 24, 2026, 08:00:00 UTC, againstTue, 24 Nov 2026 08:00:00 UTCbefore: still English, 24-hour and UTC, with the month before the day. The CHANGELOG says so.util/age.ts), so the copied text matches the cells.Tooltips. Age and Weight use a new
FocusableTooltip, following theMarkerpattern from #581: a focusable span with a focus ring andcloseOnClick={false}. It opens on keyboard focus and stays open after a tap.aria-describedbyon its trigger only while the tooltip is open, and clears it while closed. So the text carries its ownaria-describedbypointing at a visually hidden copy of the label, and the tooltip wraps both, with focus and pointer events reaching it by bubbling.outlineshadow. It sits inside the cell's 16px padding, so the table body'soverflow-x: hiddendoesn't clip it.Also updated: the config model, the UI
Configtype, the regenerated UI fixture, the sample config, the docs (web-ui and complete-config) and the CHANGELOG.Tests (Vitest). Time zone pinned with
vi.stubEnv('TZ', ...)to a zone that isn't UTC, and onlyDatefaked. They cover:en-US) keeping the 24-hour clock;[locale, 'en']fallback, thede-LU→defallback, andzh-Hant-TWactually loading thezh-twfile (2 小時);Tests (pytest). The default value, and which tags are accepted and rejected.
I also ran a local
next buildto confirm the locale files land in separate lazy chunks and not in_app.