Repository navigation
Description
Problem
A workbook with a chart sheet — what Excel's own Insert → Chart Sheet writes — cannot be opened at all, by the reader or the assistant. Verified against a two-sheet workbook whose second sheet is a chart sheet: readSpreadsheet throws TypeError: Cannot read properties of undefined (reading 'map'), while the same workbook without the chart sheet parses fine.
The chain: read-excel-file maps only worksheet-type relationships, so it returns the chart sheet as an entry with data: undefined; the repo's readSheetDetails maps every relationship and hands the chart sheet's name a real (empty) details object (ui-packages/web/src/formats/xlsx-package.ts:42-58), so the if (!details) return { name, rows } guard in withDetails never fires and rows.map runs on undefined (ui-packages/web/src/formats/xlsx.ts:136-149).
What the reader meets is the catch-all: "This workbook could not be read. Only .xlsx files are supported." (ui-packages/web/src/features/reader/xlsx-reader/index.tsx:21-31) — a false statement about a file Excel itself wrote, with every data sheet lost behind it. The assistant fails the same way: readSpreadsheet throws inside load, so every sheet tool and read fails for the whole workbook (ui-packages/web/src/features/assistant/xlsx/runtime.ts:24-34).
A lesser member of the same gap: a chart placed on a normal worksheet parses fine but vanishes without a marker — the grid and the agent's workbookText (ui-packages/web/src/formats/xlsx.ts:89-102) say nothing about it, while a chart inside a Word document already gets "(Chart not converted)" (ui-packages/web/src/formats/docx-unconverted.ts:59-74).
Proposal
- Carry a chart sheet through as a sheet with no cells: its name reaches the sheet tabs, its grid says it holds a chart rather than pretending to be empty, and the workbook's data sheets open as usual.
- Repair the failure message this exposed: a parse failure inside the app must not claim the format is unsupported ("Only .xlsx files are supported") for a
.xlsxthe store accepted. - Name embedded charts where they sit: the details reader already walks the sheet parts, so a chart anchored to a worksheet can be reported — at least in the agent's text view — the way Word conversion marks its charts.
Goal
After this, a workbook with a chart sheet opens to its data sheets for reader and assistant alike, the chart sheet itself is identified as a chart instead of sinking the file, and a chart on a worksheet is at least named to both reader and assistant rather than silently gone.
Verification
pnpm --filter @gamma-reader/web test src/formats
grep -rn "chart" ui-packages/web/src/formats/xlsx-package.ts
pnpm checkRefs
- ui-packages/web/src/formats/xlsx.ts:136-149 —
withDetailsrunsrows.mapon the chart sheet's undefined rows; the guard cannot fire because details exist for every mapped name - ui-packages/web/src/formats/xlsx-package.ts:42-58 — every workbook relationship is mapped, including chart sheets, so the chart sheet's name always has details
- ui-packages/web/src/features/reader/xlsx-reader/index.tsx:21-31 — "This workbook could not be read. Only .xlsx files are supported.", the false message the crash surfaces
- ui-packages/web/src/features/assistant/xlsx/runtime.ts:24-34 — the same throw fails every assistant path to the workbook
- ui-packages/web/src/formats/xlsx.ts:89-102 —
workbookText, the agent's view, which carries no word of a chart - ui-packages/web/src/formats/docx-unconverted.ts:59-74 — the marker treatment Word documents already give their charts
- Show the notes an Excel author left on cells — they are in the workbook, but the preview and every agent path drop them today, so caveats like 'provisional, double-check' reach neither reader nor answers #210 — the xlsx-extras family (cell notes reached reader and agent); chart sheets are the member that breaks the whole workbook
- Say what a Word header or footer held — the whole part drops without a trace today, though equations and charts get their '(not converted)' markers, so a letter's date or its CONFIDENTIAL status simply vanishes #209, Tell readers which Word content did not convert, instead of logging it to the browser console #45 — the Word markers this mirrors on the xlsx side
- Keep a sheet's frozen rows and columns in view — the workbook declares what Excel froze, but the preview pins only its own letter and number gutters today #205 — workbook-declared structure (frozen panes) the preview ignored; chart sheets are another declared kind of sheet
Activity
bencode commentedon Oct 26, 2026
Review — posted by the scheduled issue-reviewer loop (independent of the authoring session), against
main@e8c930f.Evidence audit: every citation holds, and the crash chain traced end-to-end into the dependency source.
formats/xlsx-package.ts:42-58—sheetPathsmaps every<sheet>in workbook.xml with no relationship-type filter;readSheetDetails(:112-119) returns a real{cells: [], merges: []}even when a part fails to parse — so the chart sheet's name always has truthy details.formats/xlsx.ts:136-149—withDetails'sif (!details) return { name, rows }guard can therefore never fire;rows.mapruns. ✅xlsx.ts:151-159—readSpreadsheetpassessheet.data as SheetRow[]straight through (the cast hides the undefined).parseFilePaths.jsrecords onlyworksheet-type relationships, andparseSpreadsheetContents.jsemits{sheet, data: sheetsData[rId]}— a chart sheet arrives as{data: undefined}→TypeError: Cannot read properties of undefined (reading 'map'), exactly as reported.xlsx-reader/index.tsx:21-31— the false "Only .xlsx files are supported." catch-all; ✅assistant/xlsx/runtime.ts:24-34— the same throw fails every assistant path; ✅docx-unconverted.ts:60— the 'Chart' marker precedent.workbookTextsits atxlsx.ts:132, not the cited:89-102(that range issheetText). Behavior claim holds — no chart word anywhere in the sheet views.Duplicate check: nothing open or closed covers chart sheets or the false unsupported-format message; #210 (cell notes, closed) and #69 (in-sheet search) are the xlsx family, not overlaps.
Sensor: lint ✓; verify ✗ → not implemented (formats tests pass 30/30 today; the
grep -rn "chart" xlsx-package.tsstep is the failing gate, zero matches).pnpm checkstill fails on unmodified main (conversation-panel.integration.test.tsx, deterministic — flagged last beat, still open), which blocks any close path regardless.Verdict: valid, keep open. One sharpening: step 1 (
test src/formats) already passes on unmodified main, and a barechartgrep could be satisfied by the embedded-chart marker while the crash remains — anchor the load-bearing deliverable instead, e.g. a formats test named for chartsheets (--testNamePattern="chart") that parses a workbook whose second sheet is a chartsheet; it fails today and passes only when the whole file stops sinking.