-
Notifications
You must be signed in to change notification settings - Fork 0
feat: build the Elements page: the design, the search, the results and Load more #114
Conversation
# Conflicts: # src/App.tsx
…k theme to the Elements page
# Conflicts: # src/App.test.tsx # vite.config.ts
…badge in dark mode
…or for the hovered row
… readable on hover in dark mode
# Conflicts: # docs/AI_USAGE.md
… with More variants below them
…p the dark badge colors off it
…nd make More variants as tall as the label pills
…hen there is room, and separate apparatus and group columns in the table
…columns when there is room, and vault groups by number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, Ronja!
Just some minor accessibility issues that could be addressed:
High — Correct the mobile value heading (WCAG 1.3.1, Info and Relationships).
The heading always says “D-value,” including rows for non-vault elements that show a difficulty letter and value. Please use a heading that accurately describes both types, or provide a row-specific accessible label.
ResultsTable.tsx
Medium — Clarify the element-group label (WCAG 1.3.1, Info and Relationships).
The group name shares a table cell with the apparatus, and its “Group” label is hidden from screen readers on mobile. Please expose a clear “Element group” label and associate it with the value in both layouts.
ResultsTable.tsx · LabelBadge.tsx
|
D-value does accurately describe both as we discussed previously as a team. |
|
I mean, for consistency I can change it to value but on each element it is labelled as d-value so probably should be unified at some point |
…n everything is shown
…ments-page-ui # Conflicts: # docs/AI_USAGE.md
Yeah, but it says value on laptop screens, but D-value only on mobile. Shouldn't it be consistent? |
|
Regarding Value/D-value: commit acb278d made the list consistent (mobile and laptop both say "Value"), but the site still uses three names for the same thing: the filter says "Difficulty", the list says "Value", and the element page says "Difficulty" for an element and "D-value" for a vault. I think it should be the same everywhere. It is confusing and easy to mix them up, but the term that describes all of them is "Difficulty": an element has a difficulty letter and value, and a vault has a D-value, which is its difficulty. As far as I remember, we decided on this wording when we reviewed the design, and agreed on using "Difficulty" and not D-value (which do not accurately describe both). The change is small (the table heading and the card label in the list, and the vault label in |
Summary
The Elements page (the search page, the start page of the site): the design from
elements_page.png, and the page connected to the API with the search, the results and "Load more elements". The count of a search stops at 1001, so the page says "1000+" for more than 1000 results.This is one pull request for the one issue, #110 (it replaces #118, #120 and #121, which were stacked on this one or on
dev). The filters and the sort are the rest of #110: they are drawn, and say that they are not connected yet.Part of #110.
What is in it
The design
#rootis not 1126 px any more) and the colors are tokens with a light and a dark value (variables.css). Dark mode comes from the color inspiration, and light mode is as in the design except that every other row is a tint of the blue accent instead of the purple.elementGroup.number) and an element by the name of its group. Nothing in the database is changed. For 4 of the 87 vaults thedescriptionis only the name of the vault ("Yamashita"); there is no other field, so the page shows what the data has.outline-solidis set), the button text keeps its color on hover (theButtonturns it to--foreground, which is white in dark mode), the X in the search field has the color of the icon, and the table and the cards are shown one at a time (display: none), so a screen reader reads each result once./elements.The API
first: 20) ofsearchCatalogthrough Apollo Client (searchOperations.ts, typed by hand), in the table and in the cards. "Showing X of Y" usestotalCount.?search=yurchenko), so a result can be shared, and the field follows the address when the user goes back or forward. The old results stay while a new search is on its way.role="status",aria-busy), error with "Try again" (describeError), and nothing found ("No elements match “zzz”.").SearchCatalogMore, which does not ask fortotalCountagain), and the cache adds it to the list (cache.ts). The button is disabled while the page is loading ("Loading more…",aria-busy) and when everything is shown ("Showing N of N"); the count describes why (aria-describedby). An error is shown with the results kept, and the button is pressed again to try again. A new search starts from the first page.totalCountis above 1000 (formatTotal). The server stops counting at 1001:countwithtakeinbackend/src/catalog/search.ts(MAX_TOTAL_COUNTis 1000), the schema is the same, and a value above 1000 means "more than 1000" (docs/API.md). The catalog has 562 entries, so the real page shows the number today.src/tests/elementRows.ts).Where it differs from the design
PILLinElementsPage.tsx). In dark mode the search field has a tan line.Testing
npx vitest run: 41 files, 408 tests passed (the frontend on the real Apollo Client with a stub forfetch, and the backend search against the database). New for the page: the table, the cards, the badge, 24 for the page (the first request, the fields of the API, loading, empty, error, the debounce, the address both ways, Enter, the old results, "Load more" with its states, 1000+), the mapping of a result, and 5 for the count cap.eslint,tsc -bandnpm run buildpass.yurchenko(1 result, the button is disabled at once),handspring(two pages, 36 of 36, the button is disabled), no result, a search from the address and 9 words (the message of the server). The layout was checked in an emulated phone at 320, 360, 390, 600, 700, 844 (landscape), 768 and 1024 px (no sideways scroll), in light and dark mode. Not tried with a screen reader.Open points
totalCount(the exact number) shows 1001 for a search with more than 1000 matches. The Elements page is the only client, and it is changed here.🤖 Generated with Claude Code