Group the appellation filter by country - #25
Merged
Merged
Conversation
The filter listed 177 region groups from 21 countries in one flat list
ordered by size, so regions interleaved (FR Bourgogne, IT Toscana,
GR Ελλάδα, FR Val de Loire, …) with no way to scan by country. Nest them
under a country level: 21 collapsed rows, each with its flag, name and
appellation + complementary-designation counts.
Nesting also fixes an ambiguity the flat list had: regions were keyed by
name alone, but Tokaj is both a Hungarian borrégió and a Slovak
vinohradnícka oblasť, and the "no region" bucket spanned four countries.
Both levels now key on (country, region); the omnisearch keeps its
name-keyed pick (its index is the global region facet) via
setRegionNameSelection.
A cross-border appellation — a record carrying country_aliases, today
only Maasvallei Limburg on the BE/NL border — is listed under every
country it spans. It stays one record with one polygon and one slug, so
ticking it on either side toggles the same filter entry and mirrors onto
its twin row. country_aliases is promoted into STARTUP_AOCS_FIELDS
because the tree needs it at first paint.
Also:
- a fully-selected subtree collapses to one chip (country first, else
each whole region), with a flag prefix since the chip row has no
nesting to disambiguate with; a one-record group is left uncollapsed
so its appellation keeps its name.
- bulk checkboxes are named after their row ("Select all — Burgundy")
instead of ~200 controls all announcing a bare "select all".
- both tree levels render mixed case. The region rows had been
uppercased by the sidebar's global summary rule, which had been
hiding that the FR bassin labels are INAO's own ALL-CAPS join key;
the fr catalog now carries their proper names, as en/es/nl already
did.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The appellation filter listed 177 region groups from 21 countries in one flat list ordered by size, so regions interleaved (FR Bourgogne → IT Toscana → GR Ελλάδα → FR Val de Loire) with no way to scan by country. This nests them under a country level: 21 collapsed rows, each with its flag, name, and appellation + complementary-designation counts.
Cross-border appellations
Driven by the existing
country_aliasesfield, a cross-border appellation is listed under every country it spans — today only Maasvallei Limburg (PDO-BE+NL-02172), under both 🇧🇪 and 🇳🇱. It stays one record with one polygon and one slug, so ticking it on either side toggles the same entry infilters.appellationsand mirrors onto its twin row.country_aliasesmoves intoSTARTUP_AOCS_FIELDS(out of the lazy panel payload) because the tree needs it at first paint.An ambiguity the flat list had
Regions were keyed by name alone, but Tokaj is both a Hungarian borrégió and a Slovak vinohradnícka oblasť, and the "no region" bucket spanned four countries. Both levels now key on
(country, region). The omnisearch keeps its name-keyed pick — its index is the global region facet — viasetRegionNameSelection, the one place Tokaj is deliberately treated as a single entry.Also
summaryrule, which was hiding that the FR bassin labels are INAO's own ALL-CAPS join key; thefrcatalog now carries their proper names (Bourgogne,Vallée du Rhône,Vins doux naturels), as en/es/nl already did.Verification
Ran the tree builder headless against the real corpus: 21 countries / 178 region groups / 2 914 records — 176 groups render by default, since
EAUX-DE-VIE DE CIDREandRHUMare spirit-only and hide with the spirits toggle, as before. Browser pass (Playwright) confirmed the cross-border twin-checkbox mirror, the chip collapse, the aria labels and the per-locale labels infranden.eslint clean · 368 tests pass · ruff clean · full stage-04 rebuild green with asset content-hashes intact.
Note:
locale/is gitignored, so the 18 French bassinmsgstredits are not in this diff — they aremsgstr-only changes on existing msgids (no pybabel fuzzy risk) and need re-applying on any other machine.🤖 Generated with Claude Code