fix(catalog): align browsing client with backend entries API#74
Merged
Conversation
The catalog grid was always empty: the client read `data.entries` but the
backend returns a Page envelope (`{ items, total, offset, limit }`), and the
filter controls were silently ignored (client sent source/tags/os/difficulty/q;
the backend only honors source_id/kind/tag/offset/limit).
- useCatalog reads `data.items`; sends only backend-honored params; adds a pure,
unit-tested `applyClientFilters` helper for presentation-side refinement.
- CatalogList fetches the full entry set once and filters entirely client-side,
so multi-select widening can never operate over a server-narrowed subset.
- CatalogTile renders container/ansible_role kind badges.
- Fix the misleading catalog error-retry button label (common.retry).
Closes #66
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The catalog grid was always empty:
useCatalog.listEntriesreaddata.entries, butGET /v1/catalog/entriesreturns aPageenvelope ({ items, total, offset, limit }). The filter controls were also silently ignored — the client sentsource/tags/os/difficulty/q, while the backend only honorssource_id/kind/tag/offset/limit.Changes
useCatalogreadsdata.items, sends only backend-honored params, and exposes a pure, unit-testedapplyClientFilters()helper for presentation-side refinement (os/difficulty/free-text/multi-select).CatalogListfetches the full entry set once and filters entirely client-side, so multi-select widening can never operate over a server-narrowed subset (avoids a transient/stale-cache empty-results bug). The previously deados/difficulty/searchcontrols now work.CatalogTilerenderscontainer/ansible_rolekind badges (the backend emits these; they previously fell through to a generic badge).common.retry, added to en/fr/jp).Tests
useCatalogtests to assert the real backend contract; added 7applyClientFilterscases.CatalogListcomponent test guarding the filter wiring — specifically the single→multi-select widening regression.npm run buildsucceeds.Closes #66