feat(kc): server integration — SSE subscriptions, live fetch, and write-back for viewers #43
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Wire live data fetching, SSE event subscriptions, and server write-back into the viewer widgets. This connects the offline-capable viewers to the running Silo server for real-time updates and bidirectional sync.
Background
Phases 1–5 build viewers that operate on local
silo/data. This phase adds the network layer: viewers that can fetch fresh data from the server, subscribe to SSE events for live updates, and push edits back on commit.The SSE broker infrastructure already exists in
silo_commands.py(SiloEventListener), and the Activity panel already subscribes to events. Viewer widgets subscribe to the same broker.Server API availability (as of Feb 2026)
Based on silo-server documentation review:
GET /api/items/{pn}/revisionsGET/PUT /api/items/{pn}/metadataPATCH /api/items/{pn}/metadata/lifecyclePATCH /api/items/{pn}/metadata/tagsGET /api/schemas/{name}/formGET /api/items/{pn}/dependencies/resolveGET /api/items/{pn}/macros/{filename}GET /api/eventsGET /api/items/{pn}/file/{rev}In scope (this issue)
History Viewer
_client.get_revisions(pn)and replaces local snapshotrevision_createdsignal triggers auto-refreshMetadata Editor
GET /api/schemas/{name}/formfor dynamic field rendering (replaces flat key-value fallback)PUT /api/items/{pn}/metadataQComboBoxwhen connected; callsPATCH /api/items/{pn}/metadata/lifecyclePATCH /api/items/{pn}/metadata/tagson save when connectedmetadata.json, show a field-by-field diff dialogDependency Table
GET /api/items/{pn}/dependencies/resolvefor availability statusSiloSync.download_file(pn)for unresolved itemsAll viewers
_server_mode. If offline, display "Offline — showing cached data" banner and disable server-dependent controls.Out of scope (deferred)
Approvals Viewer server integration
SiloApprovalsViewerwill continue to display localsilo/approvals.jsonsnapshot only.Job Viewer server integration
SiloJobViewerwill continue as a local YAML editor only. Run button and status panel deferred.Files to modify
src/Mod/Create/silo_viewers.pysrc/Mod/Create/silo_document.pyTechnical notes
Cross-module import pattern
Viewers live in
src/Mod/Create/but_client,_server_mode, andSiloEventListenerlive inmods/silo/freecad/silo_commands.py. Imports must be guarded:SSE event subscription pattern
Each widget that needs SSE creates its own
SiloEventListener()instance (matching existing pattern inSiloAuthDockWidgetandSiloStartView).Acceptance criteria
revision_createdSSE eventDependencies
silo_commands.py(SiloEventListener)silo-clientReferences
docs/src/silo-server/SPECIFICATION.md— API endpoint referencedocs/src/silo-server/STATUS.md— implementation statusdocs/src/silo-server/GAP_ANALYSIS.md— approval/job gapsdocs/SILO_VIEWPORT_PLAN.mdPhase 7mods/silo/freecad/silo_commands.py—SiloEventListenerclass