Repository navigation
Conversation
…lowLab#513) The single-node toolbar was anchored above the selected node without respecting the safe area below the top bar (safe.y). Only the selection fit kept it out of the top bar, and that fit deliberately does not run after a drag or a manual pan; after a drag-select it is also deferred until the next pointerdown, because pointerGesture.moved stays set after release. The toolbar (z-index 16) then covered the top bar (z-index 12) and intercepted clicks on Switch project. Playwright never dispatches a pointerdown while its hit target is covered, so canvas_progressive_load could wait the full click timeout. Clamp the toolbar's top to safe.y in selectionPlacement, like the multi-selection bar already does. Fitted selections already sit at safe.y, so ordinary placement and viewport behaviour are unchanged. Add a unit test and a real-pointer browser regression (canvas_toolbar_topbar.mjs, gate lane) covering drag near the top, toolbar use, a second drag, a manual pan and a project switch in en-US and zh-CN at zoom 0.5, 1 and 1.5. Both fail on the previous revision. Fixes ThinkFlowLab#513
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #513.
The floating toolbar for a selected canvas node could overlap the global top bar after dragging or viewport movement. When it overlapped the top bar, it intercepted pointer events and made global controls such as Switch project difficult or impossible to activate.
This PR fixes the product-side positioning constraint and adds regression coverage using real browser pointer interactions.
Root cause
The single-selection toolbar placement calculation did not enforce the canvas safe area's top boundary (safe.y). It relied on viewport presentation adjustment to move the toolbar below the top bar.
That reliance was insufficient: after a drag or manual pan, the toolbar could remain above the safe boundary. In the reproduced case it was positioned at approximately y=28 while the top bar extended to y=68, allowing the toolbar's hit area to intercept the project switcher.
The pointer-gesture timing explained why the browser test could pass incidentally after a later render, but the underlying product defect was the missing geometric constraint.
Fix
Clamp the single-selection toolbar's top coordinate to the safe area's top boundary:
top = Math.max(safe.y, calculatedTop)
This is a local, deterministic placement constraint. It does not depend on a later React render, delayed viewport adjustment, or a test-only workaround.
Evidence
GitHub Actions on current HEAD
a4efefda7d5220b8cd3a534eae1542b3531e30ca: all seven Release checks passed; DSH plugin checks and CodeQL also succeeded. This PR remains Draft.Screenshots
Captured from real Chromium pointer interactions with synthetic canvas data. Each locale shows the overall selected-node layout, the project switcher menu opening, and the selected-node toolbar menu opening.
English UI
简体中文 UI
Known limitations
Scope
This PR is limited to Canvas selection-toolbar positioning and its regression tests. It does not modify Agent Runtime, SSE, Trace export, #476, or #512.