A .csv already previewed — as raw text in a <pre>, columns lining up only if the file happened to be padded. It now renders as an HTML table with the first row as a header. The parser is a new pure lib/csv.ts (~50 lines of RFC 4180: quoted delimiters, "" as a literal quote, newlines inside quotes), so no papaparse. It never throws: null means "not a table" — an unterminated quote, or a file with no delimiter at all — and the caller falls back to the very <pre> it renders today. That fallback is structural rather than a second code path, because TextView gained a `delim` prop instead of a new component: it also keeps the ["text", fileURL] query key a restore invalidates and the retry:false a pinned ?v= version needs. .tsv is new here — it used to fall through to SniffView and render as text. The delimiter comes from the extension, never from sniffing. Big files are capped at 5,000 rows with the count stated on screen (virtualization is out of scope). Wide files scroll inside .csvbox, whose rules are scoped under that class on purpose: the file pane carries .markdown, and the plain .markdown table rules — including the ≤900px one that turns a table into its own scroller — would otherwise out-specify a bare .csvview and give the page two nested scrollers. Not doing: sorting, filtering, search, editing, XLSX.
Architecture diagrams
Mermaid diagrams of the current implementation, kept next to the code so PRs can update them alongside the change.
Convention: when a PR changes the structure drawn here (new/removed types, new seams, changed relationships), update the affected diagram in the same PR and add an "Architecture changes" section to the PR description that, per changed diagram:
- names exactly which types/relationships changed and how (one sentence);
- shows a Before and an After mermaid block — each an excerpt of only the affected classes and their immediate relationships, never the full diagram (Before comes from the diagram at the merge base).
The committed diagram file stays the full current state; the before/after
excerpts exist only in the PR description so reviewers see the structural
delta at a glance. A pre-PR hook (.claude/hooks/check-arch-diagrams.sh)
reminds Claude Code sessions when server code changed but no diagram did.
Together these cover every application package in the repo — every code change lands inside exactly one detail diagram's scope (plus the overview when the package map or cross-piece wiring changes):
- overview.md — system diagram: every package and surface on one page, and how they connect
- cli-sync.md — class diagram of the CLI and sync engine (
cmd/bdrive+internal/{syncer,store,journal,config,daemon,agenthooks,autostart}) - webapp-server.md — class diagram of the
bdrive serveserver (internal/webapp+ itsinternal/remoteseam) - webapp-frontend.md — module diagram of the hub's React SPA (
internal/webapp/frontend/src)
Not covered on purpose: web/docs (content site, no application code) and
cloud/ (private nested repo — its architecture lives there).