prometeu-studio/docs/studio/pull-requests/PR-07e-assets-refactor-cleanup-and-regression-coverage.md

75 lines
3.3 KiB
Markdown

# PR-07e Assets Refactor Cleanup and Regression Coverage
Domain owner: `docs/studio`
## Briefing
Consolidate the refactor by removing obsolete redraw-heavy code paths, tightening naming, and locking the event-driven behavior with tests.
## Objective
Finish the corrective refactor so the codebase does not drift back toward monolithic render ownership.
After this PR:
- obsolete redraw-request and monolithic render helpers are removed;
- remaining component boundaries are clearer and easier to maintain;
- tests guard lifecycle, event routing, and selective-update behavior;
- the workspace code is organized around durable responsibilities rather than incremental leftovers.
- the resulting framework is left in a shape that other Studio workspaces can adopt directly.
## Dependencies
- [`./PR-07a-assets-event-topology-and-lifecycle-foundation.md`](./PR-07a-assets-event-topology-and-lifecycle-foundation.md)
- [`./PR-07b-asset-navigator-and-row-subscriptions.md`](./PR-07b-asset-navigator-and-row-subscriptions.md)
- [`./PR-07c-asset-details-and-form-lifecycle.md`](./PR-07c-asset-details-and-form-lifecycle.md)
- [`./PR-07d-asset-mutation-and-structural-sync-orchestration.md`](./PR-07d-asset-mutation-and-structural-sync-orchestration.md)
## Scope
- remove dead or transitional redraw-oriented code
- rename classes/events where the old naming reflects the wrong direction
- tighten package structure for navigator, details, and orchestration code
- make reusable framework pieces visible and discoverable to future workspace implementations
- add regression coverage for:
- lifecycle subscription hygiene
- selection propagation
- row patch propagation
- details-local updates
- structural sync boundaries
- update Studio learn/spec material if the refactor exposes terminology drift
## Non-Goals
- no new user-facing asset features in this slice
- no speculative refactor outside the `Assets` workspace and its direct event contracts
## Execution Method
1. Remove compatibility layers that existed only to bridge from the old refresh-heavy implementation.
2. Normalize class and event naming around lifecycle and event-driven ownership.
3. Reorganize tests to reflect component boundaries instead of one giant workspace class.
4. Update documentation to reflect the stabilized architecture.
## Acceptance Criteria
- the refactored `Assets` workspace no longer depends on redraw-request events as a primary mechanism
- code ownership is split along navigator, details, and orchestration boundaries
- lifecycle and event-driven behavior are covered by focused tests
- the remaining `AssetWorkspace` root is materially smaller and primarily compositional
- the reusable framework surface is clear enough for other workspaces to consume instead of cloning `Assets` internals
## Validation
- full unit-test pass for asset-workspace packages
- targeted regression tests for mount/unmount lifecycle safety
- targeted regression tests proving that local updates stay local unless structural sync is requested
## Affected Artifacts
- `prometeu-studio/src/main/java/p/studio/workspaces/assets/...`
- `prometeu-studio/src/main/java/p/studio/events/...`
- `prometeu-studio/src/test/java/p/studio/workspaces/assets/...`
- `docs/studio/specs/4. Assets Workspace Specification.md`
- `docs/studio/learn/mental-model-assets-workspace.md`