Chore: multi-select filter (i–x) to the heritage search form#309
Merged
zigzagdev merged 3 commits intochore/add-criteria_endangered-search-formfrom May 4, 2026
Merged
Conversation
… round-trip) Add criteria: CriteriaCode[] to HeritageSearchParams and SearchValues, default it to [], and parse/serialize the URL as a comma-separated list (criteria=ii,iv) — invalid codes are dropped, duplicates collapsed, and the resulting array is sorted in CRITERIA canonical order. The form / result containers, detail layout, both HeritageSubHeaders, and the test helpers are updated to satisfy the new field. Empty array stays out of the URL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Render the i–x criteria as multi-toggle chips between the Category row and the Endangered checkbox. Clicking a chip adds or removes the code from the selection (kept in CRITERIA canonical order); the heading reuses the existing text.criteria key. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
2c3e2e0
into
chore/add-criteria_endangered-search-form
1 check passed
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
Adds the UNESCO Criteria multi-select filter (i–x) to the heritage search form. Selecting multiple chips broadens the result set per the backend's
(criteria:i OR criteria:ii OR ...)Algolia filter.URL convention
?criteria=i,ii,iii,ivSemantics
AlgoliaWorldHeritageSearchAdapter. Selecting more chips matches more sites, not fewer.Scope
Domain & URL
criteria: CriteriaCode[]added toHeritageSearchParamsandSearchValues(default[]).parseHeritageSearchParamsreads comma-separatedcriteria=ii,iv, strips invalid codes, dedupes, and sorts inCRITERIAcanonical order.serializeHeritageSearchParamsemitscriteria=ii,ivonly when non-empty.API
SearchParams.criteria?: readonly CriteriaCode[]threaded throughsearch-api.tsanduse-search-heritage-query.ts. Empty array stays out of the request.UI
HeritageSearchForm. The heading reuses the existingtext.criteriakey. Click adds/removes; selection stays inCRITERIAcanonical order.Round-trip
SearchHeritageFormContainer,SearchHeritageResultsContainer,HeritageDetailLayout, and bothHeritageSubHeaders carrycriteriathrough theirdrafts/submit handlers.
Tests
parseHeritageSearchParams/serializeHeritageSearchParamscases for criteria: empty / single / multi-value / invalid-filtering / dedup-and-sort / round-trip (10 new cases).search-heritage-container.test.tsxanduse-search-heritage-query-test.tsto satisfy the new field.