Skip to content

Conversation

ronjalh
Copy link
Member

@ronjalh ronjalh commented Nov 6, 2026

Summary

The Gymnast page: the page for one gymnast, reached from a card on "Your gymnasts". It shows one apparatus at a time, with the routines and their D-scores, and the list of elements of the gymnast on that apparatus.

What is in it

  • Route /gymnasts/:gymnastId behind the login check. A visitor who is not logged in is sent to the login page. An unknown or foreign id shows a clear "not found".
  • Apparatus tabs: the shadcn/ui tabs in the "line" look (added with the shadcn CLI, on the Base UI tabs, so arrow keys, Home and End work). Each tab has only the name of the apparatus.
  • The routines of the chosen apparatus, highest D-score first. The highest one is marked with text, not by color alone.
  • The list of elements with a remove button for each element. The accessible name says which element. A confirmation dialog comes first, and a role="status" message tells what happened.
  • Loading, error, empty and not-found states.
  • Each card on "Your gymnasts" links to the page: the name is a link inside the heading, and the link covers the whole card. The delete button stays above it.
  • The "are you sure?" dialog of DeleteGymnastButton is now a shared ConfirmDialog, used by both the delete button and the removal of an element.

Choices

  • One query asks for the gymnast with all routines and elements (the API limits them). The page groups them by apparatus itself, so changing apparatus costs no request.
  • No new colors: the page reuses the existing tokens and components (PageTitle, Button, DifficultyBadge).
  • Two small dark-mode rules in global.css make the value under the difficulty badge readable on the dark card. The badge itself is not changed.

Testing

  • npm run lint, tsc -b and npm run build are clean.
  • npm run test:run: 52 files, 633 tests pass. New tests cover the grouping logic, the page on the real Apollo Client with a stub for fetch, the confirmation dialog, the link from the cards, and the redirect to the login page.
  • Checked by hand with axe-core in light and dark mode, with the keyboard, and at 320 px (see docs/AI_USAGE.md). A screen reader was not used.

Open points

Part of #149

🤖 Generated with Claude Code

Ronja added 6 commits November 6, 2026 11:55
Added with the shadcn CLI (npx shadcn@latest add tabs) and formatted with Prettier. It is built on the Base UI tabs, so it follows the WAI-ARIA tabs pattern.
The dialog of DeleteGymnastButton becomes its own component, so that removing an element from the list can use the same "are you sure?" dialog.
One query asks for the gymnast with all routines and elements. gymnastDetail.ts groups them by apparatus and marks the highest routine, so changing apparatus costs no request.
Route /gymnasts/:gymnastId behind the login check, with a tab for each apparatus, the routines of the chosen apparatus, the list of elements with a remove button for each element, and loading, error, empty and not-found states.

Refs: #149
The name is a link inside the heading, and its ::after covers the whole card. The delete button stays above it.

Refs: #149
@ronjalh ronjalh self-assigned this Nov 6, 2026
Ronja added 3 commits November 6, 2026 17:11
Add New routine and Add from search buttons, a shared TrashButton, ListSection
and StretchedLink, LinkButton (a real link with the pill look) and Button icon.
Errors are in three layers: ErrorMessage, ErrorPanel and ErrorPage.
Fix the layout on phones, the dark hover color and the Highest label.

Refs: #149
The element page follows the theme with readable contrast. Add to gymnast is
a menu for a logged-in coach and a link with a lock otherwise. Try in a
routine uses Button with an icon, and DifficultyBadge is used for vaults.

Refs: #149
@ronjalh ronjalh marked this pull request as ready for review November 6, 2026 16:12
@ronjalh ronjalh requested a review from a team as a code owner November 6, 2026 16:12
Ronja added 2 commits November 6, 2026 17:15
The query, the mutation and add() leave the menu component, so it only
shows the choices. The behaviour and the tests are unchanged.

Refs: #149
… pages

Add docs/STATE_MANAGEMENT.md, a section on the two pages in ACCESSIBILITY.md,
a link in the README, and remove the deleted ElementValueBadge from its table.

Refs: #149
@ronjalh ronjalh mentioned this pull request Nov 7, 2026
54 tasks
Copy link
Member

@xeniag xeniag left a comment

Choose a reason for hiding this comment

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

The build runs, passed all test including axe-core accessibility tests. Looked fine when I ran it locally too, the functionality for adding elements to a gymnast works well. Light and dark mode is ok also.

@xeniag xeniag merged commit dac1159 into dev Nov 9, 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.

2 participants