From e141fb6df302278391e43fa0468b4f3cbaed12c7 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Sun, 14 Jun 2026 00:42:02 +0300 Subject: [PATCH] fix(command): block drawing commands on the Start tab (#96) The Start (welcome) tab has no drawing, so commands like LINE dispatched from the command line or ribbon ran as silent no-ops. Allow only the commands that make sense there (NEW / OPEN / EXIT / QUIT; OPEN_RECENT is handled earlier) and inform the user otherwise. Co-Authored-By: Claude Opus 4.8 --- src/app/commands.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/commands.rs b/src/app/commands.rs index 1305a31f1..1d17334a3 100644 --- a/src/app/commands.rs +++ b/src/app/commands.rs @@ -28,6 +28,16 @@ impl OpenCADStudio { return Task::done(Message::OpenPathPicked(Some((path, size)))); } + // The Start (welcome) tab has no drawing to act on, so a drawing + // command would silently do nothing. Allow only the commands that + // make sense there (create / open a document, or quit) and tell the + // user otherwise instead of running a no-op. See #96. + if self.tabs[i].is_start && !matches!(cmd, "NEW" | "OPEN" | "EXIT" | "QUIT") { + self.command_line + .push_info("No drawing open. Use NEW or OPEN to start a drawing."); + return Task::none(); + } + if crate::plugin::try_dispatch(self, i, cmd) { return Task::none(); }