feat(kc): Manifest Viewer — read-only metadata display in MDI viewport #38

Closed
opened 2026-02-18 21:15:23 +00:00 by forbes · 0 comments
Owner

Summary

Implement the first viewer widget: a read-only Manifest viewer that opens in an MDI subwindow when the user double-clicks the "Manifest" node in the Silo tree. This proves the full doubleClicked() → MDI subwindow pipeline that all subsequent viewers will use.

Background

Phase 1 (issue #37) creates the Silo tree nodes but doubleClicked() is a no-op. This phase wires the viewer widget factory and delivers the simplest possible viewer — a read-only form displaying silo/manifest.json fields.

Scope

New files

File Purpose
src/Mod/Create/silo_viewers.py create_viewer_widget(obj) factory function that routes SiloPath to the appropriate viewer class. Initially contains only SiloManifestViewer.

Modified files

File Change
src/Mod/Create/silo_viewproviders.py Wire doubleClicked() to call create_viewer_widget(), open the result in an MDI subwindow via mw.findChild(QMdiArea).addSubWindow(widget). Implement subwindow deduplication using _silo_object_name attribute.
src/Mod/Create/CMakeLists.txt Add silo_viewers.py to install list.

Widget specification

┌──────────────────────────────────────────────────┐
│  Silo Manifest                                   │
├──────────────────────────────────────────────────┤
│  Part UUID      550e8400-e29b-41d4-a716-...  [⧉] │
│  Silo Instance  https://silo.example.com     [⧉] │
│  Revision Hash  a1b2c3d4e5f6                     │
│  KC Version     1.0                              │
│  Created        2026-02-13 19:00 UTC             │
│  Modified       2026-02-13 20:30 UTC             │
│  Created By     joseph                           │
└──────────────────────────────────────────────────┘
  • Layout: QWidget with QFormLayout
  • Fields: All read-only QLabel values
  • Copy buttons: QToolButton with clipboard icon for Part UUID and Silo Instance fields
  • Tab title: "Silo — Manifest"
  • Theme: Inherits from KindredCreate.qss (Catppuccin Mocha), no custom QSS needed
  • Tree icon: silo-manifest.svg (Blue #89b4fa) — uses fallback empty string if SVG not yet created

MDI subwindow management

mw = FreeCADGui.getMainWindow()
mdi = mw.findChild(QtWidgets.QMdiArea)

# Reuse existing subwindow if already open for this object
for sub in mdi.subWindowList():
    if getattr(sub, "_silo_object_name", None) == obj.Name:
        mdi.setActiveSubWindow(sub)
        return True

sub = mdi.addSubWindow(widget)
sub._silo_object_name = obj.Name
sub.setWindowTitle(f"Silo — {obj.Label}")
sub.show()
return True

Acceptance criteria

  • Double-clicking "Manifest" in the Silo tree opens a viewport tab with the form layout
  • All manifest.json fields are displayed with correct labels and values
  • Copy buttons copy UUID and Silo Instance to clipboard
  • Double-clicking "Manifest" again activates the existing tab (no duplicate)
  • Closing the tab and double-clicking again opens a fresh tab
  • Widget inherits Catppuccin Mocha theme from the application stylesheet

Dependencies

  • Phase 1 foundation (#37)

References

  • docs/KC_SPECIFICATION.md §4.1 (silo/manifest.json schema)
  • docs/SILO_VIEWPORT_PLAN.md Phase 2
  • Silo Metadata Viewport Specification §5.1 (Manifest Viewer)
## Summary Implement the first viewer widget: a read-only Manifest viewer that opens in an MDI subwindow when the user double-clicks the "Manifest" node in the Silo tree. This proves the full `doubleClicked()` → MDI subwindow pipeline that all subsequent viewers will use. ## Background Phase 1 (issue #37) creates the Silo tree nodes but `doubleClicked()` is a no-op. This phase wires the viewer widget factory and delivers the simplest possible viewer — a read-only form displaying `silo/manifest.json` fields. ## Scope ### New files | File | Purpose | |------|---------| | `src/Mod/Create/silo_viewers.py` | `create_viewer_widget(obj)` factory function that routes `SiloPath` to the appropriate viewer class. Initially contains only `SiloManifestViewer`. | ### Modified files | File | Change | |------|--------| | `src/Mod/Create/silo_viewproviders.py` | Wire `doubleClicked()` to call `create_viewer_widget()`, open the result in an MDI subwindow via `mw.findChild(QMdiArea).addSubWindow(widget)`. Implement subwindow deduplication using `_silo_object_name` attribute. | | `src/Mod/Create/CMakeLists.txt` | Add `silo_viewers.py` to install list. | ## Widget specification ``` ┌──────────────────────────────────────────────────┐ │ Silo Manifest │ ├──────────────────────────────────────────────────┤ │ Part UUID 550e8400-e29b-41d4-a716-... [⧉] │ │ Silo Instance https://silo.example.com [⧉] │ │ Revision Hash a1b2c3d4e5f6 │ │ KC Version 1.0 │ │ Created 2026-02-13 19:00 UTC │ │ Modified 2026-02-13 20:30 UTC │ │ Created By joseph │ └──────────────────────────────────────────────────┘ ``` - **Layout**: `QWidget` with `QFormLayout` - **Fields**: All read-only `QLabel` values - **Copy buttons**: `QToolButton` with clipboard icon for Part UUID and Silo Instance fields - **Tab title**: "Silo — Manifest" - **Theme**: Inherits from `KindredCreate.qss` (Catppuccin Mocha), no custom QSS needed - **Tree icon**: `silo-manifest.svg` (Blue `#89b4fa`) — uses fallback empty string if SVG not yet created ## MDI subwindow management ```python mw = FreeCADGui.getMainWindow() mdi = mw.findChild(QtWidgets.QMdiArea) # Reuse existing subwindow if already open for this object for sub in mdi.subWindowList(): if getattr(sub, "_silo_object_name", None) == obj.Name: mdi.setActiveSubWindow(sub) return True sub = mdi.addSubWindow(widget) sub._silo_object_name = obj.Name sub.setWindowTitle(f"Silo — {obj.Label}") sub.show() return True ``` ## Acceptance criteria - [ ] Double-clicking "Manifest" in the Silo tree opens a viewport tab with the form layout - [ ] All `manifest.json` fields are displayed with correct labels and values - [ ] Copy buttons copy UUID and Silo Instance to clipboard - [ ] Double-clicking "Manifest" again activates the existing tab (no duplicate) - [ ] Closing the tab and double-clicking again opens a fresh tab - [ ] Widget inherits Catppuccin Mocha theme from the application stylesheet ## Dependencies - Phase 1 foundation (#37) ## References - `docs/KC_SPECIFICATION.md` §4.1 (`silo/manifest.json` schema) - `docs/SILO_VIEWPORT_PLAN.md` Phase 2 - Silo Metadata Viewport Specification §5.1 (Manifest Viewer)
forbes added the enhancement label 2026-02-18 21:15:23 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo-mod#38