Repository navigation
gridcore/gridwasm: 3-D spans shrink on Delete Sheet, x14 DV kept on Any value, wasm sheet.remove rewrites cell formulas (#1734) - #1794
Merged
Conversation
Excel moves a removed end of Jan:Dec!B2 inward to the nearest sheet of the span that stays; the rewrite wrote #REF! instead, and saved it. remove_sheet_refs_in_expr now takes the tab order: a span left with one sheet is a plain reference, one left with none is #REF!. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NQQyxNh6BxvvynDtdq9Yi
…ule (#1734) The dialog shows no Excel 2010 (extLst) validation, so a cell covered only by one opens as Any value, and since #1681 OK there struck the rule the user never saw. set_validation now cuts only the classic rules when the new rule imposes nothing; a real rule still replaces the x14 one and Clear All still removes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NQQyxNh6BxvvynDtdq9Yi
cut_ext_rules skips an element ext_removed already names; no load gives that state, so the guard had no test. Seeded by hand, through both the conditional-format and the validation clear. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NQQyxNh6BxvvynDtdq9Yi
…rites back (#1734) The VS Code/JetBrains tab's sheet.remove called remove_sheet, so cell formulas naming the sheet kept their text while the suite and xlsxy read #REF!. It now calls delete_sheet and stashes each other sheet's cell formula, table calculated formula and in-memory chart it changed; sheet.restore-removed puts back those still as the removal left them, and the engine rebuild recalculates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NQQyxNh6BxvvynDtdq9Yi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NQQyxNh6BxvvynDtdq9Yi
The macro sheet removal goes through the same rewrite, so the #1681 test's Data:Macro1 span now reads Data!A1 rather than #REF!. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NQQyxNh6BxvvynDtdq9Yi
…eet without its recalc (#1734 r1 m1 m2 i1) The callers of remove_sheet_refs_in_expr still said every reference to a removed sheet reads #REF!. delete_sheet_uncalculated is the delete without the recalculation, for a host whose own engine runs the one recalc on its clock (gridwasm did two). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NQQyxNh6BxvvynDtdq9Yi
…oval left it (#1734 r1 M1) The rewrites make a filled column one text (=A!B1*2.. all read #REF!*2), so matching a stashed cell by place and text let a row insert, a delete or a move give a cell another's formula. The stash now keeps what each such sheet's cells held after the removal, and the restore skips a sheet where any of them changed. sheet.remove also runs one recalculation now, the engine rebuild's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NQQyxNh6BxvvynDtdq9Yi
…it kept (#1734 r2) A sheet's cell formulas come back only while the sheet is as the removal left it; the docs said each came back unless it changed, and the reply said nothing when a sheet was skipped. It now lists such sheets in cellsKept, and the docs say the rule and its limit (a rename or a row or column edit elsewhere that rewrote a formula there counts as an edit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NQQyxNh6BxvvynDtdq9Yi
3 tasks
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Owner
Author
|
Merged automatically (auto-merge is on for this checkout): review stopped: round 2 had no Major; 1 minor finding(s) in #1795; merge rounds: none; whole suite green on 691c7c7 (8626 workspace + 2687 suite tests); CI 14/14 passed; merge-check ok. Follow-ups, all in the leftovers issue #1795 (none reported again elsewhere):
No finding ended disputed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1734 (leftovers from #1681 / PR #1733).
What changed
formula::remove_sheet_refs_in_expr(e, removed, order)moves a removed end sheet of a 3-D span inward along the tab order, as Excel does:SUM(Jan:Dec!B2)with Dec deleted isSUM(Jan:Nov!B2); a span left with one sheet is a plain reference (Nov!B2,Nov!B2:C3); none left is#REF!. Applies to cell, table, CF/DV, defined-name and Consolidate rewrites (edit::sheet_ordergives the order before removal). The macro-free save's test expectation from Leftovers from #835: bug: structural edits and sheet renames leave conditional formatting and data validation ranges/formulas unshifted #1681 moved accordingly (SUM(Data:Macro1!A1)→SUM(Data!A1)).validation::set_validationwith a rule that imposes nothing ("Any value", no messages) cuts only classic rules (edit::clear_classic_validation); an Excel 2010 (extLst) rule the dialog cannot show stays. A real rule still replaces it; Clear All still removes it. Both hosts (suite, xlsxy) share this.an_x14_rule_already_named_struck_is_named_onceseedsext_removedand clears through bothclear_cond_formatsandedit::clear_validation.sheet.removeis Delete Sheet (r1-gridwasm). It calls the newSheetPackage::delete_sheet_uncalculated(cell formulas naming the sheet read#REF!; the session's engine does the one recalc). The stash keeps the rewritten cells, table calculated formulas and chart sources;sheet.restore-removedgives them back. A sheet's cell formulas come back only while that sheet is as the removal left it (cell_guards), else they stay and the reply lists the sheet incellsKept.docs/agent-control.mdupdated.Tests
cargo fmt --all --check,cargo clippy -p gridcore -p gridwasm -p xlsxy --all-targets -- -D warnings,cargo test -p gridcore(2066 lib + integration),-p gridwasm(197),-p xlsxy(747+17+2+1),cargo test --manifest-path suite/Cargo.toml(2686+1). No.uitcase covers these paths.Review
#REF!text, so a row insert between remove and restore put formulas in the wrong cells) — fixed with per-sheet cell guards; 2 Minor doc fixes; 1 Immaterial (double recalc) fixed.cellsKeptnow, a tolerant guard deferred as a follow-up.🤖 Generated with Claude Code
https://claude.ai/code/session_011W4RYNZGrXg2wkYTJ9srvr