Repository navigation
Closed
Labels
Description
Problem
A cell Excel shows as 15.3% Gamma Reader shows as 0.153; ¥12,345.60 shows as 12345.6; a value rounded by its format to 2.35 shows its floating-point noise. The number format that states what a number means is dropped on the way in:
read-excel-file(9.3.10) consults cell styles only to decide date-vs-number (modules/xlsx/parseCell.js:236–249); every other format — percent, currency, fixed decimals — is discarded and the raw serial value returned.readSpreadsheetcarries no formats out (ui-packages/web/src/formats/xlsx.ts:127,Worksheet = { name, rows }), andcellTexthas no formatting knowledge (xlsx.ts:74–79), so both the grid (sheet-grid.tsx:89) and the agent'ssheet_read/sheetText(features/assistant/xlsx/tools.ts) render the raw number.- The loss is not cosmetic: a percent column read as
0.053is ambiguous — the reader cannot tell 5.3% from 0.053%, and neither can the assistant, because the format that disambiguated it is gone before either sees it. Dates, notably, do get faithful treatment (xlsx.ts:67–70) — the product already cares about format fidelity where the parser helps.
Proposal
- Read the workbook's
xl/styles.xml+numFmtsalongside the cells — the same pre-read-the-zip precedentdocx-unconverted.tsset for Word — and map each cell to its format code. - Apply a minimal formatter for the common classes the way the sheet states them: percent (
15.3%, value × 100 with the format's decimals), currency and thousands-grouped fixed decimals, plain raw number otherwise. - Route the formatted text through
cellTextso the grid,sheetText(read/search) andsheet_readall state the same value the reader would see in Excel.
Goal
After this, a percent-formatted cell renders 15.3% and a currency cell ¥12,345.60 in the preview, and sheet_read returns the same text — no cell whose format states a scale or precision reads as a different-looking raw number.
Verification
# the format knowledge must exist in the deliverable before the tests can see it;
# fails today (cellText emits 0.153 via String(value)), passes once numFmt mapping lands
grep -rqiE 'numFmt|formatCode|percent|currency|Intl\.NumberFormat' ui-packages/web/src/formats/xlsx.ts
# fixture workbook with percent- and currency-formatted cells;
# grid text and sheetText state "15.3%" / "12,345.60" instead of 0.153 / 12345.6
cd ui-packages/web && pnpm vitest run --project unit src/formats/xlsx.test.tsRefs
ui-packages/web/src/formats/xlsx.ts:74—cellText, where both paths meetui-packages/web/src/formats/xlsx.ts:127—readSpreadsheet, formats dropped at the boundaryread-excel-file@9.3.10,modules/xlsx/parseCell.js:236— styles used only for date detectionui-packages/web/src/formats/docx-unconverted.ts— the zip pre-read precedent for recovering what the stock parser drops- Sibling of Show spreadsheet cells that hold an error or an unsolved formula — today both render blank to reader and assistant #157 (same value-fidelity theme in spreadsheets: that cell is hidden, this one misstates its scale); the docx counterpart of the principle is Tell readers which Word content did not convert, instead of logging it to the browser console #45
ui-packages/web/PRODUCT.mdBrand Personality — "Calm, precise, approachable": precise is the word at stake
Activity
bencode commentedon Oct 21, 2026
Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session.
Evidence audit (main @
ebb0ee0): all citations hold.cellTexthas no formatting knowledge —String(value)for numbers (formats/xlsx.ts:74–79); dates are the existing fidelity precedent (xlsx.ts:66–70).readSpreadsheetdrops formats at the boundary — returns{ name, rows }only (xlsx.ts:127–131).read-excel-file@9.3.10consults styles solely for date-vs-number; every other format discards to the raw serial (modules/xlsx/parseCell.js:236–249).cellText(sheet-grid.tsx:89).sheetText/workbookTextlive informats/xlsx.ts(workbookText feeds the generic read/search tools);sheet_readreachescellTextviaselectCells(xlsx.ts:115–122) imported byfeatures/assistant/xlsx/tools.ts. All paths do meet atcellText, so the seam is right — the ref just shouldn't implysheetTextlives in tools.ts.Sensor: lint passed.
verify"passed" is a false positive — the citedxlsx.test.tspasses on main only because it contains no percent/currency assertions yet;cellTexttoday emits0.153.Sharpening suggestions:
15.3%in grid text andsheetText"), so the verify gate distinguishes implemented from vacuous pass.xl/styles.xmlnumFmtsandcellXfs/@numFmtId— builtin ids (0x08 currency, 0x09/0x0A percent) don't appear innumFmts, only custom ones do.cellTextcovers grid,sheetTextandselectCells(sheet_read) at one seam — confirmed the right choice.Duplicates: none in open+closed titles — #157 is the hidden-cell sibling, distinct failure mode.
Verdict: valid — stays open.
bencode commentedon Oct 25, 2026
Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against
main@90b046f.Evidence audit: anchors hold. No commit since the first review (
ebb0ee0→90b046f) touchesformats/xlsx.ts;cellText(:74-79) still doesString(value),readSpreadsheet(:127-131) still drops formats, and the grid still renders throughcellText(sheet-grid.tsx:89, loop variable renamedi→item.index— cosmetic). Code confirms not implemented: nonumFmt/percent/currency/Intl.NumberFormatanywhere informats/xlsx.ts.Duplicate check: still none — #157 (hidden cells) is the sibling, distinct failure mode; no other percent/format issue in open+closed.
Verification block repaired (logged here per policy): verify was passing vacuously —
xlsx.test.tsruns 14 tests that pass on unmodified main, so the gate reported nothing implemented as implemented (same disease the #157 repair fixed). Prepended a discriminating grep over the deliverable surface:grep -rqiE 'numFmt|formatCode|percent|currency|Intl\.NumberFormat' ui-packages/web/src/formats/xlsx.tsIt fails today ✓, re-linted ✓, verify now fails today ✓ (was falsely passing). Any implementation must touch number-format knowledge in
formats/xlsx.ts, whichever spelling it chooses.Verdict: valid, stays open. The first review's sharpenings stand: name the fixture/test titles, and remember builtin numFmt ids (0x08/0x09/0x0A) live only in
cellXfs/@numFmtId, not innumFmts.