From b0f21ed2cb85613050b794bf6c78a7c367a94e0d Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Mon, 14 Sep 2026 15:47:53 -0400 Subject: feat: add cursor-based editing to text inputs (#3698) * feat: add cursor-based editing to text inputs refs #1803 * fix: preserve dialog actions with associated text refs #1803 * refactor: simplify text editor outcomes and tests refs #1803 --------- Co-authored-by: JJ Liebig --- src/client/shell/context_menu.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/client/shell/context_menu.rs') diff --git a/src/client/shell/context_menu.rs b/src/client/shell/context_menu.rs index 926510c5..96f57178 100644 --- a/src/client/shell/context_menu.rs +++ b/src/client/shell/context_menu.rs @@ -240,8 +240,7 @@ impl ClientShellState { if let Some(label) = label { self.overlay = Some(ClientShellOverlay::Rename(ClientRenameOverlay { title: "rename workspace", - input: label, - replace_on_type: false, + input: TextEditor::new(&label, false), target: ClientRenameTarget::Workspace { workspace_id }, })); } @@ -322,8 +321,7 @@ impl ClientShellState { .to_string(); self.overlay = Some(ClientShellOverlay::Rename(ClientRenameOverlay { title: "new tab", - input: default_name.clone(), - replace_on_type: true, + input: TextEditor::new(&default_name, true), target: ClientRenameTarget::NewTab { workspace_id, default_name, @@ -350,8 +348,7 @@ impl ClientShellState { if let Some(tab) = tab { self.overlay = Some(ClientShellOverlay::Rename(ClientRenameOverlay { title: "rename tab", - input: tab.label.clone(), - replace_on_type: false, + input: TextEditor::new(&tab.label, false), target: ClientRenameTarget::Tab { tab_id, auto_name: !tab.custom_label, @@ -392,8 +389,7 @@ impl ClientShellState { }); self.overlay = Some(ClientShellOverlay::Rename(ClientRenameOverlay { title: "rename pane", - input: label.clone().unwrap_or_default(), - replace_on_type: label.is_none(), + input: TextEditor::new(label.as_deref().unwrap_or_default(), label.is_none()), target: ClientRenameTarget::Pane { pane_id }, })); } -- cgit v1.2.3