Spreadsheet panel (file type, dual-mode)
Generated from
pattern-library/registry.json— do not edit by hand; change the registry and runbun run patterns:build.
Index card — the docs below are the canonical explanation; deep-tier pattern pages additionally carry invariants and emulation notes.
Category: Desk Workspace · Tier: light · Maturity: proven (verified 2026-08-20 @ 1a130d67) · Risk: medium — persists spreadsheet data via desk file registry
A spreadsheet file type managed through the desk's unified file registry, editable in a dual-mode (grid/panel) UI, with one formula evaluator shared by the grid and the AI write path so a stored sheet never disagrees with itself.
When to use: Use when a desk-based workspace needs to support tabular/spreadsheet data alongside markdown documents.
Docs
Code
src/lib/components/desk/panels/spreadsheet/(GitHub · GitLab)src/lib/desk/formula.ts— Expression evaluator + grid resolver (dependency order, per-pass memoization, cycle detection) — below the component layer because the sheet has two writers (GitHub · GitLab)src/lib/desk/spreadsheet-cells.ts— The persisted cell contract and recalculateCells(): every stored value re-derived at the write door, whoever wrote it (GitHub · GitLab)
Tests
src/lib/desk/spreadsheet-cells.test.ts— Re-derivation, canonical labels, idempotence, refused addresses (GitHub · GitLab)src/lib/server/ai/tools/desk-execute.pglite.test.ts— AI writes an input of a stored formula → desk_read_file reads the recomputed total (GitHub · GitLab)
Proof
desk(app route, no showcase)
Depends on
Machine-readable record: desk-spreadsheet-panel in pattern-library/registry.json.