Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/open-worktree-pull-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": minor
---

Open the selected Agent Manager worktree's pull request with Cmd/Ctrl+Shift+R.
11 changes: 11 additions & 0 deletions packages/kilo-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@
"title": "Agent Manager: Open Worktree",
"category": "Kilo Code"
},
{
"command": "kilo-code.new.agentManager.openPR",
"title": "Agent Manager: Open Pull Request",
"category": "Kilo Code"
},
{
"command": "kilo-code.new.agentManager.closeWorktree",
"title": "Agent Manager: Close Worktree",
Expand Down Expand Up @@ -694,6 +699,12 @@
"mac": "cmd+shift+o",
"when": "activeWebviewPanelId == 'kilo-code.new.AgentManagerPanel'"
},
{
"command": "kilo-code.new.agentManager.openPR",
"key": "ctrl+shift+r",
"mac": "cmd+shift+r",
"when": "activeWebviewPanelId == 'kilo-code.new.AgentManagerPanel'"
},
{
"command": "kilo-code.new.agentManager.closeWorktree",
"key": "ctrl+shift+w",
Expand Down
3 changes: 3 additions & 0 deletions packages/kilo-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,9 @@ export function activate(context: vscode.ExtensionContext) {
vscode.commands.registerCommand("kilo-code.new.agentManager.openWorktree", () => {
agentManagerProvider.postMessage({ type: "action", action: "openWorktree" })
}),
vscode.commands.registerCommand("kilo-code.new.agentManager.openPR", () => {
agentManagerProvider.postMessage({ type: "action", action: "openPR" })
}),
vscode.commands.registerCommand("kilo-code.new.agentManager.closeWorktree", () => {
agentManagerProvider.postMessage({ type: "action", action: "closeWorktree" })
}),
Expand Down
11 changes: 11 additions & 0 deletions packages/kilo-vscode/tests/unit/extension-arch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ describe("Extension — package.json command sync", () => {
when: "activeWebviewPanelId == 'kilo-code.new.AgentManagerPanel' && !terminalFocus",
})
})

it("scopes the open PR shortcut to Agent Manager", () => {
const binding = pkg.contributes?.keybindings?.find(
(item: { command: string }) => item.command === "kilo-code.new.agentManager.openPR",
)
expect(binding).toMatchObject({
key: "ctrl+shift+r",
mac: "cmd+shift+r",
when: "activeWebviewPanelId == 'kilo-code.new.AgentManagerPanel'",
})
})
})

// ---------------------------------------------------------------------------
Expand Down
12 changes: 10 additions & 2 deletions packages/kilo-vscode/tests/unit/sidebar-search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,20 @@ describe("buildSidebarSearch", () => {
})
})

