Skip to content

PR evidence: bounded spreadsheet merge selection

Pre-release
Pre-release

Choose a tag to compare

@voltcrash voltcrash released this 11 Nov 11:59
f7a1bf7

Fixture: merges.xlsx, 15000 non-overlapping two-row merges in alternating A/B columns:
A1:A2, B2:B3, A3:A4, ..., B15000:B15001. Markers in A1 and A15001.
Select A15001:B15001. Its transitive merged selection must be A1:B15001.
In the workbook preview, Ctrl+Home, Ctrl+End, Left, Down lands in A15001; Shift+Right
extends to B15001. Copy must return 15001 TSV rows including both markers.

Helper reproduction (not an application benchmark), Node v26.12.1 on a loaded shared machine:
base: 15000 merges throws RangeError Maximum call stack size exceeded.
fix: same input returns {top:0,bottom:15000,left:0,right:1}.
Timing varies with machine load; no end-to-end latency claim is made.

Unit proof: focused coverMerges regression fails on base and passes on fix.
Additional scratch check: 10000 deterministic small-range comparisons match
original fixed-point expansion. No input mutation and no overlapping input
merges are needed to reproduce the defect.

Independent Browser panel observation on base 1530bec:

  • Real workbook worker layout: 15000 merges; first A1:A2, last B15000:B15001.
  • Native grid keydown path: Ctrl+Home, Ctrl+End, Left, Down, Shift+Right, Ctrl+C.
  • Browser error: Uncaught RangeError: Maximum call stack size exceeded.
  • Clipboard callback never received data.
  • Captured manual-before.png after the failed paint/copy.
    The preview is mounted in an isolated HTML harness using unmodified OfficeFilePreview,
    the real archive preparation worker, and the real spreadsheet/WASM worker. The harness
    only supplies the workbook, observes layout/errors, and captures the clipboard write.
    Full chat app navigation was not used for this proof.

Final integrated result:
scenarios:prove failsOnBase=true (1530bec),
passesOnHead=true (8ccdf9467c27045ce36eae50c407dd9ee35c8d4d).
Independent Browser panel pass on head: 15000 merges, 15001 copied rows,
first marker Chain start, last marker Chain end, errors=[].
Before/after MP4 files are clips of separate scenario recordings, not a timing comparison.
The workbook also contains an unmerged B1 value to establish two used columns for keyboard navigation.

Reproduce in an isolated checkout:

  1. Put merge-proof.html and merges.xlsx in /tmp/t3-merge-proof/.
  2. Apply fixture-setup.patch and put spreadsheet-merge-chain.e2e.ts in scripts/scenarios/.
  3. Run vp run scenarios:prove scripts/scenarios/spreadsheet-merge-chain.e2e.ts --base 1530bec --head 8ccdf9467c27045ce36eae50c407dd9ee35c8d4d
  4. Revert the fixture patch afterwards. None of these proof fixtures is in the PR diff.
    For a manual check, copy the HTML to apps/web/merge-proof.html and the workbook to
    apps/web/public/merge-proof.xlsx, start isolated dev, and open /merge-proof.html.

Verified rebased head when evidence was recorded: 19f52889707a602d3080d23fca29c6c5387ee1e3
apps/web/src/components/files/office/sheet-cells.ts: unchanged blob 458e3ba475e311f32f0315ef8fed5c6c460b2b8e
apps/web/src/components/files/office/sheet-cells.test.ts: unchanged blob 5ed46a3a7b65e80d0821a663f42fd543d1ccb02a