fix(gui): complete toolbar whitelists in EditingContextResolver #301

Merged
forbes merged 1 commits from fix/toolbar-context-whitelists into main 2026-02-20 18:14:13 +00:00
Owner

Problem

The EditingContextResolver controls toolbar visibility via explicit whitelists — each editing context names the toolbars it wants shown, and all others are hidden. Several context definitions had incomplete lists, causing workbench toolbars to be missing compared to base FreeCAD.

Most visibly, the Part Design workbench was missing the Sketcher toolbar (can't create new sketches from body context), and the lower-priority contexts (empty body, workbench fallback) only showed 2 of the 5 expected toolbars.

Root Cause

In EditingContextResolver::registerBuiltinContexts() (src/Gui/EditingContext.cpp), the .toolbars arrays were incomplete for 6 of the 11 built-in contexts.

Changes

Context Priority Before After
partdesign.feature 40 Helper, Modeling, Dress-Up, Transformation + Sketcher
partdesign.body 30 Helper, Sketcher + Modeling, Dress-Up, Transformation
partdesign.workbench 20 Helper, Sketcher + Modeling, Dress-Up, Transformation
sketcher.workbench 20 Sketcher, Sketcher Tools + Geometries, Constraints, B-Spline Tools, Visual Helpers
assembly.idle 30 Assembly + Assembly Joints, Assembly Management
assembly.workbench 20 Assembly + Assembly Joints, Assembly Management

No changes to sketcher.edit or assembly.edit — those were already correct.

Verification

  • Part Design: body selected → all 5 toolbars (Helper, Modeling, Dress-Up, Transformation, Sketcher)
  • Sketcher workbench: all 6 toolbars visible without entering edit mode
  • Assembly: idle/workbench → Assembly, Joints, and Management toolbars all visible
  • Edit-mode contexts unchanged (sketcher.edit, assembly.edit)
## Problem The `EditingContextResolver` controls toolbar visibility via explicit whitelists — each editing context names the toolbars it wants shown, and all others are hidden. Several context definitions had incomplete lists, causing workbench toolbars to be missing compared to base FreeCAD. Most visibly, the Part Design workbench was missing the Sketcher toolbar (can't create new sketches from body context), and the lower-priority contexts (empty body, workbench fallback) only showed 2 of the 5 expected toolbars. ## Root Cause In `EditingContextResolver::registerBuiltinContexts()` (`src/Gui/EditingContext.cpp`), the `.toolbars` arrays were incomplete for 6 of the 11 built-in contexts. ## Changes | Context | Priority | Before | After | |---------|----------|--------|-------| | `partdesign.feature` | 40 | Helper, Modeling, Dress-Up, Transformation | + **Sketcher** | | `partdesign.body` | 30 | Helper, Sketcher | + **Modeling, Dress-Up, Transformation** | | `partdesign.workbench` | 20 | Helper, Sketcher | + **Modeling, Dress-Up, Transformation** | | `sketcher.workbench` | 20 | Sketcher, Sketcher Tools | + **Geometries, Constraints, B-Spline Tools, Visual Helpers** | | `assembly.idle` | 30 | Assembly | + **Assembly Joints, Assembly Management** | | `assembly.workbench` | 20 | Assembly | + **Assembly Joints, Assembly Management** | No changes to `sketcher.edit` or `assembly.edit` — those were already correct. ## Verification - Part Design: body selected → all 5 toolbars (Helper, Modeling, Dress-Up, Transformation, Sketcher) - Sketcher workbench: all 6 toolbars visible without entering edit mode - Assembly: idle/workbench → Assembly, Joints, and Management toolbars all visible - Edit-mode contexts unchanged (sketcher.edit, assembly.edit)
forbes added 1 commit 2026-02-20 18:13:42 +00:00
fix(gui): complete toolbar whitelists in EditingContextResolver
All checks were successful
Build and Test / build (pull_request) Successful in 29m59s
686d8699c9
The EditingContextResolver controls toolbar visibility via explicit
whitelists per editing context. Several contexts had incomplete lists,
causing workbench toolbars to be missing compared to base FreeCAD.

Changes:

partdesign.feature (priority 40):
  - Add 'Sketcher' toolbar so users can create new sketches from an
    active Body with features

partdesign.body (priority 30):
  - Add Modeling, Dress-Up, and Transformation toolbars (previously
    only showed Helper + Sketcher)

partdesign.workbench (priority 20):
  - Add Modeling, Dress-Up, and Transformation toolbars (same as body)

sketcher.workbench (priority 20):
  - Add Geometries, Constraints, B-Spline Tools, Visual Helpers
    (previously only showed Sketcher + Sketcher Tools)

assembly.idle (priority 30):
  - Add 'Assembly Joints' and 'Assembly Management' toolbars

assembly.workbench (priority 20):
  - Add 'Assembly Joints' and 'Assembly Management' toolbars

No changes to sketcher.edit or assembly.edit contexts — those were
already correct.
forbes merged commit 311b3ea4f1 into main 2026-02-20 18:14:13 +00:00
forbes deleted branch fix/toolbar-context-whitelists 2026-02-20 18:14:13 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#301