feat(filter-builder): multi-pick values render as removable chips

The id-kind value cells (feed/library/collection/added_by) rendered
their picks as one comma-joined string inside a 9rem-wide input — you
saw the first label and nothing else, and reading 3-5 picks meant
scrolling inside a tiny box (worst on mobile, user request 2026-11-01).

Id-kind cells now render a chipbox: each picked value is a chip (label
truncated with a hover title, removable via an X button with a finger-
sized tap target), the box flex-wraps and grows vertically instead of
clipping, and the inline input stays at the end for typing/searching —
including the Backspace-on-empty-removes-last-chip affordance. Text/
number/date cells keep today's single input; the value menu is
unchanged (it never offers an already-picked value, so the chip X is
the faster removal path, not a new one).

Presentation only: the stored wire is still one comma-joined value per
rule; matching, menus, apply, and label resolution are untouched. Pins
moved from valueCellText (now text-cells-only) to the chip model
(idChipsFor/idDraftFor) and cover removal order, last-chip removal, and
Backspace; 187 web tests green.
This commit is contained in:
John O'Keefe committed 2026-11-01 13:33:34 -05:00
1 parent d56031f334
commit a20741ccc9
6 files changed
+187 -27

No files matched your search

+60
View File
@@ -1958,6 +1958,66 @@
font-size: 0.8rem;
padding: 0.3rem 0.5rem;
}
/* chip-style multi-value box (id-kind cells): picked values render as
removable tags, the box wraps and grows instead of a 9rem input;
the inline input stays for typing/searching */
.fb-chipbox {
flex: 1 1 12rem;
min-width: 0;
max-width: 100%;
min-height: 2.25rem;
padding: 0.2rem 0.4rem;
border-radius: 0.5rem;
border: 1px solid var(--border);
background-color: var(--bg-primary);
cursor: text;
}
.fb-chipbox:focus-within {
border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.fb-chip {
display: inline-flex;
align-items: center;
gap: 0.1rem;
max-width: 100%;
padding: 0.05rem 0.1rem 0.05rem 0.5rem;
border-radius: 9999px;
background-color: var(--accent-muted);
color: var(--accent);
font-size: 0.78rem;
line-height: 1.5;
}
.fb-chip-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.fb-chip-x {
display: inline-grid;
place-items: center;
width: 1.5rem;
height: 1.5rem;
flex-shrink: 0;
border: 0;
border-radius: 9999px;
background-color: transparent;
color: inherit;
font-size: 0.9rem;
line-height: 1;
cursor: pointer;
}
.fb-chip-x:hover {
background-color: color-mix(in srgb, var(--text-primary) 12%, transparent);
}
.fb-chip-input {
flex: 1 1 6ch;
min-width: 6ch;
width: auto;
border: 0;
background-color: transparent;
padding: 0.2rem 0.25rem;
outline: none;
}
.fb-menu {
position: absolute;
z-index: 60;