Repository navigation
Closed
Labels
Description
Problem
A merged cell states a structure — a grouped header spanning Q1 across three columns, a category label owning its block of rows — and that structure disappears on the way in, for reader and assistant alike:
read-excel-filenever parses it: the merged-cell branch is left as a comment in its sheet parser ("it could also parse merged cells… But then it's not clear what should be the way to return such merged cells",read-excel-file@9.3.10 modules/xlsx/parseSheet.js:343-351), so every cell outside the merge's top-left comes backnull.readSpreadsheetcarries no way to know (ui-packages/web/src/formats/xlsx.ts:4,Worksheet = { name, rows }), and the boundary drops the workbook's own<mergeCells>record without looking.- The grid renders each cell as it comes (
sheet-grid.tsx:89,cellText(rows[i][j])), so a merged header shows one label followed by a run of blank squares — indistinguishable from a half-empty sheet. - The agent reads the same blanks:
sheetText(xlsx.ts:80) turns eachnullinto an empty tab-separated field, so asking about the columns under that header, the model cannot tell a merged continuation from a genuinely empty cell.
Merged headers are standard in forms, financial layouts and grouped reports — the very documents a reader brings to check against. Both surfaces misstate the sheet in the same direction, and neither says anything is missing.
Proposal
- Recover the merge ranges the way Show spreadsheet numbers as the sheet states them — a percent cell reads 0.153 where Excel says 15.3%, for reader and assistant alike #161 proposes to recover number formats: pre-read the workbook zip and take
<mergeCells>from eachxl/worksheets/sheetN.xml, keyed beside the rowsread-excel-filereturns. - In the grid, let a merged range render as one cell spanning its area (or visually continue the top-left value), so the header reads as the author laid it out.
- In
sheetText, state the merge for the agent — e.g. fill continuation cells with the top-left value, or mark them as merged with their anchor — so "which column is Q1" has one true answer.
Goal
After this, a grouped header shows as grouped in the preview and sheet_read/sheetText say which cells a merge covers, so no merged cell reads as a blank in either surface, and reader and assistant agree on the sheet's structure.
Verification
# fixture workbook with a merged header row (e.g. B2:D2 merged as "Q1");
# the grid shows one spanning cell and sheetText states the merge, not blanks
grep -rqiE "merge" ui-packages/web/src/formats/xlsx.ts ui-packages/web/src/features/reader/xlsx-reader/sheet-grid.tsx
cd ui-packages/web && pnpm vitest run --project unit src/formats/xlsx.test.tsRefs
ui-packages/web/src/formats/xlsx.ts:4—Worksheetwithout merge knowledgeui-packages/web/src/features/reader/xlsx-reader/sheet-grid.tsx:89— blank-by-blank renderingui-packages/web/src/formats/xlsx.ts:80—sheetText, the agent's view of the same blanksread-excel-file@9.3.10modules/xlsx/parseSheet.js:343-351— merged cells explicitly unparsed upstreamui-packages/web/src/formats/docx-unconverted.ts— the zip pre-read precedent this needs (as Show spreadsheet numbers as the sheet states them — a percent cell reads 0.153 where Excel says 15.3%, for reader and assistant alike #161 noted)- Show spreadsheet numbers as the sheet states them — a percent cell reads 0.153 where Excel says 15.3%, for reader and assistant alike #161, Show spreadsheet cells that hold an error or an unsolved formula — today both render blank to reader and assistant #157 — siblings in the same sheet-fidelity theme: this one loses the shape, those lose the value and its scale
Activity
bencode commentedon Oct 22, 2026
Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against
main@ebb0ee0.Evidence audit: all citations confirmed, including the upstream library quote.
formats/xlsx.ts:3—Worksheet = { name, rows }(cited :4, one-line drift; substance exact), no merge knowledge anywhere in the boundary.formats/xlsx.ts:82—sheetText(cited :80, two-line drift) maps every cell throughcellText, so a merged continuation reads as an empty field to the agent — the claim holds end-to-end.sheet-grid.tsx:89—<td>{cellText(rows[i]?.[column] ?? null)}</td>confirmed at this HEAD in the Show spreadsheet cells that hold an error or an unsolved formula — today both render blank to reader and assistant #157 audit; blank-by-blank rendering unchanged.read-excel-file@9.3.10 modules/xlsx/parseSheet.js:343-351— the maintainer's own comment leaves merged cells unparsed, top-left value only,nullfor the rest; the commented-outgetMergedCellCoordinatescode is even there for reference.xl/styles.xml+numFmtsvia thedocx-unconverted.tsprecedent) — this proposal rides the same mechanism for<mergeCells>.Duplicate check: none — #161 loses the value's scale, #157 its errors, this one its shape; three orthogonal losses in one theme, correctly cross-referenced as siblings. Nothing open or closed covers merged cells.
Verification block repaired (logged here per policy): the block ran only the existing
xlsx.test.ts, which passes on unmodified main — verify reported "implemented" with nothing implemented (the #157/#158/#167/#169 disease in false-pass form; the fixture description is a comment, invisible to the gate). Prepended:grep -rqiE "merge" ui-packages/web/src/formats/xlsx.ts ui-packages/web/src/features/reader/xlsx-reader/sheet-grid.tsxZero matches today ✓; any implementation must speak of merges on the format boundary or the grid. Re-linted ✓; verify now correctly fails on main ✓.
Verdict: valid, keep open. The two-surface claim (reader and assistant misread alike) is verified both directions. Sharpening: the fixture is the load-bearing half — build it first (a workbook whose header is
B2:D2merged as "Q1"), and decidesheetText's agent-facing convention deliberately: repeating the anchor value in continuation cells is machine-friendlier than a marker string and matches whatparseSheet.js's maintainer mused about; whichever is chosen, the grid andsheetTextmust agree, or reader and agent will trade one disagreement for another.