@devries-cameron20 / t3code-1 / commits / 2370e338f7
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): the SQLite, archive and notebook previews say "1 row", "1 entry" and "1 cell" (#31886)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

spoukyii committed Nov 14, 2026 at 20:02 UTC 2370e338f73ecd46fd4bf858f57d88a42df46f4d
3 files changed +12 -7
apps/web/src/components/files/AttachmentFilePreview.browser.test.tsx
+2 -2
@@ -365,7 +365,7 @@ describe("bounded binary previews", () => {
365 await act(() => trigger.focus());
366 await userEvent.keyboard("{Enter}");
367 await expect
368 - .element(page.getByRole("option", { name: "zzInventory (1 rows)" }))
368 + .element(page.getByRole("option", { name: "zzInventory (1 row)" }))
369 .toBeVisible();
370 await userEvent.keyboard("{ArrowDown}{Enter}");
371 await vi.waitFor(() =>
@@ -376,7 +376,7 @@ describe("bounded binary previews", () => {
376 await vi.waitFor(() => expect(document.activeElement).toBe(trigger));
377 await userEvent.keyboard("{Enter}");
378 await expect
379 - .element(page.getByRole("option", { name: "zzInventory (1 rows)" }))
379 + .element(page.getByRole("option", { name: "zzInventory (1 row)" }))
380 .toBeVisible();
381 await userEvent.keyboard("{Escape}");
382 } finally {
apps/web/src/components/files/BinaryViewer.tsx
+8 -4
@@ -35,6 +35,9 @@ type Archive = Extract<BinaryWorkerResult, { type: "archive" }>;
35 type Database = Extract<BinaryWorkerResult, { type: "sqlite" }>;
36 type Rows = Extract<BinaryWorkerResult, { type: "rows" }>;
37
38 +const countLabel = (count: number, one: string, many: string) =>
39 + `${count.toLocaleString()} ${count === 1 ? one : many}`;
40 +
41 function ArchiveFile(props: { readonly path: string; readonly bytes: Uint8Array<ArrayBuffer> }) {
42 const [url, setUrl] = useState<string | null>(null);
43 const kind = filePreviewKind({ name: props.path });
@@ -210,7 +213,7 @@ export default function BinaryViewer(props: {
213 {selectedPath ?? (folder || "Archive contents")}
214 </span>
215 <span className="shrink-0 text-muted-foreground">
213 - {archive.entries.length.toLocaleString()} entries
216 + {countLabel(archive.entries.length, "entry", "entries")}
217 {sizeBytes !== null ? ` · ${formatAttachmentSize(sizeBytes)}` : ""}
218 </span>
219 </div>
@@ -227,13 +230,13 @@ export default function BinaryViewer(props: {
230 >
231 <SelectTrigger aria-label="Table" aria-disabled={busy} aria-busy={busy} size="xs">
232 <SelectValue>
230 - {table.name} ({table.count.toLocaleString()} rows)
233 + {table.name} ({countLabel(table.count, "row", "rows")})
234 </SelectValue>
235 </SelectTrigger>
236 <SelectPopup>
237 {database.tables.map((item) => (
238 <SelectItem key={item.name} value={item.name}>
236 - {item.name} ({item.count.toLocaleString()} rows)
239 + {item.name} ({countLabel(item.count, "row", "rows")})
240 </SelectItem>
241 ))}
242 </SelectPopup>
@@ -263,7 +266,8 @@ export default function BinaryViewer(props: {
266 className="border-b border-border/60 px-3 py-2 text-xs text-muted-foreground tabular-nums"
267 role="status"
268 >
266 - {table.count.toLocaleString()} rows · {rows?.columns.length ?? "…"} columns
269 + {countLabel(table.count, "row", "rows")} ·{" "}
270 + {rows ? countLabel(rows.columns.length, "column", "columns") : "… columns"}
271 {sizeBytes !== null ? ` · ${formatAttachmentSize(sizeBytes)}` : ""}
272 </div>
273 <FileSurfaceNotice>
apps/web/src/components/files/NotebookPreview.tsx
+2 -1
@@ -98,7 +98,8 @@ export default function NotebookPreview(props: {
98 className="border-b border-border/60 px-3 py-2 text-xs text-muted-foreground tabular-nums"
99 role="status"
100 >
101 - {props.notebook.cells.length.toLocaleString()} cells · {props.notebook.language}
101 + {props.notebook.cells.length.toLocaleString()}{" "}
102 + {props.notebook.cells.length === 1 ? "cell" : "cells"} · {props.notebook.language}
103 {props.sizeBytes !== undefined
104 ? ` · ${props.sizeBytes === 0 ? "0 bytes" : formatAttachmentSize(props.sizeBytes)}`
105 : ""}