From f8186b2e480312be16dd4dece632d85f29f7b1be Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 03:53:30 +0000 Subject: [PATCH 1/6] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/contacts/contact-form-dialog.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/contacts/contact-form-dialog.tsx b/src/components/contacts/contact-form-dialog.tsx index 3eed4be..2a177db 100644 --- a/src/components/contacts/contact-form-dialog.tsx +++ b/src/components/contacts/contact-form-dialog.tsx @@ -11,6 +11,8 @@ import { toast } from "sonner"; import { Loader2 } from "lucide-react"; export const CONTACT_TYPES = [ + { value: "client", label: "Client" }, + { value: "staff", label: "Staff" }, { value: "opposing_counsel", label: "Opposing counsel" }, { value: "co_counsel", label: "Co-counsel" }, { value: "expert", label: "Expert" }, From 80ec4630851a139d89a81bc48de48bb013fb9a70 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 03:53:41 +0000 Subject: [PATCH 2/6] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/contacts.index.tsx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/routes/contacts.index.tsx b/src/routes/contacts.index.tsx index 98ea3ca..6b70457 100644 --- a/src/routes/contacts.index.tsx +++ b/src/routes/contacts.index.tsx @@ -14,21 +14,6 @@ import { Plus, Search, Mail, Phone, Building2, ChevronRight, Edit, Trash2, Brief import { ContactFormDialog, CONTACT_TYPES, type ContactRecord } from "@/components/contacts/contact-form-dialog"; import { setArchived } from "@/lib/archive"; -type Category = "all" | "companies" | "people" | "lawyers"; - -const CATEGORY_TYPES: Record, string[]> = { - lawyers: ["opposing_counsel", "co_counsel"], - companies: ["vendor", "court"], - people: ["expert", "witness", "process_server", "client_contact", "other"], -}; - -function categoryOf(type: string | null | undefined): Exclude { - const t = type ?? "other"; - if (CATEGORY_TYPES.lawyers.includes(t)) return "lawyers"; - if (CATEGORY_TYPES.companies.includes(t)) return "companies"; - return "people"; -} - export const Route = createFileRoute("/contacts/")({ component: () => ( From 584c0fd0f642e3fb8ba8052b99c0c174e069038b Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 03:53:51 +0000 Subject: [PATCH 3/6] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/contacts.index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/contacts.index.tsx b/src/routes/contacts.index.tsx index 6b70457..b4ef6b9 100644 --- a/src/routes/contacts.index.tsx +++ b/src/routes/contacts.index.tsx @@ -37,7 +37,6 @@ function ContactsIndex() { const [q, setQ] = useState(""); const [typeFilter, setTypeFilter] = useState("all"); const [view, setView] = useState<"active" | "archived">("active"); - const [category, setCategory] = useState("all"); const [editing, setEditing] = useState(null); const [open, setOpen] = useState(false); From de1e0cd7021e55cea8319d2d4b5974fb1c691860 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 03:54:06 +0000 Subject: [PATCH 4/6] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/contacts.index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/routes/contacts.index.tsx b/src/routes/contacts.index.tsx index b4ef6b9..5794b48 100644 --- a/src/routes/contacts.index.tsx +++ b/src/routes/contacts.index.tsx @@ -70,7 +70,6 @@ function ContactsIndex() { const term = q.trim().toLowerCase(); return rows.filter((r) => { if (view === "archived" ? !r.archived_at : !!r.archived_at) return false; - if (category !== "all" && categoryOf(r.contact_type) !== category) return false; if (typeFilter !== "all" && r.contact_type !== typeFilter) return false; if (!term) return true; return ( @@ -80,7 +79,7 @@ function ContactsIndex() { (r.phone ?? "").toLowerCase().includes(term) ); }); - }, [rows, q, typeFilter, view, category]); + }, [rows, q, typeFilter, view]); const grouped = useMemo(() => { const map = new Map(); From a33188c5676faddbcc1f892e5b43d48ea681f520 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 03:54:22 +0000 Subject: [PATCH 5/6] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/contacts.index.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/routes/contacts.index.tsx b/src/routes/contacts.index.tsx index 5794b48..456bf98 100644 --- a/src/routes/contacts.index.tsx +++ b/src/routes/contacts.index.tsx @@ -99,14 +99,13 @@ function ContactsIndex() { const archivedCount = rows.filter((r) => r.archived_at).length; const activeCount = rows.length - archivedCount; - const categoryCounts = useMemo(() => { + const typeCounts = useMemo(() => { const base = rows.filter((r) => (view === "archived" ? !!r.archived_at : !r.archived_at)); - return { - all: base.length, - companies: base.filter((r) => categoryOf(r.contact_type) === "companies").length, - people: base.filter((r) => categoryOf(r.contact_type) === "people").length, - lawyers: base.filter((r) => categoryOf(r.contact_type) === "lawyers").length, - }; + const counts: Record = { all: base.length }; + for (const t of CONTACT_TYPES) { + counts[t.value] = base.filter((r) => (r.contact_type ?? "other") === t.value).length; + } + return counts; }, [rows, view]); const remove = async (id: string, name: string) => { From d43b8864d95594c21f637c444dc2356e38df8f19 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 03:54:31 +0000 Subject: [PATCH 6/6] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/contacts.index.tsx | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/routes/contacts.index.tsx b/src/routes/contacts.index.tsx index 456bf98..d0bc23f 100644 --- a/src/routes/contacts.index.tsx +++ b/src/routes/contacts.index.tsx @@ -174,14 +174,25 @@ function ContactsIndex() { - setCategory(v as Category)} className="mb-4"> - - All ({categoryCounts.all}) - Companies ({categoryCounts.companies}) - People ({categoryCounts.people}) - Lawyers ({categoryCounts.lawyers}) - - +
+ + {CONTACT_TYPES.map((t) => ( + + ))} +