Skip to content

Conversation

ronjalh
Copy link
Member

@ronjalh ronjalh commented Oct 29, 2026 •

Summary

The Elements page now shows real results from the API, and the search field works. This is the first part of #110 (the page is made to work in parts, in several pull requests): the search and the results. The filters, the sort and "Load more" are still only drawn, and say that they are not connected yet.

Part of #110 (the one issue for making the whole Elements page work, in several pull requests).

Stacked on #114 (the base is 41-elements-page-ui, which has the design). Change the base to dev when #114 is merged, before merging this. The "Files changed" tab only shows this pull request until then.

What is in it

  • searchOperations.ts: the SearchCatalog query (typed by hand, like catalogOperations.ts) and toListRow, which makes a row of the table and the cards from a result: the apparatus and the group from elementGroup, value or dValue, imageUrl, and hasVariants from variants.
  • The results: the first page (first: 20) of searchCatalog through Apollo Client, in the table and in the cards. "Showing X of Y" uses totalCount (the page showed 20 of 562 on the real backend).
  • The search:
    • The text is sent when the user has stopped typing (300 ms), not for each letter. Enter searches at once.
    • The field takes at most 80 characters (the API gives BAD_USER_INPUT for more, and for more than 8 words; the message of the server is shown).
    • The search is in the address (?search=yurchenko, useSearchParams), so a result can be shared. The field follows the address when the user goes back or forward.
    • While a new search is on its way the old results stay (previousData), so the page does not jump.
  • States: loading ("Loading elements…", role="status", aria-busy on the results), error (the message of describeError, with "Try again" when trying again can help) and nothing found ("No elements match “zzz”.", a status a screen reader reads).
  • Example rows: exampleElementRows and src/lib/elementList.ts no longer have the example data. The seven real rows are in src/tests/elementRows.ts, for the tests.
  • Docs: docs/AI_USAGE.md.

Testing

  • npx vitest run: 41 files, 392 tests passed. New: 17 for the page on the real Apollo Client with a stub for fetch (the first request, the fields of the API in each row, loading, empty, error with and without "Try again", the debounce, the address both ways, Enter, the old results that stay, the group number of a vault, the controls), 2 for toListRow.
  • I broke five behaviors one at a time (the search text, the old results, the address, the 80 characters, and following the address); the tests fail without each of them.
  • eslint, tsc -b and npm run build pass.
  • Tried in a browser against the real backend: the first 20 of 562, yurchenko (1 result, the address changes), no result, a search from the address, and 9 words (the message of the server).

Open points

🤖 Generated with Claude Code

@ronjalh ronjalh requested a review from a team as a code owner October 29, 2026 15:26
@ronjalh ronjalh self-assigned this Oct 29, 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