Fence session lifetimes and cancel owned previews on tool changes

This commit is contained in:
2026-11-09 22:09:30 +08:00
parent ed85546674
commit bcc11e2e84
5 changed files with 83 additions and 20 deletions
+20
View File
@@ -582,3 +582,23 @@ this is not a claim that the entire view is O(changed IDs). Numeric geometry cac
remain derived Maps, with no history or durable task ownership. Engine/view
replacement discards this cache; `clear()` also drops the retained scene and
numeric caches. Query provenance is validated even on a cache hit.
Session transitions publish the final view and any owned preview cancellation in
one snapshot. Changing tools cancels only that view's active node/path gesture;
`begin`/`beginConnection` require the selection tool (`tool_not_select` otherwise).
Repeated selection of the current tool is a no-op. The React Flow adapter also
disables native connection handles in pan mode and rejects a late connection
callback against the current tool. Multitouch interruption is view scoped.
Modes remain `Map<ElementId, string>` in each view. On document publication, the
session compares the previous and current target incarnation, owner, structure,
component and data version: replacing or moving the target clears its mode,
while content edits and equivalent canonical clones preserve it. Missing targets
cannot acquire a mode. Identical mode updates and redundant clears do not notify.
This uses a borrowed current document reference, not a second mode identity store.
Each attach disposer runs once, so a late second cleanup cannot detach a newly
attached view with the same ID. Explicit canvas navigation and detach publish the
new view set together with cancellation. Session disposal fences admission before
notifying, clears all views/previews, and is idempotent. These transient actions
create no document/history/ledger entries and change no recovery format.