feat(sdk): KCSDK panel provider, theme engine, and breadcrumb fix (#352, #353) #360

Merged
forbes merged 3 commits from feat/kcsdk-scaffold into main 2026-02-28 21:00:58 +00:00
Owner

Summary

Continues the KCSDK epic (#346) with panel provider support (#352), C++ theme engine (#353), and a breadcrumb initialization fix.

Panel Provider (#352)

  • IPanelProvider: abstract interface for dock panels
  • PyIPanelProvider / PyProviderHolder: pybind11 trampoline + GIL-safe holder for Python subclasses
  • WidgetBridge: PySide QWidget → C++ QWidget* conversion via Shiboken
  • SDKRegistry: panel registration, creation, and lifecycle management
  • dock.py: kcsdk delegation with FreeCADGui fallback

Theme Engine (#353)

  • ThemeEngine: C++ singleton with minimal YAML parser, palette cache, and color lookup
  • API: loadPalette(), getColor(), allTokens(), formatQss()
  • Matches Python Palette API (roles first, then colors)
  • kcsdk bindings: theme_color, theme_tokens, format_qss, load_palette
  • theme.py: kcsdk delegation with Python YAML fallback

Breadcrumb Fix

  • EditingContextResolver constructor now calls refresh() to resolve initial context
  • Previously, d->current was empty on construction, causing the breadcrumb navbar to appear blank until the first signal fired

Documentation

  • docs/src/reference/kcsdk-python.md: full kcsdk Python API reference
  • docs/src/development/writing-an-addon.md: step-by-step addon developer guide
  • Updated ARCHITECTURE.md, INTEGRATION_PLAN.md, SUMMARY.md

Build

pixi run cmake --build build/debug --target KCSDK kcsdk_py -j4

All 16 new kcsdk symbols verified via import test.

## Summary Continues the KCSDK epic (#346) with panel provider support (#352), C++ theme engine (#353), and a breadcrumb initialization fix. ### Panel Provider (#352) - `IPanelProvider`: abstract interface for dock panels - `PyIPanelProvider` / `PyProviderHolder`: pybind11 trampoline + GIL-safe holder for Python subclasses - `WidgetBridge`: PySide QWidget → C++ QWidget* conversion via Shiboken - `SDKRegistry`: panel registration, creation, and lifecycle management - `dock.py`: kcsdk delegation with FreeCADGui fallback ### Theme Engine (#353) - `ThemeEngine`: C++ singleton with minimal YAML parser, palette cache, and color lookup - API: `loadPalette()`, `getColor()`, `allTokens()`, `formatQss()` - Matches Python `Palette` API (roles first, then colors) - kcsdk bindings: `theme_color`, `theme_tokens`, `format_qss`, `load_palette` - `theme.py`: kcsdk delegation with Python YAML fallback ### Breadcrumb Fix - `EditingContextResolver` constructor now calls `refresh()` to resolve initial context - Previously, `d->current` was empty on construction, causing the breadcrumb navbar to appear blank until the first signal fired ### Documentation - `docs/src/reference/kcsdk-python.md`: full kcsdk Python API reference - `docs/src/development/writing-an-addon.md`: step-by-step addon developer guide - Updated ARCHITECTURE.md, INTEGRATION_PLAN.md, SUMMARY.md ### Build ```bash pixi run cmake --build build/debug --target KCSDK kcsdk_py -j4 ``` All 16 new kcsdk symbols verified via import test.
forbes added 3 commits 2026-02-28 20:54:13 +00:00
- IPanelProvider: abstract interface for dock panels with PySide widget bridging
- PyIPanelProvider/PyProviderHolder: pybind11 trampoline + GIL-safe holder
- WidgetBridge: PySide QWidget → C++ QWidget* conversion via Shiboken
- SDKRegistry: panel registration, creation, and lifecycle management
- ThemeEngine: C++ singleton with minimal YAML parser, palette cache,
  getColor/allTokens/formatQss matching Python Palette API
- kcsdk bindings: DockArea, PanelPersistence enums, panel functions,
  theme_color, theme_tokens, format_qss, load_palette
- dock.py: kcsdk delegation with FreeCADGui fallback
- theme.py: kcsdk delegation with Python YAML fallback
EditingContextResolver constructor did not call refresh(), leaving
d->current as a default empty EditingContext. When BreadcrumbToolBar
queried currentContext() on creation, it received an empty context
with no breadcrumb segments, causing the navbar to appear blank.

Add refresh() at end of constructor so the initial state is resolved
before any View3DInventor queries it.
docs(sdk): add KCSDK API reference and addon developer guide
All checks were successful
Build and Test / build (pull_request) Successful in 29m17s
5a0be2804d
- docs/src/reference/kcsdk-python.md: full kcsdk Python API reference
- docs/src/development/writing-an-addon.md: step-by-step addon guide
- docs/INTEGRATION_PLAN.md: add Phase 7 KCSDK section
- docs/ARCHITECTURE.md: add src/Gui/SDK/ to source layout
- docs/src/SUMMARY.md: add new pages to mdBook navigation
forbes merged commit abfd939d2c into main 2026-02-28 21:00:58 +00:00
forbes deleted branch feat/kcsdk-scaffold 2026-02-28 21:00:58 +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#360