From bdcd4990b594672992aeca02dcce1135f4d30c92 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 16 Jul 2026 03:29:39 +0000 Subject: [PATCH] Rename Fetch/Live chips; show large record counts compactly (1k, 1.4k) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - "Load more" chip is now "Fetch" (and "Fetching…" while in flight). - "Go live" chip is now just "Live" in both states; the play/pause icon and the active moss fill already convey whether the stream is running. - The record-count stat renders large values compactly once a repo pages past 1k rows: 1000 -> "1k", 1400 -> "1.4k", 12300 -> "12.3k". Counts under 1k are unchanged. Uses Intl compact notation, lowercased. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_0162M8cx8jXKS1S4gwrDempX --- src/components/explore/CollectionExplorer.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/explore/CollectionExplorer.tsx b/src/components/explore/CollectionExplorer.tsx index fee2906..7812566 100644 --- a/src/components/explore/CollectionExplorer.tsx +++ b/src/components/explore/CollectionExplorer.tsx @@ -77,6 +77,18 @@ export default function CollectionExplorer({ repo, collection }: Props) { // as many records as possible per fetch. const RECORDS_PER_PAGE = 100; +// Keep the record-count stat compact once a repo has paged in a lot of rows: +// 1000 -> "1k", 1400 -> "1.4k", 12300 -> "12.3k", 1_000_000 -> "1m". Counts +// under 1k render verbatim. Lowercased to sit with the explorer's quiet, +// terminal-flavoured typography. +const compactCountFormatter = new Intl.NumberFormat('en-US', { + notation: 'compact', + maximumFractionDigits: 1, +}); +function formatCount(n: number): string { + return n < 1000 ? String(n) : compactCountFormatter.format(n).toLowerCase(); +} + // com.atproto.repo.applyWrites caps a batch at 200 operations (lexicon // maxLength), so a larger selection is split into chunks. Each chunk lands as // one atomic repo commit instead of one commit per record. @@ -636,7 +648,7 @@ function CollectionList({ title={live ? 'Pause live stream' : 'Stream new records as they arrive'} > {live ? : } - {live ? 'Live' : 'Go live'} + Live {!done && records.length > 0 && ( )} {records.length === 0 && !done ? 'Loading…' - : `${records.length} record${records.length === 1 ? '' : 's'}`} + : `${formatCount(records.length)} record${records.length === 1 ? '' : 's'}`} -- 2.51.2