Repository navigation
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The web context menu now consumes the click associated with outside-pointer dismissal, preventing immediate reopening. The effect is limited to transient menu interaction; native desktop menus and persistent state are unchanged. You can add or adjust custom eligibility rules. Learn more. |
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.
Note
🤖 Claude Opus 5.5 on behalf of Oliver
Fix for the redesign stack, targets layer 1 (#28839).
Problem
On web, clicking the thread tab opens its menu. Clicking the tab again while the menu is open doesn't close it. The menu closes and then opens again right away, so it flashes. If the second click comes fast enough to count as a double-click, it starts the title edit instead.
The web menu is the DOM fallback for native context menus. It closes on any
pointerdownoutside itself, but theclickfrom that same press still reaches the element underneath. When that element is the tab, its click handler opens the menu again.Fix
A press outside the fallback menu now only closes it. The
click,auxclickanddblclickfrom that press are swallowed, which matches native desktop menus and our Base UI menus. The nextpointerdownorkeydownturns the swallowing off, so later clicks work normally.Behavior on the tab, on web:
Desktop uses native menus, so nothing changes there, and double-click rename still works on desktop. The same rule covers every fallback menu on web: a click outside a right-click menu now only closes it, just like on desktop.
This code isn't new in the stack. The tab's click-to-open and the fallback's dismissal behave the same way on
main, so the fix targets the lowest layer.Before / after
Captured in the web browser at 1280×800, light theme, one project and one thread. Before uses layer 6 (
maria/redesign/6-workspace-panes); after uses the same layer with781a3082a0merged onto it.The 150 ms double-click clips use simulated DOM pointer/click/dblclick events through the preview tool. The tool's native double-click runs about 28 ms apart and still starts title editing after this fix; that faster case is not covered by the passing clips.
Validation
New case in
contextMenuFallback.keyboard.browser.test.ts: open from a button's click, click the button again, menu stays closed and doesn't reopen, a third click opens it. Fails on layer 1, passes here.vp run check:changed origin/maria/redesign/1-primitives-shell: format, lint, knip, typecheck, tests and React compiler all pass.Headless Chromium against a dev server, same script on both refs:
Made with Claude Opus 5.5 in Claude Code.