describe("sidebar search shortcut", () => {
it("appears in the quick-switch keyboard shortcuts section", () => {
describe("Agent Manager shortcut map", () => {
it("includes sidebar search in the quick-switch section", () => {
const categories = buildShortcutCategories({ search: "⌘F", jumpTo1: "⌘1" }, (key) => key)
expect(categories[0]?.shortcuts[0]).toEqual({
label: "agentManager.sidebarSearch.label",
binding: "⌘F",
})
})

it("includes open pull request in the sidebar section", () => {
const categories = buildShortcutCategories({ openPR: "⌘⇧R" }, (key) => key)
expect(categories[1]?.shortcuts).toContainEqual({
label: "agentManager.shortcuts.openPR",
binding: "⌘⇧R",
})
})
})
13 changes: 11 additions & 2 deletions packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const defaultBindings: Record<string, string> = {
advancedWorktree: isMac ? "⌘⇧N" : "Ctrl+Shift+N",
closeWorktree: isMac ? "⌘⇧W" : "Ctrl+Shift+W",
openWorktree: isMac ? "⌘⇧O" : "Ctrl+Shift+O",
openPR: isMac ? "⌘⇧R" : "Ctrl+Shift+R",
agentManagerOpen: isMac ? "⌘⇧M" : "Ctrl+Shift+M",
cycleAgentMode: isMac ? "⌘." : "Ctrl+.",
cyclePreviousAgentMode: isMac ? "⌘⇧." : "Ctrl+Shift+.",
Expand Down Expand Up @@ -506,6 +507,13 @@ const AgentManagerContent: Component = () => {
}
const openWindow = metrics.click("open_worktree_window", "tab_toolbar", openWorktreeDirectory)

const openSelectedPR = () => {
const sel = selection()
if (!sel || sel === LOCAL || !prStatuses()[sel]) return
metrics.track("open_pull_request", "keyboard_shortcut")
vscode.postMessage({ type: "agentManager.openPR", worktreeId: sel })
}

const runWorktree = (id: string) => {
const state = runStatuses()[id]?.state ?? "idle"
if (state === "running" || state === "stopping") {
Expand Down Expand Up @@ -1047,6 +1055,7 @@ const AgentManagerContent: Component = () => {
else if (msg.action === "closeTab") closeActiveTab()
else if (msg.action === "newWorktree") handleNewWorktreeOrPromote()
else if (msg.action === "openWorktree") openWorktreeDirectory()
else if (msg.action === "openPR") openSelectedPR()
else if (msg.action === "runScript") runSelected()
else if (msg.action === "advancedWorktree") showAdvancedWorktreeDialog()
else if (msg.action === "closeWorktree") closeSelectedWorktree()
Expand Down Expand Up @@ -1076,8 +1085,8 @@ const AgentManagerContent: Component = () => {
if (["t", "w", "n", "d", "e", "f"].includes(e.key.toLowerCase()) && !e.shiftKey) {
e.preventDefault()
}
// Prevent defaults for shift variants (close worktree, advanced/new open worktree)
if (["w", "n", "o"].includes(e.key.toLowerCase()) && e.shiftKey) {
// Prevent defaults for shift variants (close worktree, advanced/new/open worktree, open PR)
if (["w", "n", "o", "r"].includes(e.key.toLowerCase()) && e.shiftKey) {
e.preventDefault()
}
// Prevent browser defaults for shortcuts help (Cmd/Ctrl+Shift+/)
Expand Down
1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/ar.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/br.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/bs.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/da.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/de.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const dict = {
"agentManager.shortcuts.nextItem": "Next item",
"agentManager.shortcuts.newWorktree": "New worktree",
"agentManager.shortcuts.openWorktree": "Open worktree",
"agentManager.shortcuts.openPR": "Open pull request",
"agentManager.shortcuts.advancedWorktree": "Configure new worktree",
"agentManager.shortcuts.deleteWorktree": "Delete worktree",
"agentManager.shortcuts.previousTab": "Previous tab",
Expand Down
1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/es.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/fr.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/it.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/ja.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/ko.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/nl.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/no.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/pl.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/ru.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/th.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/tr.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/uk.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/zh.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/i18n/zht.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function buildShortcutCategories(
{ label: t("agentManager.shortcuts.advancedWorktree"), binding: bindings.advancedWorktree ?? "" },
{ label: t("agentManager.shortcuts.deleteWorktree"), binding: bindings.closeWorktree ?? "" },
{ label: t("agentManager.shortcuts.openWorktree"), binding: bindings.openWorktree ?? "" },
{ label: t("agentManager.shortcuts.openPR"), binding: bindings.openPR ?? "" },
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function isAgentManagerShortcut(e: KeyboardEvent): boolean {
const key = e.key.toLowerCase()
if (e.altKey && ["arrowleft", "arrowright", "arrowup", "arrowdown"].includes(key)) return true
if (["t", "w", "n", "d", "e", "f"].includes(key)) return true
if (e.shiftKey && ["w", "n", "o", "m", "/", "?"].includes(key)) return true
if (e.shiftKey && ["w", "n", "o", "r", "m", "/", "?"].includes(key)) return true
if (/^[1-9]$/.test(key)) return true
if (key === "/") return true
return false
Expand Down
Loading