feat(create): silo tree foundation for .kc files #268

Merged
forbes merged 1 commits from feat/silo-tree-foundation into main 2026-02-18 22:38:24 +00:00
Owner

Summary

Add document tree infrastructure that creates Silo metadata nodes in the FreeCAD model tree when a .kc file is opened. Phase 1 of the Silo Metadata Viewport — tree nodes only, no viewer widgets yet.

Changes

New files (4):

  • silo_objects.pySiloViewerObject proxy with 3 Transient properties (SiloPath, ContentType, RawContent)
  • silo_viewproviders.pySiloViewerViewProvider with icon resolution stubs and no-op doubleClicked
  • silo_tree.pySiloTreeBuilder with conditional node creation per spec §3.2 (manifest always present; history, approvals, dependencies gated on content checks; jobs/macros as subgroups)
  • silo_document.pySiloDocumentObserver singleton with slotCreatedDocument + slotActivateDocument fallback + bootstrap loop for early-opened documents

Modified files (3):

  • kc_format.py_pre_reinject_hooks callback system allowing other modules to mutate silo/ cache entries before ZIP write-back
  • InitGui.py — 600ms QTimer.singleShot registration for the document observer (after 500ms kc_format, before 1500ms silo_origin)
  • CMakeLists.txt — 4 new .py files added to install list

Key design decisions:

  • All Silo properties are Transient — no content written to Document.xml, only minimal object stubs
  • QTimer.singleShot(0, ...) deferred restore pattern (no slotFinishRestoreDocument in Python API)
  • Conditional nodes: History requires non-empty revisions array, Approvals requires non-null eco, Dependencies requires non-empty links array
  • Headless-safe: ViewProvider attachment guarded by FreeCADGui import try/except

Closes kindred/silo-mod#37

Checklist

  • Commit messages follow conventional commits (feat:, fix:, chore:, docs:, art:)
  • Code follows project style (clang-format for C++, black for Python)
  • Changes are tested locally
  • Documentation updated (if applicable)
## Summary Add document tree infrastructure that creates Silo metadata nodes in the FreeCAD model tree when a `.kc` file is opened. Phase 1 of the Silo Metadata Viewport — tree nodes only, no viewer widgets yet. ## Changes **New files (4):** - `silo_objects.py` — `SiloViewerObject` proxy with 3 Transient properties (`SiloPath`, `ContentType`, `RawContent`) - `silo_viewproviders.py` — `SiloViewerViewProvider` with icon resolution stubs and no-op `doubleClicked` - `silo_tree.py` — `SiloTreeBuilder` with conditional node creation per spec §3.2 (manifest always present; history, approvals, dependencies gated on content checks; jobs/macros as subgroups) - `silo_document.py` — `SiloDocumentObserver` singleton with `slotCreatedDocument` + `slotActivateDocument` fallback + bootstrap loop for early-opened documents **Modified files (3):** - `kc_format.py` — `_pre_reinject_hooks` callback system allowing other modules to mutate `silo/` cache entries before ZIP write-back - `InitGui.py` — 600ms `QTimer.singleShot` registration for the document observer (after 500ms kc_format, before 1500ms silo_origin) - `CMakeLists.txt` — 4 new `.py` files added to install list **Key design decisions:** - All Silo properties are Transient — no content written to `Document.xml`, only minimal object stubs - `QTimer.singleShot(0, ...)` deferred restore pattern (no `slotFinishRestoreDocument` in Python API) - Conditional nodes: History requires non-empty `revisions` array, Approvals requires non-null `eco`, Dependencies requires non-empty `links` array - Headless-safe: ViewProvider attachment guarded by `FreeCADGui` import try/except ## Related Issues Closes kindred/silo-mod#37 ## Checklist - [x] Commit messages follow [conventional commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `chore:`, `docs:`, `art:`) - [x] Code follows project style (clang-format for C++, black for Python) - [x] Changes are tested locally - [ ] Documentation updated (if applicable)
forbes added 1 commit 2026-02-18 22:36:56 +00:00
feat(create): silo tree foundation for .kc files (#37)
All checks were successful
Build and Test / build (pull_request) Successful in 29m13s
65f24b23eb
Add document tree infrastructure that creates Silo metadata nodes when
a .kc file is opened. Nodes appear under a "Silo" group and represent
the silo/ ZIP directory entries (manifest, metadata, history, etc.).

New files:
- silo_objects.py: SiloViewerObject proxy with Transient properties
- silo_viewproviders.py: SiloViewerViewProvider with icon stubs
- silo_tree.py: SiloTreeBuilder with conditional node creation
- silo_document.py: SiloDocumentObserver singleton + registration

Modified files:
- kc_format.py: pre_reinject hook system for silo/ entry mutation
- InitGui.py: 600ms timer registration for document observer
- CMakeLists.txt: install list for 4 new Python files

Closes #37
forbes merged commit d87b79698f into main 2026-02-18 22:38:24 +00:00
forbes deleted branch feat/silo-tree-foundation 2026-02-18 22:38:25 +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#268