mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 08:03:13 +00:00
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:
+8
-8
@@ -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
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
+3
-1
@@ -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 }
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user