From b733d65da33e25ade6b9dd6c67432951e3798d21 Mon Sep 17 00:00:00 2001 From: Steve Purves Date: Fri, 10 Apr 2026 21:59:20 +0000 Subject: [PATCH] feat: switch UI from dark to light theme, keep blue accents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bg-zinc-950/900 → bg-white/zinc-50 throughout - text-zinc-100/200 → text-zinc-900/700 - borders zinc-800/700 → zinc-200/300 - inputs: dark bg/border → white with zinc-300 border - buttons: dark hover states → light hover states - collection name: text-blue-300 → text-blue-600 - bar chart: bg-blue-500/60 → bg-blue-400 on zinc-100 track - hover rows: zinc-900 → blue-50 (keeps the blue feel) - badges: dark zinc → light zinc / blue tints - footer link: underline → text-blue-500 https://claude.ai/code/session_01C5w4RGRwK9tB9DNmtaUwfc --- web/app/app.css | 2 +- web/app/components/ui/badge.tsx | 8 +- web/app/components/ui/button.tsx | 10 +-- web/app/components/ui/input.tsx | 2 +- web/app/root.tsx | 10 +-- web/app/routes/home.tsx | 123 ++++++++++++++----------------- 6 files changed, 71 insertions(+), 84 deletions(-) diff --git a/web/app/app.css b/web/app/app.css index 8a93156..0374cf3 100644 --- a/web/app/app.css +++ b/web/app/app.css @@ -13,7 +13,7 @@ } body { - @apply bg-zinc-950 text-zinc-100 antialiased; + @apply bg-zinc-50 text-zinc-900 antialiased; font-family: var(--font-sans); } } diff --git a/web/app/components/ui/badge.tsx b/web/app/components/ui/badge.tsx index c99edca..f7e391e 100644 --- a/web/app/components/ui/badge.tsx +++ b/web/app/components/ui/badge.tsx @@ -3,15 +3,15 @@ import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "~/lib/utils"; const badgeVariants = cva( - "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2", + "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-blue-400 focus:ring-offset-2", { variants: { variant: { default: - "border-transparent bg-zinc-800 text-zinc-100 hover:bg-zinc-700", + "border-transparent bg-zinc-100 text-zinc-700 hover:bg-zinc-200", secondary: - "border-transparent bg-zinc-700 text-zinc-200 hover:bg-zinc-600", - outline: "border-zinc-700 text-zinc-300", + "border-transparent bg-blue-50 text-blue-700 hover:bg-blue-100", + outline: "border-zinc-300 text-zinc-600", }, }, defaultVariants: { diff --git a/web/app/components/ui/button.tsx b/web/app/components/ui/button.tsx index 2a85e29..01b2c52 100644 --- a/web/app/components/ui/button.tsx +++ b/web/app/components/ui/button.tsx @@ -4,16 +4,16 @@ import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "~/lib/utils"; const buttonVariants = cva( - "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 disabled:pointer-events-none disabled:opacity-50", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-blue-400 disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { default: - "bg-zinc-100 text-zinc-900 shadow hover:bg-zinc-200", + "bg-zinc-900 text-zinc-50 shadow hover:bg-zinc-700", outline: - "border border-zinc-700 bg-transparent shadow-sm hover:bg-zinc-800 hover:text-zinc-100", - ghost: "hover:bg-zinc-800 hover:text-zinc-100", - link: "text-zinc-100 underline-offset-4 hover:underline", + "border border-zinc-300 bg-white shadow-sm hover:bg-zinc-100 text-zinc-700 hover:text-zinc-900", + ghost: "hover:bg-zinc-100 text-zinc-700 hover:text-zinc-900", + link: "text-blue-600 underline-offset-4 hover:underline", }, size: { default: "h-9 px-4 py-2", diff --git a/web/app/components/ui/input.tsx b/web/app/components/ui/input.tsx index 55b770f..5867fe7 100644 --- a/web/app/components/ui/input.tsx +++ b/web/app/components/ui/input.tsx @@ -10,7 +10,7 @@ const Input = React.forwardRef( + - + {children} @@ -41,10 +41,10 @@ export function ErrorBoundary({ error }: { error: unknown }) { Error — AT Tracker - +
-

