Skip to content

Grid: deleting several Ctrl-selected rows removes them all (#758) - #766

Merged
h-a-n-a-s-h-i merged 2 commits into
storytold:mainfrom
vangel76:fix/multi-row-delete-758
Oct 13, 2026
Merged

h-a-n-a-s-h-i merged 2 commits into
storytold:mainfrom
vangel76:fix/multi-row-delete-758

Conversation

@vangel76

Copy link
Copy Markdown
Contributor

Fixes #758

Root cause

home.deleteRows / home.deleteColumns resolved their target with lines(), which reads only selection.current() (the last area). With Ctrl-selected rows the header-menu Delete therefore removed just the last one.

What changed

  • crates/engine/src/cmd/sheet.rs: new delete_areas() collects every selected area (or a comma list such as "3:3,7:8" in rows/cols), merges overlapping/adjacent ones and orders them last-to-first. delete_lines checks sheet protection for each area, then deletes them all inside a single edit, so it is one undo step. An explicit count keeps the old single-area behaviour. The UI is untouched: the header menu already keeps the multi-selection and calls the command with empty params.
  • ROADMAP.md: progress row and revision row.

Tests / commands run

  • New deleting_a_multi_area_row_selection_removes_every_area_and_undoes_once (rows 2, 4, 5:6 via selection; formula becomes #REF!; one undo restores all; list form for columns).
  • cargo test -p gridcraft-engine --lib (230 passed), cargo clippy -p gridcraft-engine --all-targets -- -D warnings, cargo fmt -p gridcraft-engine.

Not done

🤖 Generated with Claude Code

vangel76 and others added 2 commits October 12, 2026 19:24
…#758)

home.deleteRows/deleteColumns used only the last selected area. They now
take every area (or a comma list like "3:3,7:8"), merge them and delete
from the last to the first inside one edit, so it is one undo step.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts:
#	ROADMAP.md
#	crates/engine/src/cmd/sheet.rs
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 6126695 into storytold:main Oct 13, 2026
1 check failed
@echelon

echelon commented Oct 13, 2026

Copy link
Copy Markdown
Member

Merged — thank you @vangel76 for the contribution!

I merged main into your branch and resolved the conflicts with PRs that landed first (and adjusted tests where the combination needed it).

GhostMitra added a commit to GhostMitra/gridcraft that referenced this pull request Oct 13, 2026
…d#766 parity)

Desktop and web start on Backstage Home (Blank workbook, templates, Recent)
when no file, --sample or --control is given; Esc/back leaves the empty blank
workbook. File › Options › General › Start-up checkbox (ui.startScreen, kept
between runs, default on). SheetApp::new is unchanged; hosts opt in via
SheetApp::start_screen.
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.

[Bug] Deleting multiple Ctrl-selected rows only removes the last selected row

3 participants