Skip to content

Filter by more than one library - #212

Open
abernier wants to merge 1 commit into
mainfrom
claude/multi-library-menu-5dd1e9
Open

Filter by more than one library#212
abernier wants to merge 1 commit into
mainfrom
claude/multi-library-menu-5dd1e9

Conversation

@abernier

Copy link
Copy Markdown
Member

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.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant