From cf4074b0f2d5ab77bb95bd90064c5b0de784a991 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Sat, 11 Jul 2026 10:11:28 +0300 Subject: [PATCH] fix(ribbon): make command icons inert on the Start page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the Start page there is no drawing to act on, but ribbon panel command icons still dispatched into the empty welcome tab. Guard on_ribbon_tool_click: when the active tab is the Start page, close any open flyout, show a "use New or Open first" hint, and do nothing. The quick-access New / Open / Save buttons use a separate path and stay available, as do the welcome page's own actions. The icons are not yet visually greyed out (that needs an enabled flag threaded through the ribbon render) — this stops them from running. Refs #299 Co-Authored-By: Claude Opus 4.8 --- src/app/update/dialog.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/update/dialog.rs b/src/app/update/dialog.rs index 67c523574..afdffd887 100644 --- a/src/app/update/dialog.rs +++ b/src/app/update/dialog.rs @@ -91,6 +91,17 @@ impl OpenCADStudio { pub(super) fn on_ribbon_tool_click(&mut self, tool_id: String, event: ModuleEvent) -> Task { + // On the Start page there is no drawing to act on — ribbon + // commands are inert. Point the user at New / Open instead of + // running a command into the empty welcome tab (#299). The + // quick-access New / Open / Save buttons use a separate path and + // stay available. + if self.tabs[self.active_tab].is_start { + self.ribbon.close_dropdown(); + self.command_line + .push_info("No drawing open — use New or Open first."); + return Task::none(); + } // Dismiss any open dropdown / collapsed-panel flyout on tool use, // and remember this tool as its panel's last-used one. self.ribbon.close_dropdown();