Agentic UI: Point Reload and Toggle DevTools at the app window instead of the focused webview - #4442
Open
shaunandrews wants to merge 1 commit into
Open
Agentic UI: Point Reload and Toggle DevTools at the app window instead of the focused webview#4442shaunandrews wants to merge 1 commit into
shaunandrews wants to merge 1 commit into
Conversation
…used webview Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Electron app menu so View ▸ Reload / Force Reload / Toggle DevTools reliably target the Studio app window’s renderer webContents (instead of whichever webContents is focused, such as a site preview webview), and clarifies this behavior via relabeling and accelerator tweaks for agentic mode.
Changes:
- Adds a helper to run actions against the main app window’s
webContents. - Replaces role-based reload/devtools menu items with explicit
webContentsactions to avoid focus-dependent behavior. - Renames menu items to “Reload App” / “Force Reload App” and adjusts the Reload App accelerator in agentic mode to preserve the preview’s ⌘R behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Runs against the app window's own contents rather than whatever has focus. | ||
| async function withAppWebContents( run: ( contents: WebContents ) => void ) { | ||
| const window = await getMainWindow(); | ||
| if ( window && ! window.webContents.isDestroyed() ) { |
shaunandrews
marked this pull request as ready for review
August 4, 2026 19:16
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.
Related issues
None (split out of the
stu-2162-site-header-actionsexploration)How AI was used in this PR
Claude Code cherry-picked this change out of a larger exploration branch and verified it (lint, typecheck) in isolation.
Proposed Changes
View ▸ Reload / Force Reload / Toggle DevTools used Electron's role-based "focused webContents" target. With a site preview visible, clicking into the preview would shift focus to the guest page, so Reload reloaded the site preview instead of the app — leaving no way to reload the Studio renderer itself from the menu.
These menu items now target the app window's webContents explicitly, and are relabelled "Reload App" / "Force Reload App" to make that explicit. In agentic mode, Reload App drops its ⌘R accelerator so ⌘R still reloads the preview (the renderer's own "Reload preview" shortcut); Force Reload App keeps ⌘⇧R.
Testing Instructions
Pre-merge Checklist