commit 90ad30ef4870edf37eace205d44159a24a63d885
parent 77908a76494be2086a96dc3ab02f19ef47a3e998
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 00:52:16 -0400
umtool: /browse and /sites filters on the Toolbar, controls drawn with a visible edge
The two lists' filter rows become Toolbar groups over the full width,
the search an Input, the actions outline buttons (the copy button no
longer wears Signal). Hand-rolled controls whose border said the old
`line` get seam-2, the canvas's control edge, from one utilities-layer
rule that every hover and state variant still beats.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 127 insertions(+), 114 deletions(-)
diff --git a/umtool/app/browse/page.tsx b/umtool/app/browse/page.tsx
@@ -1,5 +1,10 @@
import Link from "next/link";
import { badgeVariants, type BadgeVariants } from "@/components/ui/badge";
+import { buttonVariants } from "@/components/ui/button";
+import { EmptyState } from "@/components/ui/empty-state";
+import { Input } from "@/components/ui/field";
+import { Toolbar, ToolbarGroup } from "@/components/ui/toolbar";
+import { browseHref, decisionsHref } from "@/lib/hrefs";
import BrowseHeader from "@/components/BrowseHeader";
import NewProjectMenu from "@/components/NewProjectMenu";
import CopyButton from "@/components/CopyButton";
@@ -64,12 +69,7 @@ export default async function BrowsePage({
const nOf = (pred: (p: (typeof all)[number]) => boolean) => all.filter(pred).length;
- const qs = (next: Partial<Search>) => {
- const p = new URLSearchParams();
- for (const [k, v] of Object.entries({ ...sp, ...next })) if (v && k !== "deleted") p.set(k, String(v));
- const s = p.toString();
- return `/browse${s ? `?${s}` : ""}`;
- };
+ const qs = (next: Partial<Search>) => browseHref({ ...sp, deleted: undefined, ...next });
// Group by folder, using the COLLAPSED labels but never collapsed URLs.
const groups = new Map<string, typeof sorted>();
@@ -105,103 +105,98 @@ export default async function BrowsePage({
</p>
)}
{/* --- filters, as links ---------------------------------------- */}
- <div className="mb-2 flex flex-wrap items-center gap-1.5">
- <span className="micro">kind</span>
- <Chip href={qs({ kind: "", template: "" })} on={!kind && !template} label={`all ${all.length}`} />
- {KINDS.map((k) => (
- <Chip
- key={k.id}
- href={qs({ kind: k.id, template: "" })}
- on={kind === k.id && !template}
- label={`${k.label} ${nOf((p) => p.kind === k.id)}`}
- />
- ))}
- </div>
+ <Toolbar aria-label="Filters" className="-mx-4 -mt-4 mb-4">
+ <ToolbarGroup label="Kind">
+ <Chip href={qs({ kind: "", template: "" })} on={!kind && !template} label={`all ${all.length}`} />
+ {KINDS.map((k) => (
+ <Chip
+ key={k.id}
+ href={qs({ kind: k.id, template: "" })}
+ on={kind === k.id && !template}
+ label={`${k.label} ${nOf((p) => p.kind === k.id)}`}
+ />
+ ))}
+ </ToolbarGroup>
+
+ <ToolbarGroup label="State">
+ <Chip href={qs({ state: "" })} on={!state} label="any" />
+ {PROJECT_STATES.filter((s) => nOf((p) => p.state === s) > 0).map((s) => (
+ <Chip
+ key={s}
+ href={qs({ state: s })}
+ on={state === s}
+ label={`${s} ${nOf((p) => p.state === s)}`}
+ />
+ ))}
+ </ToolbarGroup>
- <div className="mb-2 flex flex-wrap items-center gap-1.5">
- <span className="micro">state</span>
- <Chip href={qs({ state: "" })} on={!state} label="any" />
- {PROJECT_STATES.filter((s) => nOf((p) => p.state === s) > 0).map((s) => (
+ <ToolbarGroup label="Decisions">
+ <Chip href={qs({ open: "" })} on={!open} label="any" />
<Chip
- key={s}
- href={qs({ state: s })}
- on={state === s}
- label={`${s} ${nOf((p) => p.state === s)}`}
+ href={qs({ open: "blocking" })}
+ on={open === "blocking"}
+ label={`blocking ${nOf((p) => (counts.get(p.id)?.blocking ?? 0) > 0)}`}
+ tone="blocking"
/>
- ))}
-
- <span className="micro ml-3">decisions</span>
- <Chip href={qs({ open: "" })} on={!open} label="any" />
- <Chip
- href={qs({ open: "blocking" })}
- on={open === "blocking"}
- label={`blocking ${nOf((p) => (counts.get(p.id)?.blocking ?? 0) > 0)}`}
- tone="blocking"
- />
- <Chip
- href={qs({ open: "1" })}
- on={open === "1"}
- label={`waiting ${nOf(
- (p) => (counts.get(p.id)?.blocking ?? 0) + (counts.get(p.id)?.open ?? 0) > 0,
- )}`}
- />
-
- <span className="micro ml-3">sort</span>
- <Chip href={qs({ sort: "" })} on={sort !== "name"} label="recent" />
- <Chip href={qs({ sort: "name" })} on={sort === "name"} label="name" />
- </div>
-
- <div className="mb-3 flex flex-wrap items-center gap-2">
- {/* A GET form so the result is a pasteable URL, and hidden inputs so
- searching does not throw away the filters you already set. */}
- <form method="get" action="/browse" className="flex items-center gap-1.5">
- {(["kind", "template", "state", "open", "sort"] as const).map((k) =>
- sp[k] ? <input key={k} type="hidden" name={k} value={sp[k]} /> : null,
- )}
- <input
- type="search"
- name="q"
- defaultValue={q ?? ""}
- placeholder="title, id, source…"
- aria-label="filter projects"
- className="w-56 rounded border border-[var(--color-line)] bg-[var(--color-ink)] px-2 py-1 font-mono text-[12px] text-[var(--color-text)] placeholder:text-[var(--color-dim)]"
+ <Chip
+ href={qs({ open: "1" })}
+ on={open === "1"}
+ label={`waiting ${nOf(
+ (p) => (counts.get(p.id)?.blocking ?? 0) + (counts.get(p.id)?.open ?? 0) > 0,
+ )}`}
/>
- <button
- type="submit"
- className="rounded border border-[var(--color-line)] px-2 py-1 text-[11px] text-[var(--color-dim)] hover:text-[var(--color-text)]"
- >
- filter
- </button>
- {q && (
- <Link href={qs({ q: "" })} className="micro hover:text-[var(--color-text)]">
- clear
+ </ToolbarGroup>
+
+ <ToolbarGroup label="Sort">
+ <Chip href={qs({ sort: "" })} on={sort !== "name"} label="recent" />
+ <Chip href={qs({ sort: "name" })} on={sort === "name"} label="name" />
+ </ToolbarGroup>
+
+ <div className="flex basis-full flex-wrap items-center gap-2">
+ {/* A GET form so the result is a pasteable URL, and hidden inputs so
+ searching does not throw away the filters you already set. */}
+ <form method="get" action="/browse" className="flex items-center gap-1.5">
+ {(["kind", "template", "state", "open", "sort"] as const).map((k) =>
+ sp[k] ? <input key={k} type="hidden" name={k} value={sp[k]} /> : null,
+ )}
+ <Input
+ type="search"
+ name="q"
+ defaultValue={q ?? ""}
+ placeholder="title, id, source…"
+ aria-label="filter projects"
+ className="w-60 font-mono text-[12.5px]"
+ />
+ <button type="submit" className={buttonVariants({ size: "md" })}>
+ filter
+ </button>
+ {q && (
+ <Link href={qs({ q: "" })} className="ink-link text-[12px]">
+ clear
+ </Link>
+ )}
+ </form>
+
+ <NewProjectMenu kinds={KINDS.map((k) => ({ id: k.id, label: k.label, scaffold: k.scaffold }))} />
+ <div className="ml-auto flex items-center gap-2">
+ <Link href={decisionsHref()} className={buttonVariants({ size: "md" })}>
+ decisions
</Link>
- )}
- </form>
-
- <NewProjectMenu kinds={KINDS.map((k) => ({ id: k.id, label: k.label, scaffold: k.scaffold }))} />
- <div className="ml-auto flex items-center gap-2">
- <Link
- href="/browse/decisions"
- className="rounded border border-[var(--color-line)] px-2.5 py-1 text-[12px] text-[var(--color-dim)] hover:text-[var(--color-text)]"
- >
- decisions
- </Link>
- <CopyButton
- label="copy the whole picture"
- title="every project as markdown — spec, cuts, verdicts, notes and resolved marks"
- url="/api/browse/context"
- className="rounded border border-[var(--color-sel)] px-2.5 py-1 text-[12px] text-[var(--color-sel)] hover:bg-[color-mix(in_srgb,var(--color-sel)_14%,transparent)]"
- />
+ <CopyButton
+ label="copy the whole picture"
+ title="every project as markdown — spec, cuts, verdicts, notes and resolved marks"
+ url="/api/browse/context"
+ className={buttonVariants({ size: "md" })}
+ />
+ </div>
</div>
- </div>
+ </Toolbar>
{all.length === 0 ? (
- <p className="text-[12px] text-[var(--color-dim)]">
- No projects under <code className="font-mono">REPORTS_DIR</code>. A directory becomes
- one by holding a <code className="font-mono">video.manifest.json</code>, a{" "}
+ <EmptyState title={<>No projects under <code className="font-mono">REPORTS_DIR</code></>}>
+ A directory becomes one by holding a <code className="font-mono">video.manifest.json</code>, a{" "}
<code className="font-mono">spec.json</code>, or a sweep report.
- </p>
+ </EmptyState>
) : (
<div className="space-y-5">
{[...groups.entries()].map(([folderPath, list]) => (
diff --git a/umtool/app/globals.css b/umtool/app/globals.css
@@ -748,3 +748,18 @@ canvas.grabbable {
background: color-mix(in srgb, var(--ground) 70%, transparent);
}
}
+
+/* Controls hand-rolled against the old palette drew their edge in `line`,
+ which is now the HAIRLINE (seam) -- too faint for something you press or
+ type into. A control's edge is seam-2 (the canvas's .btn), whatever its
+ class says. In the utilities layer, element + attribute, so it beats the
+ bare border utility and loses to every hover/focus/state variant. */
+@layer utilities {
+ button[class*="border-[var(--color-line)]"],
+ select[class*="border-[var(--color-line)]"],
+ input[class*="border-[var(--color-line)]"],
+ textarea[class*="border-[var(--color-line)]"] {
+ border-color: var(--seam-2);
+ }
+}
+
diff --git a/umtool/app/sites/page.tsx b/umtool/app/sites/page.tsx
@@ -3,6 +3,9 @@ import BrowseHeader from "@/components/BrowseHeader";
import ArticleTable from "@/components/articles/ArticleTable";
import SiteChips from "@/components/articles/SiteChips";
import { badgeVariants } from "@/components/ui/badge";
+import { EmptyState } from "@/components/ui/empty-state";
+import { Toolbar, ToolbarGroup } from "@/components/ui/toolbar";
+import { sitesHref } from "@/lib/hrefs";
import { listSiteRows, type ArticleRow } from "@/lib/articles/sites";
export const dynamic = "force-dynamic";
@@ -27,39 +30,39 @@ export default async function SitesPage({ searchParams }: { searchParams: Promis
const articles = all.flatMap((s) => s.articles);
const open = articles.reduce((n, a) => n + a.openNotes, 0);
const qs = (next: Partial<Search>) => {
- const p = new URLSearchParams();
- for (const [k, v] of Object.entries({ ...sp, ...next })) if (v) p.set(k, String(v));
- const s = p.toString();
- return `/sites${s ? `?${s}` : ""}`;
+ return sitesHref({ ...sp, ...next });
};
return (
<div className="flex h-full flex-col">
<BrowseHeader active="articles" crumbs={[{ label: "articles" }]} note={`${all.length} sites · ${articles.length} articles · ${open} open notes`} />
<main className="deck-main flex-1 p-4">
- <div className="mb-3 flex flex-wrap items-center gap-1.5">
- <span className="micro">site</span>
- <Chip href={qs({ site: "" })} on={!sp.site} label={`all ${all.length}`} />
- {all.map((s) => (
- <Chip key={s.siteId} href={qs({ site: s.siteId })} on={sp.site === s.siteId} label={s.siteId} />
- ))}
- <span className="micro ml-3">status</span>
- <Chip href={qs({ status: "" })} on={!sp.status} label="all" />
- <Chip href={qs({ status: "published" })} on={sp.status === "published"} label={`published ${articles.filter((a) => a.status === "published").length}`} />
- <Chip href={qs({ status: "draft" })} on={sp.status === "draft"} label={`draft ${articles.filter((a) => a.status === "draft").length}`} />
- <span className="micro ml-3">notes</span>
- <Chip href={qs({ notes: "" })} on={sp.notes !== "open"} label="all" />
- <Chip href={qs({ notes: "open" })} on={sp.notes === "open"} label={`open ${articles.filter((a) => a.openNotes > 0).length}`} />
- </div>
+ <Toolbar aria-label="Filters" className="-mx-4 -mt-4 mb-4">
+ <ToolbarGroup label="Site">
+ <Chip href={qs({ site: "" })} on={!sp.site} label={`all ${all.length}`} />
+ {all.map((s) => (
+ <Chip key={s.siteId} href={qs({ site: s.siteId })} on={sp.site === s.siteId} label={s.siteId} />
+ ))}
+ </ToolbarGroup>
+ <ToolbarGroup label="Status">
+ <Chip href={qs({ status: "" })} on={!sp.status} label="all" />
+ <Chip href={qs({ status: "published" })} on={sp.status === "published"} label={`published ${articles.filter((a) => a.status === "published").length}`} />
+ <Chip href={qs({ status: "draft" })} on={sp.status === "draft"} label={`draft ${articles.filter((a) => a.status === "draft").length}`} />
+ </ToolbarGroup>
+ <ToolbarGroup label="Notes">
+ <Chip href={qs({ notes: "" })} on={sp.notes !== "open"} label="all" />
+ <Chip href={qs({ notes: "open" })} on={sp.notes === "open"} label={`open ${articles.filter((a) => a.openNotes > 0).length}`} />
+ </ToolbarGroup>
+ </Toolbar>
{sites.length === 0 ? (
- <p className="text-[12px] text-[var(--color-dim)]">{all.length === 0 ? "no sites" : "nothing matches that filter"}</p>
+ <EmptyState title={all.length === 0 ? "No sites" : "Nothing matches that filter"} />
) : (
<div className="space-y-6">
{sites.map((s) => (
<section key={s.siteId} data-site={s.siteId}>
<h2 className="mb-1.5 flex flex-wrap items-baseline gap-2">
- <Link href={`/sites/${s.siteId}`} className="text-[14px] font-semibold text-[var(--color-text)] hover:text-[var(--color-sel)]">
+ <Link href={`/sites/${s.siteId}`} className="text-[14px] font-semibold text-text hover:underline">
{s.title}
</Link>
<span className="font-mono text-[11px] text-[var(--color-dim)]">{s.siteId}</span>