Retain explicit canvas owners without disabling viewport culling

This commit is contained in:
2026-11-11 02:21:57 +08:00
parent 72a8e01114
commit 680aea0aa7
8 changed files with 181 additions and 35 deletions
+26 -10
View File
@@ -1000,21 +1000,37 @@ elements or requests. The low-level helper defaults to its prior per-slice
checkpoint policy unless a cadence is requested. Checkpoint/source formats and
resume IDs stay unchanged; a crash/pause can redo only unsaved private planning.
Native culling now checks active interaction owners instead of disabling itself
for every focused input or editing mode. Visible native nodes (including nodes
React Flow itself retains while dragging/initially measuring) keep culling on.
An offscreen owner, connection/custom owner without a native node, or focused
portal input without a native node still uses the conservative full-graph
fallback so viewport changes cannot discard IME, drafts or gesture leases.
Focus tracking stores the current input element and keeps the deferred blur
fence, including direct transfers between inputs. This is not selective pinning:
offscreen/custom interaction fallbacks can still mount the complete graph.
The app renderer retains explicit view owners without turning off native culling.
Adapter-local `__endoleapRetain` flags cover node modes/gestures, focused native
inputs, registered Portal overlays, known node paint overflow and curved-edge
paint. Retained connections also retain their endpoint owners. The complete
nodes/edges stay in React Flow's lookup; geometry, dragging, model data and hidden
state are not fabricated. A view-local weak cache preserves tagged row identity,
and ending an owner returns the original row. Detached focus is retired even
when removing a renderer emits no blur. Flags never enter a Root or file.
Unscoped focused inputs/portals and exhausted/unknown paint-budget sentinels retain
the conservative whole-graph fallback; their missing ownership is not guessed.
React Flow 12.12.1 does not expose a retained-ID selector. The app-only
`scripts/loaders/xyflow-retained.cjs` extends its two ESM visibility selectors at
compile time, under both webpack and Turbopack in `next.config.ts`. It requires
the pinned version and exact source anchors, rejecting mismatches before silently
losing editor retention. Dependency upgrades require reviewing this extension.
Shared node_modules are not edited. This is an app renderer build requirement;
the portable headless SDK/optional bindings do not include the Next loader.
The actual-page performance probe double-clicks a visible text card with native
Chrome input, checks mounted-node growth, inserts text and checks DOM identity,
focus and content before measuring deep copy. It then clears selection with a
native empty-pane click. Reports include `inputCheck.beforeEditing` and
`inputCheck.duringEditing`; this preflight is outside the copy timing window.
`inputCheck.duringEditing`, `inputCheck.offscreenEditing` and
`inputCheck.offscreenPortal`; this preflight is outside the copy timing window.
The screen-pan probes preserve native IME and an unsaved Portal title, bound
mounted owners, check release after blur, and remount saved content. Add
`--turbopack` to the page/performance runner to use the app's default compiler.
Turbopack fixtures live temporarily under the physical dependency workspace so
its filesystem fence can resolve Next; the exact unique directory is removed in
finally. Webpack fixtures continue to use the OS temporary directory.
Set `HEADLESS_PERFORMANCE_EDIT_DURING_COPY=1` with `--performance` and at least
1000 nodes to add a mixed-workload probe. After the first copied frame, it finds