fix(desktop): enable context menus in the in-app browser - #235
Conversation
Right-click in a preview guest previously built the host window's context menu, so cut/copy/paste and image/link actions missed the page. Install the menu on attached webviews and popups, focus the guest first, and pass the target frame through to Electron.
Greptile SummaryThis change extends native desktop context menus to attached preview webviews and their popup windows. The exercised guest and popup flows route the menu to the correct owning window, focus the clicked contents for editing actions, forward the source frame, and retain destruction guards for image and spelling actions. Confidence Score: 5/5Safe to merge: no issues were identified in the changed behavior. The focused guest and popup context-menu behavior passed after the change, including owner routing, focus handling, frame propagation, duplicate installation protection, and destruction guards. Files Needing Attention: No files need further attention.
What T-Rex did
Reviews (1): Last reviewed commit: "fix(desktop): enable context menus in th..." | Re-trigger Greptile |
Problem
Right-click in the in-app browser built a context menu against the host renderer. Spellcheck, copy image, copy link, and editing roles missed the page the user clicked.
Changes
Install the native context menu on the host, attached preview webviews, and any popup those guests create. Focus the clicked contents first so Electron editing roles target that guest. Copy image and replace misspelling no-op if the guest is gone. Pass the target frame into
popupTemplatewhen Electron provides one.Adapted from pingdotgg#10670.
Scope
This PR is desktop context menus only.
Covered here:
Still assigned to this handoff, in later PRs:
Verification
vp test run apps/desktop/src/window/DesktopWindow.test.ts apps/desktop/src/electron/ElectronMenu.test.ts: 34 passed, including guest and popup menus plus frame forwarding.vp linton the four files: clean.Native right-click in a real Electron preview was not run on this Linux host.
Implemented and verified by Grok 4.6 High in Grok Build via Orca.