Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: use multiselect for every enum-shaped table filter

This commit is contained in:
iris 2026-09-10 21:00:53 +02:00
commit 74cb0c2793
3 changed files with 29 additions and 24 deletions

View file

@ -318,11 +318,13 @@ export function AgentsPage() {
header: "hive",
render: (a) => a.hive ?? "—",
sortBy: (a) => a.hive ?? "",
// "—" (not "") so the missing-hive option in the filter dropdown
// reads the same as the cell itself, rather than showing a blank
// choice.
filterValue: (a) => a.hive ?? "—",
filterMode: "select",
// "—" (not "") so the missing-hive option in the filter list reads
// the same as the cell itself, rather than showing a blank choice.
// Multiselect, not single-value `"select"` — an operator narrowing
// to a handful of hives at once shouldn't need to filter one at a
// time.
filterValues: (a) => [a.hive ?? "—"],
filterMode: "multiselect",
},
{
key: "status",
@ -333,8 +335,9 @@ export function AgentsPage() {
// label and blew the row out (mara: "looks messy"). That string
// now lives in its own "message" column below.
sortBy: (a) => FRESHNESS[a.freshness].label,
filterValue: (a) => FRESHNESS[a.freshness].label,
filterMode: "select",
// Multiselect, same reasoning as the hive column above.
filterValues: (a) => [FRESHNESS[a.freshness].label],
filterMode: "multiselect",
render: (a) => {
const { tone, label } = FRESHNESS[a.freshness];
return (
@ -379,8 +382,9 @@ export function AgentsPage() {
// real per-badge logic lives there, this column just wires its
// callbacks to the page's own state/handlers.
sortBy: (a) => a.wanted ?? "",
filterValue: (a) => a.wanted ?? "no declaration",
filterMode: "select",
// Multiselect, same reasoning as the hive column above.
filterValues: (a) => [a.wanted ?? "no declaration"],
filterMode: "multiselect",
render: (a) => {
const err = actionErrors.get(a.name);
return (