Error

-

{message}

+

Error

+

{message}

diff --git a/web/app/routes/home.tsx b/web/app/routes/home.tsx index a157859..6b74e17 100644 --- a/web/app/routes/home.tsx +++ b/web/app/routes/home.tsx @@ -21,7 +21,7 @@ type SortKey = "last_seen" | "count" | "first_seen"; interface CollectionStat { name: string; - count: string; // Postgres returns bigint as string + count: string; first_seen: string; last_seen: string; } @@ -44,7 +44,12 @@ export async function loader({ request }: LoaderFunctionArgs) { rawSort === "count" || rawSort === "first_seen" ? rawSort : "last_seen"; const offset = (page - 1) * PAGE_SIZE; - const orderSql = sort === "count" ? "count DESC" : sort === "first_seen" ? "first_seen ASC" : "last_seen DESC"; + const orderSql = + sort === "count" + ? "count DESC" + : sort === "first_seen" + ? "first_seen ASC" + : "last_seen DESC"; let statsResult: { rows: CollectionStat[] }; let countResult: { rows: CountRow[] }; @@ -111,7 +116,6 @@ function formatCount(n: number): string { } function formatDate(iso: string): string { - // Deterministic UTC format to avoid SSR/client hydration mismatch const d = new Date(iso); const year = d.getUTCFullYear(); const month = String(d.getUTCMonth() + 1).padStart(2, "0"); @@ -144,67 +148,59 @@ export default function Home() { const startRow = (page - 1) * PAGE_SIZE + 1; const endRow = Math.min(page * PAGE_SIZE, total); - const SortLink = ({ - field, - label, - }: { - field: SortKey; - label: string; - }) => ( + const SortLink = ({ field, label }: { field: SortKey; label: string }) => ( {label} - {sort === field && ↓} + {sort === field && ↓} ); return (
{/* Header */} -
+
- +
-

+

AT Proto Collection Tracker

-

+

Live histogram of AT Protocol record types from the Jetstream firehose

-
-
-
- - {totalCollections.toLocaleString()} - {" "} - collection types -
-
- - {formatCount(totalRecords)} - {" "} - total records seen -
+
+
+ + {totalCollections.toLocaleString()} + {" "} + collection types +
+
+ + {formatCount(totalRecords)} + {" "} + total records seen
{/* Search bar */} -
+
- +
- {/* preserve sort in search form */} {sort !== "last_seen" && ( )} @@ -236,17 +231,17 @@ export default function Home() {
{/* Result count + sort links */}
-

+

{total === 0 ? ( "No results" ) : ( <> Showing{" "} - + {startRow}–{endRow} {" "} of{" "} - + {total.toLocaleString()} {q && ( @@ -259,7 +254,7 @@ export default function Home() { )}

- Sort: + Sort: @@ -269,12 +264,12 @@ export default function Home() { {/* Table */}
{stats.length === 0 ? ( -
+
{q ? ( <>No collections match "{q}" ) : ( @@ -284,17 +279,17 @@ export default function Home() { ) : ( - - + - - - @@ -309,31 +304,31 @@ export default function Home() { - - - @@ -352,11 +347,7 @@ export default function Home() { aria-disabled={page <= 1} className={page <= 1 ? "pointer-events-none" : ""} > - @@ -364,9 +355,9 @@ export default function Home() { Page{" "} - {page} + {page} {" "}of{" "} - + {totalPages.toLocaleString()} @@ -376,11 +367,7 @@ export default function Home() { aria-disabled={page >= totalPages} className={page >= totalPages ? "pointer-events-none" : ""} > - @@ -389,14 +376,14 @@ export default function Home() { )} -
-

+

+

AT Proto Collection Tracker — consuming the{" "} Jetstream {" "} -- knotmirror 0.0.1

+
Collection / Lexicon type + Count + First seen + Last seen
- + {stat.name} {/* Mini bar chart */} -
+
+ {count.toLocaleString()} + {formatDate(stat.first_seen)} + {formatDate(stat.last_seen)}