5.8 KiB
Saved Scenario workspace integration review
Source candidate: 46e106c04e82e3d5b0acac43c99c7ee3e5a9c1b5, built on the pure display adapter aa62f42 and renderer correction37be410. This note records source review, not compilation or runtime acceptance. Live gates and ownership remain in issue20.
Settled consuming contract
The Scenario controller retains explicit Saved/Derived representation and semantic owner independently of the architecture active-diagram field. A live Context adds document session, revision, pointer epoch and a stable visit UUID. Viewport/scroll/focus callbacks may deliberately relax pointer epoch within a visit; they never relax representation or visit. Leaving suspends input while retaining the representation and camera. Explicit navigation to another behavior retires that retained view. Saved A → B → A receives a fresh visit even with no intermediate render.
App checks the view envelope before pending-reveal or camera reconciliation, so a stale event cannot disturb the current destination before its eventual refusal. Scope/control IDs, form-focus stamps, viewport sensors and scroll restoration use the same representation/visit distinction. Camera epoch remains separate from the stable sensor visit to avoid resize feedback loops.
Opening a local ScenarioUse enters the target's Derived view; Back validates both the original occurrence/target relation and the exact saved caller's current owner. It restores that caller's presentation into a fresh visit. Invalid/deleted saved identity stays unavailable, including after leaving/reentering; Undo that restores the same saved UUID restores that destination. Valid source retargeting resolves its owner/layer before generic active-view normalization.
Explicit diagram and arrangement pickers retain the established property Apply policy after validating the destination. Passive routing never selects or Applies to display a view. Usage navigation, OpenUse and Back retain their clean-draft guard. The distinction is deliberate and tested separately; changing all picker behavior was not part of this increment.
One presentation adapter supplies complete Scene geometry and bounds to paint, membership and reveal. A saved target uses Surface::Saved(diagram); Derived uses Surface::Scenario(owner). Direct Scenario reveal revalidates the entire Usage record, including actual bounds, before any route or camera mutation. Chooser selection first obtains a fresh canonical row. Deferred viewport completion is also bound to the destination visit.
New Saved destinations begin in Fit mode. Fit uses full rectangle origin and waits for the real viewport; valid tiny scales are not reclamped to 5% during zoom transitions. The actual Scene uses the same scale/pan for drawing and input inversion. Topology retains its existing 5% policy. Tiny zoom labels remain nonzero. Back restores its saved camera rather than creating a new initial Fit.
Findings and corrections
Independent source review and parent integration found these concrete issues before runtime testing:
- A suspended visit initially hid the retained representation, causing return from Guide/Text to select Derived. Retained representation and live Context are now separate accessors.
- Generic active-view normalization could discard a saved UUID after a cross-layer owner retarget. Source synchronization resolves its valid saved owner/layer first.
- Missing/deleted saved owner could route through the first remaining behavior; restoring a deleted view with Undo could also lose it after active-view normalization. The requested saved identity now determines the unavailable/returned workspace until explicit navigation retires it.
- Explicit Process/State Machine selection, directly or through Guide, could be overridden by that retained Saved identity. Those deliberate exits now forget the saved presentation; focused regressions cover both routes and both behavior kinds.
- Picker existence alone was insufficient admission before Apply. Saved owner compatibility is checked first; missing/deleted targets preserve valid pending property drafts.
- Target-only reveal validation accepted forged bounds and could store them in navigation highlights. Full Usage equality and camera admission now precede routing.
- Delayed view events could clear a newer pending reveal before the controller rejected them. Early App envelope validation now precedes reconciliation.
- The old camera path lost bounds origin, cleared Fit and reclamped tiny Fit to 5%. One origin-aware camera calculation now serves paint, hit inversion and relative navigation.
Prepared tests include direct controller and actual Scene input cancellation, App A/B/Automatic/Back, source adoption and exact Undo/Redo, mounted unavailable state, guarded deferred reveal, native-fixture core admission, negative/extreme geometry and topology compatibility. Their assertions are source preparation only at this commit. The invalid persisted-owner guard is defensive: Document refuses such a model, and tests do not bypass validation to invent an accepted one.
Remaining acceptance
Compilation, targeted/full Windows tests and actual native small-window/focus/edit/repair workflows remain necessary. Fallback cancels coordinate gestures and disables canvas insertion/reorder while preserving selection/navigation and guarded outline/source repair. It never persists automatic coordinates. Successful authored spacing diagnostics remain authored. Current short32 message-label behavior and heuristic label bands remain explicit limitations; measured-label integration and spacing/reorder gesture selection are separate increments. No Linux result or public codec/version adoption is inferred.