prometeu-studio/docs/studio/pull-requests/PR-05a-assets-workspace-foundation-and-service-state.md
2026-03-24 13:42:40 +00:00

72 lines
2.6 KiB
Markdown

# PR-05a Assets Workspace Foundation and Service State
## Briefing
Implement the first executable slice of the `Assets` workspace based on:
- [`../specs/4. Assets Workspace Specification.md`](../specs/4.%20Assets%20Workspace%20Specification.md)
This PR creates the workspace foundation, service-facing state model, and event wiring required by all later `Assets` workspace slices.
## Objective
Replace the current `WorkspaceId.ASSETS` placeholder with a concrete `AssetsWorkspace` foundation that can:
- boot inside the Studio shell,
- request and refresh asset data from Studio-facing services,
- maintain stable selection state,
- surface loading/empty/error states,
- and expose internal state in a way that later UI slices can reuse.
## Dependencies
- existing Studio shell and event bus foundations
- existing packer-facing Studio contracts and specifications
## Scope
- create a concrete `AssetsWorkspace`
- define workspace-local view state models for:
- navigator state
- selected asset state
- loading/error state
- define service-facing DTO adapters needed by the workspace
- define workspace event publications for asset refresh and selection updates
- integrate the workspace into the existing shell/workspace switch flow
## Non-Goals
- no final asset navigator visuals yet
- no final preview rendering yet
- no final staged mutation UI yet
- no production-grade packer backend implementation if stubs or adapters are still required
## Execution Method
1. Replace the placeholder assets workspace with a concrete class and root layout.
2. Introduce workspace-local state objects for navigator, selection, and detail hydration.
3. Introduce a Studio-facing service boundary for loading asset collections and selected-asset details.
4. Wire the workspace into `StudioWorkspaceEventBus` for refresh and selection lifecycle.
5. Define stable loading, empty, no-results, and error states in code.
## Acceptance Criteria
- selecting `Assets` opens a real workspace rather than a placeholder
- the workspace can request asset data through a Studio service boundary
- loading, empty, and error states are visible and distinct
- selection state is modelled explicitly and can be preserved by identity
- the workspace has enough state structure to support the later navigator and details PRs without redesign
## Validation
- unit tests for workspace state transitions
- unit tests for selection retention logic
- UI smoke validation that the Assets workspace mounts cleanly in the shell
## Affected Artifacts
- `prometeu-studio` workspace classes
- Studio event wiring
- Studio-facing asset service abstractions
- tests for workspace state and selection behavior