Skip to content

Feat/3.5 keyboard navigation#10

Merged
trotro merged 4 commits into
mainfrom
feat/3-5-keyboard-navigation
Mar 15, 2026
Merged

Feat/3.5 keyboard navigation#10
trotro merged 4 commits into
mainfrom
feat/3-5-keyboard-navigation

Conversation

@trotro

@trotro trotro commented Mar 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR implements Story 3.5 – Keyboard Navigation for All Features and includes the follow-up fixes from code review.

The goal is to ensure the main user flows are fully usable with a keyboard, with consistent accessibility semantics across both Zola templates and the standalone comparison page.

Changes

  • templates/base.html

    • Added FR/EN language switcher buttons to the main navigation
    • Exposed active language state with aria-pressed
    • Replaced nested language-switcher <nav> with a grouped control (role="group")
    • Removed redundant role="main" from <main>
  • static/mobile.js

    • Added Escape support to close the mobile filter panel
    • Returns focus to the filter toggle when the panel closes
    • Moves focus to the first filter control when the panel opens
  • static/compare.html

    • Added a skip link
    • Added aria-label to the navigation landmark
    • Added <main id="main-content" tabindex="-1">
    • Loaded lang.js so the language switcher is also available on this page
    • Replaced inline onclick on the share button with an event listener
  • static/lang.js

    • Updated the dynamically injected language switcher to use the same accessibility semantics (role="group", aria-pressed)
  • zola.toml

    • Added the i18n keys needed for language labels

Code Review Follow-ups Included

This PR also addresses the issues raised during review:

  • Replaced aria-current with aria-pressed for language toggle buttons
  • Fixed misleading labels on the active language button
  • Removed the nested navigation landmark
  • Added the language switcher to compare.html
  • Removed inline event handling on the share button

Validation

  • mise run build
  • mise run check
  • mise run a11y

Result: 0 axe-core violations on the 4 checked pages.

BMM Tracking

  • Story file: _bmad-output/implementation-artifacts/3-5-keyboard-navigation-for-all-features.md
  • Sprint status updated: 3-5-keyboard-navigation-for-all-featuresdone

trotro and others added 3 commits March 11, 2026 22:45
- Add FR/EN language switcher buttons to base.html nav (trans() i18n)
- Add Escape key handler and focus management to mobile.js filter panel
- Fix compare.html: skip link, nav aria-label, main landmark, dynamic lang
- Add lang_nav_label, lang_switch_fr, lang_switch_en i18n keys (EN+FR)
- All axe-core checks pass (0 violations on 4 pages)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace aria-current with aria-pressed on language toggle buttons
- Replace nested <nav> language-switcher with <div role=group>
- Update aria-labels to language names (Français/English) + aria-pressed for state
- Remove redundant role=main on <main> element in base.html
- Add lang.js to compare.html for auto-injected language switcher (H2)
- Fix lang.js createLanguageSwitcher to use role=group + aria-pressed
- Replace inline onclick with event listener on share button in compare.html
- Add lang_fr_label + lang_en_label i18n keys to zola.toml (EN+FR)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@trotro trotro changed the title Feat/3 5 keyboard navigation Feat/3.5 keyboard navigation Mar 15, 2026
Comment thread zola.toml Outdated
Co-authored-by: nicolas Trauwaen <trotro@users.noreply.github.com>
@trotro trotro merged commit bc41ec5 into main Mar 15, 2026
6 checks passed
@trotro trotro deleted the feat/3-5-keyboard-navigation branch March 15, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant