Skip to content

Tables: Select All then Delete removes a table the document starts with; right-click Delete offers Delete Table again - #1202

Merged
echelon merged 2 commits into
storytold:mainfrom
marcoarnulfo:fix/delete-tables-select-all
Oct 14, 2026
Merged

echelon merged 2 commits into
storytold:mainfrom
marcoarnulfo:fix/delete-tables-select-all

Conversation

@marcoarnulfo

Copy link
Copy Markdown
Contributor

Fixes #1198.

Two separate causes. Ctrl+A in a document that starts with a table puts the selection's start inside the table's first cell, and delete_range only dropped covered tables when the range began outside a table, so Delete/Backspace emptied the cells and left the table. It now handles the other direction too: a range from the very start of a top-level table to a top-level paragraph removes the covered tables and joins what's left. The right-click part is from #694 (284818b), which replaced the old Delete › Rows / Columns / Table submenu with one item that follows the selection, so with just the caret in a cell the menu only offered Delete Cells and there was no way to delete the table from it. Delete is a submenu again (Cells, Columns, Rows, Table), like the Delete button Word shows on right-click; the rest of #694's selection-dependent items are unchanged. Happy to switch to showing only Delete Table next to the selection's own item if you'd rather keep the menu shorter.

Validation:

  • tests_typing::select_all_then_delete_removes_tables: fails on main (the table at the document start survives, left: 1, right: 0), passes here
  • canvas::tests::a_right_click_in_a_cell_deletes_the_table: fails on main (no Delete Table in the menu with the caret in a cell), passes here; the two existing context-menu tests are updated for the submenu
  • cargo clippy -p wordcraft-doc -p wordcraft-engine -p wordcraft-ui-egui --all-targets -- -D warnings, cargo fmt --all -- --check
  • (macOS, Apple silicon)

marcoarnulfo and others added 2 commits October 13, 2026 06:12
…th; right-click Delete offers Delete Table again (fixes storytold#1198)
# Conflicts:
#	crates/engine/src/tests_typing.rs
#	docs/typing-parity.md
#	docs/ui-parity.md
@echelon
echelon merged commit 70a4917 into storytold:main Oct 14, 2026
3 checks passed
@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution, @marcoarnulfo! This has landed in main. If you haven't already, come join us on Discord: https://discord.gg/artcraft

echelon added a commit that referenced this pull request Oct 14, 2026
… selected

#1202's test selected all once with the caret in a table; since #1478,
Select All in a table grows a step at a time (cell, row, table,
document), so one press selected only the cell and the table stayed.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

Tables don't Delete correctly

2 participants