From 9e5cdf9e434a141a82d582309934cbb1c276fe9e Mon Sep 17 00:00:00 2001 From: Thiago Date: Fri, 16 Oct 2026 22:22:33 -0300 Subject: [PATCH] Tables: add the missing Resize Table button (#935) table.resize has existed in the engine since #589/#1706 (overlap checks, tests), and the command catalog already promised it under Table Design > Properties, but no ribbon button ever called it -- the only way to resize a table was scripting the command directly (control channel, CLI, MCP). #935 (no drag handle) assumed this menu path worked; it doesn't. Adds a "Resize Table" button next to the Table Name field (same Properties group the catalog already declares), opening a small dialog pre-filled with the table's current range. Confirming runs table.resize with the typed range, same validation as #589/#1706 (rejects overlap with another table, matching Excel's "A table can't overlap another table."). The drag-handle part of #935 is unaddressed; this only restores the menu/dialog path. Verified manually: created two tables, used the new button to grow one onto the other (rejected), then to an adjacent non-overlapping range (accepted, table intact). --- crates/ui-egui/src/dialogs.rs | 18 ++++++++++++++++++ crates/ui-egui/src/ribbon.rs | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index fb899c702..14d9e0a64 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -562,6 +562,24 @@ impl Dialog { defaults, ) } + "tableResize" => { + let (table, range) = app + .session + .active() + .and_then(|d| { + let sh = d.wb.active()?; + let t = sh.table_at(d.selection.active)?; + Some((t.name.clone(), t.range.a1())) + }) + .unwrap_or_default(); + Dialog::form( + "tableResize", + "Resize Table", + "table.resize", + vec![Text { key: "range", label: "New range for the table:" }], + json!({"table": table, "range": range}), + ) + } "dataValidation" => Dialog::form( "dataValidation", "Data Validation", diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index 9c6d89eeb..c84a88dbe 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -2282,6 +2282,11 @@ fn table_design(app: &mut SheetApp, ui: &mut Ui) { act(app, "table.rename", json!({"table": tname, "name": name})); } }); + let __k = big_button(ui, Icon::Table, "Resize\nTable", "Resize Table", false); + control_keytip(app, ui, &__k, "dialog:tableResize"); + if __k.clicked() { + app.open_dialog("tableResize", json!({})); + } sep(ui); let __k = big_button(ui, Icon::Duplicates, "Remove\nDuplicates", "Remove Duplicates", false); control_keytip(app, ui, &__k, "data.removeDuplicates");