feat(web): polish language switcher UI #1184

Merged
chris merged 1 commit from feature/i18n-switcher-design into main 2026-10-13 06:22:29 +02:00
Owner

Elevates the language switcher in Settings → Account to the app's established single-choice control vocabulary.

What changed

  • Replaced the bare bordered radio rows in the profile Language card with rounded-full pills matching the FilterSortMenu / ProfileTabs single-choice pattern (emerald border + bg-emerald-950/40 selected state, neutral hover states).
  • Selected pill carries a check icon so the current locale is not conveyed by color alone (a11y).
  • Pills are min-h-11 (44px) for comfortable mobile touch targets and wrap on narrow screens.
  • Native <input type="radio"> stays in the DOM (sr-only) so the role="radiogroup" keeps arrow-key navigation and screen-reader semantics; the pill label shows a focus-within ring.
  • Stable data-testids added: language-switcher, language-option-{en,de,da}.

Behavior unchanged

persistLocaleToAccount(value) then setLocale(value) (order preserved); locale switch still reloads the page by design.

Not included

  • No messages/*.json changes — reuses existing languageLabel / languageEnglish / languageDeutsch / languageDansk keys (each label already renders in its own language).
  • No ProfileMenu entry — the dropdown is callback-driven and presentational; a language row would need new wiring through the app shells and would crowd the menu. The settings card stays the primary surface.

Verification

  • npm run check: 0 errors (18 pre-existing warnings in unrelated files)
  • npm run build: success
  • npx playwright test tests/profile-tabs.spec.ts: 8/8 passed (desktop + mobile)
  • Visual check via a temporary mocked-API Playwright capture of the Account tab at desktop and mobile viewports (screenshots inspected, temp spec removed before commit)
Elevates the language switcher in Settings → Account to the app's established single-choice control vocabulary. ## What changed - Replaced the bare bordered radio rows in the profile `Language` card with rounded-full pills matching the FilterSortMenu / ProfileTabs single-choice pattern (emerald border + `bg-emerald-950/40` selected state, neutral hover states). - Selected pill carries a check icon so the current locale is not conveyed by color alone (a11y). - Pills are `min-h-11` (44px) for comfortable mobile touch targets and wrap on narrow screens. - Native `<input type="radio">` stays in the DOM (`sr-only`) so the `role="radiogroup"` keeps arrow-key navigation and screen-reader semantics; the pill label shows a `focus-within` ring. - Stable `data-testid`s added: `language-switcher`, `language-option-{en,de,da}`. ## Behavior unchanged `persistLocaleToAccount(value)` then `setLocale(value)` (order preserved); locale switch still reloads the page by design. ## Not included - No `messages/*.json` changes — reuses existing `languageLabel` / `languageEnglish` / `languageDeutsch` / `languageDansk` keys (each label already renders in its own language). - No ProfileMenu entry — the dropdown is callback-driven and presentational; a language row would need new wiring through the app shells and would crowd the menu. The settings card stays the primary surface. ## Verification - `npm run check`: 0 errors (18 pre-existing warnings in unrelated files) - `npm run build`: success - `npx playwright test tests/profile-tabs.spec.ts`: 8/8 passed (desktop + mobile) - Visual check via a temporary mocked-API Playwright capture of the Account tab at desktop and mobile viewports (screenshots inspected, temp spec removed before commit)
feat(web): polish language switcher UI
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 7m20s
63866df7f0
Replace the bare radio rows in the profile Account tab's language section
with the app's single-choice pill vocabulary (FilterSortMenu pattern):
rounded-full border pills, emerald selected state with a check icon so
selection is not conveyed by color alone, min-h-11 touch targets, and a
visible focus-within ring. Native radios stay in the DOM (sr-only) so
the radiogroup keeps arrow-key navigation and screen-reader semantics.
Behavior is unchanged: persistLocaleToAccount() then setLocale().
chris merged commit 1ebfbf1200 into main 2026-10-13 06:22:29 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1184
No description provided.