Skip to content

feat(generate): add workspace asset library#188

Open
DrHepa wants to merge 1 commit into
lightningpixel:devfrom
DrHepa:feat/workspace-asset-library
Open

feat(generate): add workspace asset library#188
DrHepa wants to merge 1 commit into
lightningpixel:devfrom
DrHepa:feat/workspace-asset-library

Conversation

@DrHepa

@DrHepa DrHepa commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Workspace Asset Library to the Generate area so users can browse indexed workspace outputs and safely reopen supported assets without touching the viewer implementation.

What changed

Electron registry / IPC / preload

  • Adds an Electron-side artifact registry service that indexes workspace assets under supported workspace roots.
  • Adds structured list/read/open results for renderer-safe consumption.
  • Wires workspace library IPC handlers.
  • Adds a scoped preload API for workspace library list/read/open calls.

Shared contracts

  • Adds shared Workspace Asset Library types for entries, capabilities, source scopes, openability, read/open requests, structured errors, warnings, manifests, source links, and provenance-style metadata.
  • Adds lightweight artifact/source metadata types used by the library boundary.

Renderer projection / service

  • Adds renderer projection that normalizes registry entries into UI-safe entries.
  • Supports open targets: self, linked-source, and unavailable.
  • Adds fail-closed handling for unsupported or unsafe assets.
  • Adds a renderer service wrapper that validates read/open requests before crossing IPC.

GeneratePage UI

  • Adds a Library button and popover in Generate.
  • Supports refresh, search, sorting, grouped/collapsible display by source scope and capability, selection, open status messaging, and safe open behavior.
  • Preserves the existing Generate open/job flow instead of introducing a new viewer-state model.

Safety / path validation

  • Restricts registry access to allowed workspace-relative paths.
  • Rejects unsafe workspace paths, self-links, mismatched source links, Windows absolute paths, and UNC paths.
  • Keeps unsupported entries visible but unavailable rather than throwing or opening unsafe paths.

Tests

  • Adds focused tests for shared types, Electron registry behavior, IPC/preload wiring, renderer projection/service behavior, UI helper behavior, linked-source opens, and Windows/UNC path rejection.

Explicit non-goals

  • No direct Viewer3D changes.
  • No private viewer-state stack or viewer-side artifact tooling is introduced.
  • Advanced .ply/.splat viewer opening remains out of scope unless routed through safe supported sources.

Changed areas

Area Files
Electron registry/IPC/preload electron/main/artifact-registry-service.ts, electron/main/ipc-handlers.ts, electron/preload/electron-api.ts, electron/preload/index.ts
Shared contracts src/shared/types/assetLibrary.ts, src/shared/types/artifacts.ts, src/shared/types/electron.d.ts
Renderer services/projection src/areas/generate/assetLibraryProjection.ts, src/areas/generate/assetLibraryService.ts, src/areas/generate/assetLibraryUi.ts
Generate UI src/areas/generate/GeneratePage.tsx
Tests *.test.ts files added for all new boundaries

Test plan

  • node --test --experimental-strip-types src/shared/types/assetLibrary.test.ts src/areas/generate/assetLibraryProjection.test.ts src/areas/generate/assetLibraryService.test.ts src/areas/generate/assetLibraryUi.test.ts electron/main/artifact-registry-service.test.ts electron/preload/artifact-registry-preload.test.ts
  • npm test
  • Confirmed PR diff has no src/areas/generate/components/Viewer3D.tsx changes
  • Manually validated the Workspace Library flow on Windows in a clean upstream/dev-based worktree

Review notes

This PR is intentionally scoped to Workspace Library only. It does not include the separate ViewerAuthoringHost/Phase 1B work so the diff remains focused and reviewable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant