update PR and specs

This commit is contained in:
2026-03-24 13:42:39 +00:00
parent 3afeaafc2a
commit c4f8ae5733
4 changed files with 71 additions and 12 deletions
@@ -51,9 +51,12 @@ Baseline event rules:
- event publication is local to the process;
- event publication is strongly typed;
- event payloads are DTOs and should be immutable where practical;
- event publication and subscription management must be thread-safe;
- the baseline model should remain intentionally small;
- a large reactive framework is not baseline behavior.
Thread safety is required because background work such as asset recognition, scanning, diagnostics refresh, or other asynchronous Studio activity may publish events that eventually affect visible UI state.
## Global and Workspace Buses
The baseline event topology includes:
@@ -102,6 +105,21 @@ Shared Studio foundations include:
- event publication and observation infrastructure;
- reusable Studio control conventions.
## Subscription Lifecycle
Reusable Studio controls must have an explicit subscription lifecycle when they observe events or external state.
Baseline rule:
- Studio controls that need event observation should expose subscribe and unsubscribe lifecycle hooks that can be overridden when needed.
- Studio controls should also expose attach and detach lifecycle hooks for integration with the UI tree.
- `onAttached()` should trigger subscription setup.
- `onDetached()` should trigger subscription teardown.
This exists to make event wiring visible, testable, and safe under UI lifecycle changes.
The exact base class or interface shape is an implementation concern, but the lifecycle itself is normative.
Shared Studio foundations do not include:
- domain-specific workspace business logic;
@@ -66,6 +66,21 @@ Rules:
- exhaustive mirroring of upstream JavaFX APIs is not required;
- the goal is consistency and clarity, not a perfect one-to-one mirror of every JavaFX type.
## Control Lifecycle Hooks
Studio controls may need to observe event buses or other external state.
Rules:
- the control layer must provide explicit subscribe and unsubscribe lifecycle methods that can be overridden when needed;
- the control layer should also provide `onAttached()` and `onDetached()` lifecycle hooks;
- `onAttached()` should call `subscribe()`;
- `onDetached()` should call `unsubscribe()`;
- controls that attach subscriptions must also define how those subscriptions are released;
- event-driven controls must not hide subscription lifecycle completely inside ad hoc local wiring.
These hooks exist so event-driven controls remain predictable and safe to embed in shell and workspace UI.
## Typical Control Scope
Typical controls that belong in the module include: