Repository navigation
fix(filters): multi-select license/modality (form repeated params) (#98) - #100
Merged
Merged
Conversation
The sidebar is a native GET form, so a checkbox group submits repeated
params (?license=a&license=b), but filterStateFromURL read only the first
via params.get() — selecting two tiers collapsed to one ('resets to
share-alike'). Same flaw hit multi-modality.
Parse with params.getAll() and split each element on comma, so both the
repeated (form) and comma-joined (our links) encodings parse identically.
Keeps the chips as real multi-select toggles; no UI change.
Mirror parseModalities' empty-part guard in parseLicenseTiers and cover the ?license=&license=public mixed-empty case.
Contributor
Author
PR review addressedReviewed with the code-reviewer agent (Sonnet) — no critical/important issues; core fix confirmed correct (getAll + comma-split, dedup across encodings, iEEG casing, round-trip with comma-joined links, helpers are file-private). Applied the two cheap suggestions:
The third note ( Validation: typecheck 0 errors, biome clean, 479 tests pass, build clean. |
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.
Fixes #98.
Problem
Selecting two license chips (e.g. Share-alike + Non-commercial) applied only the first — "resets to share-alike". Same flaw on multi-modality.
Root cause
The sidebar is a native GET form, so a checkbox group named
licensesubmits repeated params (?license=a&license=b), butfilterStateFromURLread only the first viaparams.get(). (Our own pagination/tag links comma-join, which is why those worked.)Fix
Parse
license/modalitywithparams.getAll()and split each element on comma, so the repeated (form) and comma-joined (link) encodings parse identically. Chips stay real multi-select toggles — no UI change needed. The server already does OR.Verified live
?license=sharealike&license=noncommercial→ "24 datasets", both chips selected (was "16", only share-alike)?modality=EEG&modality=MEG→ both modality chips selectedTests
typecheck 0 errors · biome clean · 478 unit tests pass (added repeated-param coverage for both license and modality) · build clean.