From ab9285f11411d7f2749678472a01172db14a2330 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Mon, 29 Jun 2026 11:20:01 +0300 Subject: [PATCH] feat(viewport): run typed command-line text on right-click When the command line holds a typed-but-unentered command (or option keyword / value), a viewport right-click now runs it, mirroring Enter. Routed through CommandFinalize so the MText preview and grip-popup guards apply and a non-empty line forwards to the submit path. All other right-click behaviour is unchanged and applies only when the command line is empty: right-drag orbits, the first right-click during an active command acts as Enter, a second opens the context menu, and an idle right-click opens the menu. Co-Authored-By: Claude Opus 4.8 --- src/app/update/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/app/update/mod.rs b/src/app/update/mod.rs index 6d0098442..f75ecf66b 100644 --- a/src/app/update/mod.rs +++ b/src/app/update/mod.rs @@ -1125,6 +1125,21 @@ impl OpenCADStudio { if !was_click { return Task::none(); } + // A command name (or option keyword / value) typed into the + // command line but not yet entered runs on right-click, exactly + // as pressing Enter would. Route through CommandFinalize — the + // canonical Enter action — so the same MText / grip-popup guards + // apply and a non-empty line is forwarded to the submit path. + // Without this the typed text would be swallowed by the context + // menu (when idle) or the Enter cycle. Every other right-click + // behaviour below is unchanged and only applies when the command + // line is empty. Pending text always runs and resets the Enter + // cycle so the next right-click acts as Enter again. + if !self.command_line.input.trim().is_empty() { + sel.right_click_entered = false; + drop(sel); + return self.update(Message::CommandFinalize); + } // A right-click (no orbit). While a command is active the first // right-click acts as Enter (commit / close); a second // consecutive right-click opens the context menu instead. When