Skip to content

fix(desktop): enable context menus in the in-app browser - #235

Open
leoisadev1 wants to merge 1 commit into
mainfrom
fix/desktop-browser-context-menus
Open

fix(desktop): enable context menus in the in-app browser#235
leoisadev1 wants to merge 1 commit into
mainfrom
fix/desktop-browser-context-menus

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

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 popupTemplate when 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 lint on 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.

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.
@github-actions github-actions Bot added size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 10, 2026
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile Summary

This 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/5

Safe 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.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex authored and executed the context-menu-routing-validation-command.sh script to validate the context menu routing.
  • Before-output results were inspected from the context-menu-routing-01.log, showing the command exited with code 1 due to a missing did-attach-webview routing in the parent.
  • After-output results were inspected from the context-menu-routing-02.log, showing the command exited with code 0 with 1 passed and 25 skipped.
  • A source integrity check was run using git diff --check, and it reported no issues (exit 0).

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix(desktop): enable context menus in th..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant