Skip to content

Conversation

williasc
Copy link
Member

The README said that all click targets are at least 44 × 44 px and that everything shows focus. Focus was fine, but about 15 kinds of links and buttons were smaller: 18 to 41 px tall. Examples are «Utforsk alle viner» and «Nettsiden til …» on the wine page, «Logg inn for å gi din dom», «Lag bruker» under the login form, the «Se …» links and «Tilbake til Min side» on Min side, «Nullstill filtre», and the links on the 404 and no-hits pages.

What changed

  • Those links and buttons are now at least 44 px tall. The text looks the same; only the click area is larger.
  • In «Nylig dømt» on the landing page, the whole card now opens the wine, as the wine cards do. A taller link there pushed the wine type onto its own line on phones.
  • The login box on the wine page has less padding, so it stays about the same size.
  • The README lists the real exceptions: the heart and bookmark on the wine cards (44 × 40 px), each half star (24 × 48 px), and links in running text and the grape links, which WCAG 2.5.8 allows. The e2e count in the test table was out of date and is now 110 (6 skipped).

New test

frontend/e2e/targets.spec.ts goes through search, filters (sidebar and the dialog on mobile), the wine page, the account page, Min side, a list and the 404 page, logged out and logged in, on desktop and mobile. It fails if a click target is smaller than 44 × 44 px (apart from the exceptions above), or if Tab reaches an element without a visible focus mark. The fake API in e2e/support/fakeApi.ts now answers the filter options, so the filter panel is covered too.

Testing

npm run check -- --e2e passes. The new test fails without the CSS changes, and it fails when the focus outline is removed from the links. I also measured every link and button on 36 page states with the full dataset locally, and found no other targets under 44 px.

Closes #117

The README said all click targets are at least 44 × 44 px. About 15 kinds of
standalone links and buttons were 18 to 41 px tall, for example «Utforsk alle
viner», «Logg inn for å gi din dom», «Lag bruker» under the login form, the
«Se …» links on Min side and «Nullstill filtre». They now have a minimum
height of 44 px, with the same text as before.

In «Nylig dømt» on the landing page the whole card now opens the wine, as the
wine cards do, so the wine type stays on the same line on phones. The login
box on the wine page has less padding, so it keeps its size.

New e2e test (e2e/targets.spec.ts) goes through the main pages on desktop and
mobile, logged out and logged in. It fails if a target is under 44 × 44 px or
if Tab reaches an element without a visible focus mark. The fake API now
answers the filter options, so the filters are covered too.

The README lists the real exceptions (card list buttons 44 × 40 px, half
stars 24 × 48 px, links in text and the grape links) and the new e2e count.

Closes #117
@williasc williasc requested a review from a team as a code owner November 25, 2026 21:19
@williasc williasc linked an issue Nov 25, 2026 that may be closed by this pull request
Copy link
Member

@siverne siverne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran targets.spec.ts locally: 4 passed. Approving!

The test measures real targets and tabs through every page, and the exceptions match the README, so the 44 px claim is now backed by a test. Checked RecentReviews.tsx: the card has only one link, so making the whole card the link is safe.

Not blocking:

  • The description has no "AI:" line. #146 uses this PR as its example, so it would be good to add one.
  • The focus check accepts an outline on up to three parents. A parent with a permanent outline could hide a missing focus mark.

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Click targets and focus
2 participants