Repository navigation
Conversation
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.
Description
An outside press dismissed a PopupMenu and then reached the surface beneath it. A canvas could therefore arm a command on the same click used to close the menu.
Stop propagation when the menu actually dismisses. Keep the parent-menu bounds and active-submenu exemptions so parent and child actions still work. No public API, visual styling or GPUI version changes.
The implementation change and new regression tests were generated with an AI coding agent and reviewed by that agent. Human review remains pending; the PR remains a draft.
Interaction evidence
The visuals are unchanged. Real GPUI pointer dispatch tests exercise the production window entry point and menu components:
Verified against the original main baseline
8d8cc671(Kit 0.7.1 / GPUI 0.3.8): the unchanged menu source gives 4 passing tests and this one failure; the fix gives 5/5 passing tests in 0.418s. Scoped strict Clippy passed. The same red/green behavior was independently checked against the exact published 0.7.0 source (GPUI 0.3.7).Before, the actual outside-press test reports:
After, both new cases and the three existing menu tests pass. No static screenshot could demonstrate whether the same click also reached the underlying surface; this table and the public pointer-dispatch regression tests record that behavior directly.
How to Test
The new cases cover left/right outside dismissal, an open submenu, no underlying down/up command, focus restoration, the next fresh click, and parent/child actions executing once. The existing disabled-command, keyboard and scrollable-submenu tests remain in the same target.
Checklist
CI run 37291392055 tested the exact PR head
68497c7d149aa5ffe7fa2b8b26aede11cf1ebef2. Both new menu tests passed on macOS, Linux and Windows; the macOS rendering target also passed its ten Metal cases. Those automated results are separate from the native Story checks below.All eleven check conclusions report success, but the Windows GPUI Shell Standard Runtime log contains three failing tests (
llrt_pure_modules_execute_inside_the_shell_runtime,every_fs_call_settles_through_a_promise, andwebsocket_reads_and_writes_text_and_binary_messages). Later commands succeeded, masking those failures in the job conclusion. The same three tests fail on upstream-base run 37277918742 at8d8cc671; they predate this PR. They are not claimed as passing.Native Story verification
Built the exact PR source with
cargo build --locked -p gpui-component-storyon macOS arm64 and Linux x86_64. On macOS, launched./script/run-story-macos Menu; the signed bundle passedcodesign --verify --deep --strict. Used its accessibility tree to locate buttons and menu items and refreshed the tree after every state change.Edit→ click the underlyingScrollable Menu (100 items)button: the first outside click only dismisses; the next fresh click opens that menu.Edit→Linkssubmenu → parentHandle Click: the complete chain dismisses and its action result appears.Settings→ childItem 1: the complete chain dismisses and the visible result isYou have clicked info: 1.Settingsopen, right-click the second context region: the first press only dismisses; the next fresh right-click opens the second region's menu.Handle Click; Escape dismisses a context menu.Context regions and displayed result text are absent from the native accessibility tree, so those used screenshot/coordinate fallback. Native AX reports the focused element as the window; this does not prove native semantic focus restoration. The automated tests cover focus restoration separately. The Story exited normally after verification.
On Linux, the exact built Story opened and rendered its real Menu gallery in Xvfb; its complete screenshot was opened and inspected. Linux native pointer/keyboard interactions and a Windows interactive Story session were not run. The change has no platform-specific implementation or rendering changes; the three-platform public menu tests are the automated coverage for those paths.
The focused local
menu,root, andoverlaystargets passed all 17 tests with zero skipped, and scoped Clippy passed with-D warnings. Human contributor review remains pending, so this stays a draft.