Donate, Send Feedback, OCS Web and Manage > About all answered "No drawing open — use New or Open first." and did nothing. Two doors guarded the welcome tab and the outer one shadowed the inner. `dispatch_command` already knew which commands stand alone — About, Donate, Report and the links were all on its list — but `on_ribbon_tool_click` refused every ribbon event before dispatch was ever reached. The welcome page's own buttons emit RibbonToolClick, so they are only ever clickable while `is_start` holds: the refusal covered exactly the case they exist in, and they had never worked. New Drawing / Open File / Plugins send their own messages, which is why the page still looked alive. So the ribbon door now defers commands to dispatch and keeps refusing only what touches the scene. The policy stays in one place instead of being half-remembered in two. A drawing tool is still turned away on the welcome tab (#299) — the wording just comes from dispatch now. The same gap was swallowing tools the issues never mentioned: CUI and ALIASEDIT configure the application, not a drawing, and were missing from the list, so fixing only the ribbon door would have moved their refusal one door down rather than removing it. HELP and CUILOAD / CUIIMPORT join them. The new test drives the real message path and fails on the old code with the reported wording. It reads the allowlist from source rather than dispatching DONATE / REPORT / WEBVERSION, which shell out to a browser — that also fails the day someone adds a welcome-page button and forgets the list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
b3bd93d8c5
commit
f028e93a33
3 changed files with 132 additions and 6 deletions
|
|
@ -103,6 +103,11 @@ impl OpenCADStudio {
|
|||
// 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.
|
||||
// Anything that acts on the application rather than a drawing belongs
|
||||
// here: document lifecycle, the links, and the app-wide configuration
|
||||
// editors (shortcuts, aliases) — none of them read the scene. This is
|
||||
// the single place that decides; `on_ribbon_tool_click` defers to it
|
||||
// rather than keeping a second, blunter copy (#388, #389).
|
||||
if self.tabs[i].is_start
|
||||
&& !matches!(
|
||||
cmd,
|
||||
|
|
@ -117,6 +122,11 @@ impl OpenCADStudio {
|
|||
| "PLUGINMANAGER"
|
||||
| "DONATE"
|
||||
| "WEBVERSION"
|
||||
| "HELP"
|
||||
| "CUI"
|
||||
| "ALIASEDIT"
|
||||
| "CUILOAD"
|
||||
| "CUIIMPORT"
|
||||
)
|
||||
{
|
||||
self.command_line
|
||||
|
|
|
|||
Loading…
Reference in a new issue