Fix Cmd+R keybinding conflict in pull request webview #7119
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.
Problem
The VS Code extension had a conflict where both the webview JavaScript and the extension's keybinding system were handling Cmd+R/Ctrl+R keyboard events for refreshing pull request descriptions. This caused issues when users tried to customize the refresh keybinding:
pr.refreshDescription
) would also try to handle the same keysSolution
Removed the duplicate keyboard event handling from the webview to rely exclusively on VSCode's keybinding system. This ensures that:
Changes Made
webviews/editorWebview/app.tsx
useEffect
hook that was listening for Cmd+R/Ctrl+R keyboard eventswebviews/editorWebview/test/app.test.tsx
ctx.refresh()
is not called when Cmd+R or Ctrl+R are pressedCHANGELOG.md
How It Works Now
pr.refreshDescription
command via VSCode's keybinding systemctx.refresh()
when neededgithub:pullRequestDescriptionVisible
is trueTesting
ctx.refresh()
still availableThis is a minimal fix that eliminates the conflict while preserving all existing functionality.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com
/usr/lib/apt/methods/https
(dns block)update.code.visualstudio.com
node ./out/src/test/runTests.js --testNamePattern=does not handle Cmd\+R keyboard events
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.