Skip to content

Conversation

ronjalh
Copy link
Member

@ronjalh ronjalh commented Nov 10, 2026

What

Part of the peer feedback (#167): the focus is not moved to the content when going to another page, after "Load more" it ends on the body, and the sort menu seemed to stay open after a choice with the keyboard.

I checked each point first:

  • Going to another page: new FocusOnNavigate in src/App.tsx puts the focus on #main-content (the skip link target) when the path changes. A change of the search, filters or sort is not a new page, and nothing moves on the first load.
  • The sort menu: it already closes after a choice and gives the focus back to its button, which names the new sort ("Sort by Name: A to Z"). No code change; an end-to-end test keeps it so.
  • After "Load more": not done here. "Load more" is being replaced by pagination in feat: replace Load more with pagination on the Elements page #162 (PR feat: implement pagination on Elements page #189), which changes the button and where the focus should go. The focus after a page change belongs in that PR, and this one would only conflict with it.

Checked

  • Unit tests for FocusOnNavigate (it moves after a change of page, not after a change of the search). I broke the code on purpose to see the first one fail.
  • End-to-end: e2e/focus.e2e.ts (2 tests) passes. All frontend tests, tsc, ESLint and Prettier are clean.
  • Not tested with a screen reader.

Refs: #172 (the Load more part is left open, so this does not close it)

🤖 Generated with Claude Code

Add FocusOnNavigate, which puts the focus at the start of the page when the
path changes, as a full page load would. Add end-to-end tests that the sort
menu closes and gives the focus back after a choice with the keyboard, and
for the new focus. Load more is left to the pagination work (#162).

Refs: #172
@ronjalh ronjalh requested a review from a team as a code owner November 10, 2026 20:38
@ronjalh ronjalh self-assigned this Nov 10, 2026
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant