Repository navigation
Description
Summary
After dragging a selected canvas node and releasing the pointer, the next ordinary click can unexpectedly trigger a delayed selection-presentation viewport adjustment. An isolated investigation of #513 observed a viewport shift of roughly 490 px when a later click (e.g. Retry or selecting the node) causes a render. This is surprising because the user's drag had already ended.
This issue is separate from the toolbar/top-bar hit-testing defect in #513. The one-line #513 candidate fix clamps the toolbar's placement below the safe top-bar region and intentionally does not alter viewport-adaptation semantics. The delayed viewport jump reportedly occurs both before and after that patch.
Evidence / suspected control-flow problem
The #513 investigation traced this behavior to:
src/canvas/workspace/useWorkspaceInteraction.tsx: presentation adaptation is gated byblocked, which depends onpointerGesture.current.moved.pointerGesture.ts: themovedflag remains true after pointerup and is reset only by a subsequent pointerdown.src/canvas/useSelectionPresentation.tsand thelastLayoutdeduplication path: a previously skipped adaptation may run at a later, unrelated render, after the next click.
In an instrumented scenario, the selected node's toolbar stayed at y≈28 after pointerup, and a subsequent Retry interaction triggered viewport adjustment to approximately (490,44). The original CI failure in #512 was about the toolbar intercepting Switch project; the delayed viewport jump is independently user-visible.
Evidence limitation: The above is based on isolated fixture/instrumented investigation. The precise delayed-jump behavior should be pinned by its own regression test on latest upstream main, rather than treating the suggested fix as proven.
Expected behavior
- Releasing a completed drag should not schedule an old automatic viewport adaptation to occur on the next unrelated click.
- A later click on Retry, an ordinary node, or a global control should not unexpectedly pan/zoom the viewport because of stale gesture state.
- Preserve intentional first-selection visibility, user-controlled panning/zooming, and normal node toolbar interactions.
- Handle cancelled gestures, re-selection, multi-selection, and both locales without viewport oscillation.
Suggested investigation and acceptance
- Use isolated browser fixture to reproduce drag → pointerup → ordinary click and assert the viewport remains stable; establish red on unmodified main.
- Record
pointerGesture.current.moved,blocked,lastLayout, and viewport adjustment attempts across pointerdown/move/up, follow-on render, and click. - Evaluate clearing or retiring the skipped adaptation when the drag ends (for example, recording it in
lastLayout) instead of letting it fire on an unrelated click. Confirm that this does not suppress a genuinely needed future adaptation. - Add focused unit/browser tests for drag, cancel, subsequent click, intentional selection and user navigation, without
force: trueor arbitrary sleeps. - Verify independently of [bug] canvas: selected node toolbar can block Switch project after dragging #513 and avoid changing its toolbar safe-region fix.
Scope
Tracking / reproducibility only. Unassigned; no implementation or PR is authorized by this issue.
Related: #513 and the historical #512 isolated-browser CI failure.
Activity