Skip to content

fix(xlsx): every copy of a dynamic array formula pasted or filled as a block spills - #36

Open
pierreneter wants to merge 1 commit into
mainfrom
fix/xlsx-tiled-paste-dynamic
Open

pierreneter wants to merge 1 commit into
mainfrom
fix/xlsx-tiled-paste-dynamic

Conversation

@pierreneter

Copy link
Copy Markdown
Member

Fixes #35.

When the viewer repeats a copied block into a larger selection (tiled paste) or with the fill handle, it moved the formula of each later copy and rebuilt the copied cell with four fields, dropping the fifth: the flag that marks a dynamic array formula. Only the first copy, which reuses the original tuple, spilled.

Both paths now build the later copies with one helper, shiftedClip in src/core/xlsx/clip.ts, which moves the formula and keeps the rest of the copied cell, the flag with it.

Tests:

  • e2e/xlsx.spec.ts: the issue's reproduction (one =SEQUENCE(3) cell pasted into two) and a two-cell block filled right with the fill handle; every copy spills in the viewer, the saved workbook has the spilled values and cm on each copy. Confirmed failing on main, separately for the paste path and for the fill path.
  • test/xlsx-dynamic.test.ts: the helper and a worker paste of a repeated block.

Run in the Linux test VM (Bun 1.4.4): bun run typecheck clean, bun test 1193 pass / 0 fail, e2e/xlsx.spec.ts 42 pass / 0 fail, bun run build ok.

🤖 Generated with Claude Code

…a block spills (#35)

A copied block repeated into a larger selection, or by the fill handle, rebuilt the
later copies' cells without the flag that marks a dynamic array formula: only the
first copy spilled. The copies are now made by one helper that moves the formula
and keeps the rest of the copied cell as it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XLSX tiled paste drops the dynamic-array flag after the first copy

1 participant