Filter by more than one library - #212
Open
abernier wants to merge 1 commit into
Open
Conversation
The rail's library filter held one label at a time, so the only way to ask for two was to type them into the search box and hope the words turned up somewhere in the haystack. The Select is `multiple` now: picking adds, picking again removes, and the popup stays open across the whole run rather than closing on every choice. `alignItemWithTrigger` goes off with it -- there is no single selected row for the popup to slide under once there are three. ### One rule for several picks An example has to carry *all* of them, the same rule the search terms already follow. Every pick narrows, so the count under the field only ever falls, and `Cannon` + `Rapier` -- two physics engines that never share an example -- comes out empty and says so through the `Empty` block that was already there. ### The URL `?library=` keeps its name and its labels and becomes a comma-separated list. A link written when the field took a single value parses as the one-element list it always was, so there is nothing to migrate, deprecate or delete. `bootNav` is untouched for the same reason: it asks whether the param is there, not what is in it. An emptied list drops the param outright -- nuqs compares arrays by their items, so `[]` is the default it clears on. ### The trigger, and the row that left One line at every count the rail can hold: the first pick spelled out and the rest as a tally, `Drei +2`. Not a chips field -- at 200px it would grow a line per library, and the pre-paint skeleton standing in front of it on a filtered arrival can only ever be one line tall. The `All libraries` row is gone from the popup. In a list where every row is a checkbox it was the one that was not, and it says nothing that unpicking the last library does not already say. Empty is now inferred: no picks, and the trigger reads `All libraries` in the placeholder tone. `Clear filters` in the empty state still drops everything at once. ### Checked by hand `tsc --noEmit`, `eslint`, `prettier --check`. In the browser: `?library=Drei` -> 156, `?library=Drei,Rapier` -> 11 with the rail revealed, `?library=Cannon,Rapier` -> 0 and the empty block, picking and unpicking down to nothing, and the card links carrying the list into an example. Co-Authored-By: Claude Opus 5 <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 rail's library filter held one label at a time, so the only way to
ask for two was to type them into the search box and hope the words
turned up somewhere in the haystack.
The Select is
multiplenow: picking adds, picking again removes, andthe popup stays open across the whole run rather than closing on every
choice.
alignItemWithTriggergoes off with it — there is no singleselected row for the popup to slide under once there are three.
One rule for several picks
An example has to carry all of them, the same rule the search terms
already follow. Every pick narrows, so the count under the field only
ever falls, and
Cannon+Rapier— two physics engines that nevershare an example — comes out empty and says so through the
Emptyblock that was already there.
The URL
?library=keeps its name and its labels and becomes a comma-separatedlist. A link written when the field took a single value parses as the
one-element list it always was, so there is nothing to migrate,
deprecate or delete.
bootNavis untouched for the same reason: it askswhether the param is there, not what is in it. An emptied list drops the
param outright — nuqs compares arrays by their items, so
[]is thedefault it clears on.
The trigger, and the row that left
One line at every count the rail can hold: the first pick spelled out
and the rest as a tally,
Drei +2. Not a chips field — at 200px itwould grow a line per library, and the pre-paint skeleton standing in
front of it on a filtered arrival can only ever be one line tall.
The
All librariesrow is gone from the popup. In a list where everyrow is a checkbox it was the one that was not, and it says nothing that
unpicking the last library does not already say. Empty is now inferred:
no picks, and the trigger reads
All librariesin the placeholder tone.Clear filtersin the empty state still drops everything at once.Checked by hand
tsc --noEmit,eslint,prettier --check.In the browser:
?library=Drei→ 156,?library=Drei,Rapier→ 11 withthe rail revealed,
?library=Cannon,Rapier→ 0 and the empty block,picking and unpicking down to nothing, and the card links carrying the
list into an example.
🤖 Generated with Claude Code