Skip to content

Show every media facet the API sends, not a hard-coded five - #48

Merged
mykolamelnykml merged 1 commit into
mainfrom
catalog-facets-from-api
Oct 8, 2026
Merged

mykolamelnykml merged 1 commit into
mainfrom
catalog-facets-from-api

Conversation

@mykolamelnykml

Copy link
Copy Markdown
Contributor

Why

Word and Excel were added as media facets on prod and appeared nowhere. The tool page's key facts and the hub table's media chips each filtered a tool's facet slugs through their own hard-coded list (pdf, image, video, audio, text), so any value added in the admin was silently dropped.

What

  • Tool page key facts (Media, Deployment, Method) now read tool.facets from the detail response by dimension, in the taxonomy's order, and print labels (PDF, Word) instead of slugs (pdf, word).
  • Hub table media chips take labels and order from useListFacets(), which the hub page already prefetches for the filter bar, so no extra request.

method-icons.tsx still maps method slugs to icons on purpose: a new method shows everywhere except as an icon until one is drawn.

Tests

  • tool-profile.test.tsx: a media facet outside the old list (word) shows in key facts by its label.
  • tool-table.test.tsx: a medium added to the taxonomy shows as a chip, in taxonomy order.
  • Full frontend suite (915), lint, typecheck and Prettier pass locally.

Staff added Word and Excel as media facets on prod, and neither appeared.
The tool page's key facts and the hub table's media chips each filtered the
tool's facet slugs through their own list of pdf, image, video, audio and
text, so any value added in the admin was dropped.

- Key facts (Media, Deployment, Method) now read the tool's facets from the
  detail response, by dimension and in the taxonomy's order, and print their
  labels ("PDF, Word") rather than slugs.
- The hub's media chips take their labels and order from the facets
  endpoint, which the hub already prefetches for the filter bar.

method-icons.tsx still maps method slugs to icons on purpose; a new method
shows everywhere except as an icon until one is drawn.
@mykolamelnykml
mykolamelnykml merged commit 27d64fe into main Oct 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant