Feat/search endangered filter#308
Merged
zigzagdev merged 7 commits intochore/add-criteria_endangered-search-formfrom May 3, 2026
Merged
Feat/search endangered filter#308zigzagdev merged 7 commits intochore/add-criteria_endangered-search-formfrom
zigzagdev merged 7 commits intochore/add-criteria_endangered-search-formfrom
Conversation
…rip) Add is_endangered to HeritageSearchParams and SearchValues, default it to null/false, parse and serialize the URL query param, and round-trip the value through the form / result containers and the detail layout's quick-submit. The form's internal state initialiser, the detail layout's DEFAULT_SEARCH, and the search container test mocks are updated to satisfy the new field. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Place a LocaleToggle next to "Back to all sites" so users can switch locales from the search results page itself, and read the button text plus the empty-state message from useText. The h1 brand "Search Results" and the subtitle stay untranslated by design. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
…chParams literals Two literals in test code and the detail-side HeritageSubHeader were missed when is_endangered was added to the types, breaking CI typecheck. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d176e20
into
chore/add-criteria_endangered-search-form
1 check passed
4 tasks
3 tasks
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.
PR Content
is_endangered=trueon the URL and wires it through the domain types, URL parse/serialize, searchAPI, and form/result containers.
?lang=jawas dropped on every search-related navigation, so the search results page reverted to English. Form submit and all four navigations on the results page(pagination, re-submit, item click, back-to-all) now carry
lang=jaforward when the user is in Japanese mode.LocaleToggleto the search results page header and pulls "Back to all sites" / "No sites found." from the ui-text dictionary so the page actually reflects the locale switch. The h1 brand"Search Results" and its subtitle stay untranslated by design (matches the
World Heritagebrand pattern in TopPageTitleBar).What changed
Endangered filter
HeritageSearchParamsgainsis_endangered: boolean | null;SearchValuesgainsisEndangered: boolean.parseHeritageSearchParamsreadsis_endangered=true(anything else →null);serializeHeritageSearchParamsemits the param only whentrue. Round-trip covered by newsearch-heritages.params.test.ts.SearchParams(API client) anduseHeritageSearchQuerythreadisEndangeredto the backend asis_endangered=true.HeritageSearchFormrenders a checkbox above the year/keyword row;SearchHeritageFormContainer,SearchHeritageResultsContainer, andHeritageDetailLayoutround-trip the field through their draftsand submit handlers.
endangeredOnlyui-text key added toen(Endangered only) andja(危機遺産のみ表示).Lang preservation on search navigations
SearchHeritageFormContainer.handleSubmitreads the current URL'slangand re-appends it to the next/heritages/resultsURL.SearchHeritageResultsContainergets a small file-localpreserveLang(nextSearch, currentSearch)helper used byhandleClickItem/handlePageChange/handleSubmit/handleBackToAllSites.lang=en(default) is never written; onlylang=jais propagated.SearchResultsPage localization
<LocaleToggle />placed next to "Back to all sites" so users can switch locale from the results page itself.useText(). New keys:backToAllSites,noSitesFound.Tests
npm run typecheckpassesnpm testpasses (14 suites / 74 tests, including newsearch-heritages.params.test.ts)/heritages?lang=ja, open the search form, tick the 危機遺産のみ表示 checkbox, submit. Confirm the result URL becomes/heritages/results?is_endangered=true&lang=jaand the page is in Japanese.ja, click pagination / re-submit the form / click an item / click 一覧に戻る.lang=jasurvives every transition./heritages/results?is_endangered=truedirectly (nolang). Click the 🇬🇧 toggle in the page header — UI flips to ja, URL gains&lang=ja, and reload preserves it.