fix(browser): route the Checks panel hosted-review link through the shared modifier

The "Open on GitHub" button had its own Shift+Cmd/Ctrl escape hatch that passed
forceSystemBrowser directly, so it kept the old one-way behavior while every
other surface honored the invert setting. Route it through modifierHeld like
the terminal and markdown paths.

Also wraps the modifier row's description in translate(); the title in the same
file was localized but the description returned raw English (caught in review).
This commit is contained in:
Brennan Benson
2026-07-27 15:21:29 -07:00
parent 5ee5859f21
commit 27b4e5ae74
8 changed files with 36 additions and 16 deletions
@@ -16,27 +16,27 @@ beforeEach(() => {
})
describe('checks panel hosted review click routing', () => {
it('maps Shift+Cmd to forceSystemBrowser on macOS', () => {
it('maps Shift+Cmd to the routing modifier on macOS', () => {
const event = { metaKey: true, ctrlKey: false, shiftKey: true }
expect(isChecksPanelHostedReviewSystemBrowserModifier(event, true)).toBe(true)
expect(resolveChecksPanelHostedReviewHttpOpenOptions(event, true, 'wt-1')).toEqual({
worktreeId: 'wt-1',
forceSystemBrowser: true
modifierHeld: true
})
})
it('maps Shift+Ctrl to forceSystemBrowser off macOS', () => {
it('maps Shift+Ctrl to the routing modifier off macOS', () => {
const event = { metaKey: false, ctrlKey: true, shiftKey: true }
expect(isChecksPanelHostedReviewSystemBrowserModifier(event, false)).toBe(true)
expect(resolveChecksPanelHostedReviewHttpOpenOptions(event, false, 'wt-1')).toEqual({
worktreeId: 'wt-1',
forceSystemBrowser: true
modifierHeld: true
})
})
it('preserves the worktree id without forceSystemBrowser on plain clicks', () => {
it('preserves the worktree id without the modifier on plain clicks', () => {
expect(
resolveChecksPanelHostedReviewHttpOpenOptions(
{ metaKey: false, ctrlKey: false, shiftKey: false },
@@ -46,7 +46,7 @@ describe('checks panel hosted review click routing', () => {
).toEqual({ worktreeId: 'wt-1' })
})
it('opens hosted review URLs without forceSystemBrowser on plain clicks', () => {
it('opens hosted review URLs without the modifier on plain clicks', () => {
openChecksPanelHostedReviewUrl({
url: 'https://github.com/acme/widgets/pull/123',
event: { metaKey: false, ctrlKey: false, shiftKey: false },
@@ -59,7 +59,7 @@ describe('checks panel hosted review click routing', () => {
})
})
it('opens hosted review URLs with forceSystemBrowser on Shift+Cmd clicks', () => {
it('opens hosted review URLs with the modifier on Shift+Cmd clicks', () => {
openChecksPanelHostedReviewUrl({
url: 'https://github.com/acme/widgets/pull/123',
event: { metaKey: true, ctrlKey: false, shiftKey: true },
@@ -69,7 +69,7 @@ describe('checks panel hosted review click routing', () => {
expect(openHttpLinkMock).toHaveBeenCalledWith('https://github.com/acme/widgets/pull/123', {
worktreeId: 'wt-1',
forceSystemBrowser: true
modifierHeld: true
})
})
})
@@ -14,8 +14,10 @@ export function resolveChecksPanelHostedReviewHttpOpenOptions(
isMac: boolean,
worktreeId: string | null | undefined
): OpenHttpLinkOptions {
// Why: same escape hatch as terminal and markdown links — openHttpLink resolves
// whether it forces the system browser or inverts the Link Routing setting.
if (isChecksPanelHostedReviewSystemBrowserModifier(event, isMac)) {
return { worktreeId, forceSystemBrowser: true }
return { worktreeId, modifierHeld: true }
}
return { worktreeId }
}
@@ -26,6 +26,14 @@ export function getLinkRoutingModifierDescription({
}): string {
const chord = isMac ? '⇧⌘' : 'Shift+Ctrl'
return openLinksInApp
? `Links open in Orca, so ${chord}+click sends one to your system browser instead.`
: `Links open in your system browser, so ${chord}+click opens one in Orca's built-in browser instead.`
? translate(
'auto.components.settings.BrowserLinkRoutingModifierSetting.descriptionSystem',
'Links open in Orca, so {{chord}}+click sends one to your system browser instead.',
{ chord }
)
: translate(
'auto.components.settings.BrowserLinkRoutingModifierSetting.descriptionOrca',
"Links open in your system browser, so {{chord}}+click opens one in Orca's built-in browser instead.",
{ chord }
)
}
+3 -1
View File
@@ -9749,7 +9749,9 @@
"BrowserLinkRoutingModifierSetting": {
"toggleLabel": "Toggle inverted link routing modifier",
"titleSystem": "Hold Shift to open in your web browser",
"titleOrca": "Hold Shift to open in Orca"
"titleOrca": "Hold Shift to open in Orca",
"descriptionSystem": "Links open in Orca, so {{chord}}+click sends one to your system browser instead.",
"descriptionOrca": "Links open in your system browser, so {{chord}}+click opens one in Orca's built-in browser instead."
}
},
"right": {
+3 -1
View File
@@ -9726,7 +9726,9 @@
"BrowserLinkRoutingModifierSetting": {
"toggleLabel": "Toggle inverted link routing modifier",
"titleSystem": "Hold Shift to open in your web browser",
"titleOrca": "Hold Shift to open in Orca"
"titleOrca": "Hold Shift to open in Orca",
"descriptionSystem": "Links open in Orca, so {{chord}}+click sends one to your system browser instead.",
"descriptionOrca": "Links open in your system browser, so {{chord}}+click opens one in Orca's built-in browser instead."
}
},
"right": {
+3 -1
View File
@@ -9726,7 +9726,9 @@
"BrowserLinkRoutingModifierSetting": {
"toggleLabel": "Toggle inverted link routing modifier",
"titleSystem": "Hold Shift to open in your web browser",
"titleOrca": "Hold Shift to open in Orca"
"titleOrca": "Hold Shift to open in Orca",
"descriptionSystem": "Links open in Orca, so {{chord}}+click sends one to your system browser instead.",
"descriptionOrca": "Links open in your system browser, so {{chord}}+click opens one in Orca's built-in browser instead."
}
},
"right": {
+3 -1
View File
@@ -9726,7 +9726,9 @@
"BrowserLinkRoutingModifierSetting": {
"toggleLabel": "Toggle inverted link routing modifier",
"titleSystem": "Hold Shift to open in your web browser",
"titleOrca": "Hold Shift to open in Orca"
"titleOrca": "Hold Shift to open in Orca",
"descriptionSystem": "Links open in Orca, so {{chord}}+click sends one to your system browser instead.",
"descriptionOrca": "Links open in your system browser, so {{chord}}+click opens one in Orca's built-in browser instead."
}
},
"right": {
+3 -1
View File
@@ -9726,7 +9726,9 @@
"BrowserLinkRoutingModifierSetting": {
"toggleLabel": "Toggle inverted link routing modifier",
"titleSystem": "Hold Shift to open in your web browser",
"titleOrca": "Hold Shift to open in Orca"
"titleOrca": "Hold Shift to open in Orca",
"descriptionSystem": "Links open in Orca, so {{chord}}+click sends one to your system browser instead.",
"descriptionOrca": "Links open in your system browser, so {{chord}}+click opens one in Orca's built-in browser instead."
}
},
"right": {