mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-19 01:51:21 +08:00
feat: add discoverable keyboard shortcuts help in Agent Manager (#6605)
* feat: add discoverable keyboard shortcuts help in Agent Manager * fix: reorder Agent Manager worktree header actions
This commit is contained in:
@@ -152,6 +152,12 @@
|
||||
"category": "Kilo Code",
|
||||
"icon": "$(diff)"
|
||||
},
|
||||
{
|
||||
"command": "kilo-code.new.agentManager.showShortcuts",
|
||||
"title": "Agent Manager: Show Keyboard Shortcuts",
|
||||
"category": "Kilo Code",
|
||||
"icon": "$(keyboard)"
|
||||
},
|
||||
{
|
||||
"command": "kilo-code.new.agentManager.focusPanel",
|
||||
"title": "Agent Manager: Focus Panel",
|
||||
@@ -443,6 +449,12 @@
|
||||
"mac": "cmd+d",
|
||||
"when": "activeWebviewPanelId == 'kilo-code.new.AgentManagerPanel'"
|
||||
},
|
||||
{
|
||||
"command": "kilo-code.new.agentManager.showShortcuts",
|
||||
"key": "ctrl+shift+/",
|
||||
"mac": "cmd+shift+/",
|
||||
"when": "activeWebviewPanelId == 'kilo-code.new.AgentManagerPanel'"
|
||||
},
|
||||
{
|
||||
"command": "kilo-code.new.agentManager.focusPanel",
|
||||
"key": "ctrl+.",
|
||||
|
||||
@@ -1243,6 +1243,9 @@ export class AgentManagerProvider implements vscode.Disposable {
|
||||
if (!bindings.toggleDiff) {
|
||||
bindings.toggleDiff = formatKeybinding(mac ? "cmd+d" : "ctrl+d", mac)
|
||||
}
|
||||
if (!bindings.showShortcuts) {
|
||||
bindings.showShortcuts = formatKeybinding(mac ? "cmd+shift+/" : "ctrl+shift+/", mac)
|
||||
}
|
||||
|
||||
this.postToWebview({ type: "agentManager.keybindings", bindings })
|
||||
}
|
||||
|
||||
@@ -96,6 +96,9 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
vscode.commands.registerCommand("kilo-code.new.agentManager.toggleDiff", () => {
|
||||
agentManagerProvider.postMessage({ type: "action", action: "toggleDiff" })
|
||||
}),
|
||||
vscode.commands.registerCommand("kilo-code.new.agentManager.showShortcuts", () => {
|
||||
agentManagerProvider.postMessage({ type: "action", action: "showShortcuts" })
|
||||
}),
|
||||
vscode.commands.registerCommand("kilo-code.new.agentManager.focusPanel", () => {
|
||||
agentManagerProvider.focusPanel()
|
||||
}),
|
||||
|
||||
@@ -123,6 +123,7 @@ const defaultBindings: Record<string, string> = {
|
||||
previousTab: isMac ? "⌘⌥←" : "Ctrl+Alt+←",
|
||||
nextTab: isMac ? "⌘⌥→" : "Ctrl+Alt+→",
|
||||
showTerminal: isMac ? "⌘/" : "Ctrl+/",
|
||||
showShortcuts: isMac ? "⌘⇧/" : "Ctrl+Shift+/",
|
||||
newTab: isMac ? "⌘T" : "Ctrl+T",
|
||||
closeTab: isMac ? "⌘W" : "Ctrl+W",
|
||||
newWorktree: isMac ? "⌘N" : "Ctrl+N",
|
||||
@@ -263,6 +264,7 @@ function buildShortcutCategories(
|
||||
title: t("agentManager.shortcuts.category.global"),
|
||||
shortcuts: [
|
||||
{ label: t("agentManager.shortcuts.openAgentManager"), binding: bindings.agentManagerOpen ?? "" },
|
||||
{ label: t("agentManager.shortcuts.showShortcuts"), binding: bindings.showShortcuts ?? "" },
|
||||
].filter((s) => s.binding),
|
||||
},
|
||||
].filter((c) => c.shortcuts.length > 0)
|
||||
@@ -945,6 +947,7 @@ const AgentManagerContent: Component = () => {
|
||||
else if (msg.action === "openWorktree") openWorktreeDirectory()
|
||||
else if (msg.action === "advancedWorktree") showAdvancedWorktreeDialog()
|
||||
else if (msg.action === "closeWorktree") closeSelectedWorktree()
|
||||
else if (msg.action === "showShortcuts") handleShowKeyboardShortcuts()
|
||||
else if (msg.action === "focusInput") window.dispatchEvent(new Event("focusPrompt"))
|
||||
else {
|
||||
// Handle jumpTo1 through jumpTo9
|
||||
@@ -969,6 +972,10 @@ const AgentManagerContent: Component = () => {
|
||||
if (["w", "n", "o"].includes(e.key.toLowerCase()) && e.shiftKey) {
|
||||
e.preventDefault()
|
||||
}
|
||||
// Prevent browser defaults for shortcuts help (Cmd/Ctrl+Shift+/)
|
||||
if (["/", "?"].includes(e.key) && e.shiftKey) {
|
||||
e.preventDefault()
|
||||
}
|
||||
// Prevent defaults for jump-to shortcuts (Cmd/Ctrl+1-9)
|
||||
if (/^[1-9]$/.test(e.key)) {
|
||||
e.preventDefault()
|
||||
@@ -1748,26 +1755,6 @@ const AgentManagerContent: Component = () => {
|
||||
<span class="am-section-label">{t("agentManager.section.worktrees")}</span>
|
||||
<Show when={isGitRepo()}>
|
||||
<div class="am-section-actions">
|
||||
<DropdownMenu gutter={4} placement="bottom-end">
|
||||
<DropdownMenu.Trigger
|
||||
as={IconButton}
|
||||
icon="settings-gear"
|
||||
size="small"
|
||||
variant="ghost"
|
||||
label={t("agentManager.worktree.settings")}
|
||||
/>
|
||||
<DropdownMenu.Portal>
|
||||
<DropdownMenu.Content class="am-split-menu">
|
||||
<DropdownMenu.Item onSelect={handleShowKeyboardShortcuts}>
|
||||
<DropdownMenu.ItemLabel>{t("agentManager.shortcuts.title")}</DropdownMenu.ItemLabel>
|
||||
</DropdownMenu.Item>
|
||||
<DropdownMenu.Separator />
|
||||
<DropdownMenu.Item onSelect={handleConfigureSetupScript}>
|
||||
<DropdownMenu.ItemLabel>{t("agentManager.worktree.setupScript")}</DropdownMenu.ItemLabel>
|
||||
</DropdownMenu.Item>
|
||||
</DropdownMenu.Content>
|
||||
</DropdownMenu.Portal>
|
||||
</DropdownMenu>
|
||||
<div class="am-split-button">
|
||||
<IconButton
|
||||
icon="plus"
|
||||
@@ -1807,6 +1794,35 @@ const AgentManagerContent: Component = () => {
|
||||
</DropdownMenu.Portal>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
<TooltipKeybind
|
||||
title={t("agentManager.shortcuts.title")}
|
||||
keybind={kb().showShortcuts ?? ""}
|
||||
placement="bottom"
|
||||
>
|
||||
<IconButton
|
||||
icon="keyboard"
|
||||
size="small"
|
||||
variant="ghost"
|
||||
label={t("agentManager.shortcuts.title")}
|
||||
onClick={handleShowKeyboardShortcuts}
|
||||
/>
|
||||
</TooltipKeybind>
|
||||
<DropdownMenu gutter={4} placement="bottom-end">
|
||||
<DropdownMenu.Trigger
|
||||
as={IconButton}
|
||||
icon="settings-gear"
|
||||
size="small"
|
||||
variant="ghost"
|
||||
label={t("agentManager.worktree.settings")}
|
||||
/>
|
||||
<DropdownMenu.Portal>
|
||||
<DropdownMenu.Content class="am-split-menu">
|
||||
<DropdownMenu.Item onSelect={handleConfigureSetupScript}>
|
||||
<DropdownMenu.ItemLabel>{t("agentManager.worktree.setupScript")}</DropdownMenu.ItemLabel>
|
||||
</DropdownMenu.Item>
|
||||
</DropdownMenu.Content>
|
||||
</DropdownMenu.Portal>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "تبديل الطرفية",
|
||||
"agentManager.shortcuts.focusPanel": "تركيز اللوحة",
|
||||
"agentManager.shortcuts.openAgentManager": "فتح Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "إظهار اختصارات لوحة المفاتيح",
|
||||
"agentManager.dialog.deleteWorktree.title": "حذف Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "حذف Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost": "؟ سيؤدي هذا إلى إزالة Worktree من القرص وفصل جميع الجلسات.",
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Alternar terminal",
|
||||
"agentManager.shortcuts.focusPanel": "Focar painel",
|
||||
"agentManager.shortcuts.openAgentManager": "Abrir Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "Mostrar atalhos de teclado",
|
||||
"agentManager.dialog.deleteWorktree.title": "Excluir Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Excluir Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost": "? Isso remove o Worktree do disco e desassocia todas as sessões.",
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Prebaci terminal",
|
||||
"agentManager.shortcuts.focusPanel": "Fokusiraj panel",
|
||||
"agentManager.shortcuts.openAgentManager": "Otvori Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "Prikaži prečice na tastaturi",
|
||||
"agentManager.dialog.deleteWorktree.title": "Obriši Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Obriši Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost": "? Ovo uklanja Worktree sa diska i odvezuje sve sesije.",
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Skift terminal",
|
||||
"agentManager.shortcuts.focusPanel": "Fokuser panel",
|
||||
"agentManager.shortcuts.openAgentManager": "Åbn Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "Vis tastaturgenveje",
|
||||
"agentManager.dialog.deleteWorktree.title": "Slet Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Slet Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost": "? Dette fjerner Worktree fra disken og afkobler alle sessioner.",
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Terminal umschalten",
|
||||
"agentManager.shortcuts.focusPanel": "Panel fokussieren",
|
||||
"agentManager.shortcuts.openAgentManager": "Agent Manager öffnen",
|
||||
"agentManager.shortcuts.showShortcuts": "Tastenkürzel anzeigen",
|
||||
"agentManager.dialog.deleteWorktree.title": "Worktree löschen",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Worktree löschen ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost":
|
||||
|
||||
@@ -55,6 +55,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Toggle terminal",
|
||||
"agentManager.shortcuts.focusPanel": "Focus panel",
|
||||
"agentManager.shortcuts.openAgentManager": "Open Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "Show keyboard shortcuts",
|
||||
|
||||
"agentManager.dialog.deleteWorktree.title": "Delete Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Delete worktree ",
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Alternar terminal",
|
||||
"agentManager.shortcuts.focusPanel": "Enfocar panel",
|
||||
"agentManager.shortcuts.openAgentManager": "Abrir Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "Mostrar atajos de teclado",
|
||||
"agentManager.dialog.deleteWorktree.title": "Eliminar Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "¿Eliminar Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost":
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Basculer le terminal",
|
||||
"agentManager.shortcuts.focusPanel": "Focaliser le panneau",
|
||||
"agentManager.shortcuts.openAgentManager": "Ouvrir Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "Afficher les raccourcis clavier",
|
||||
"agentManager.dialog.deleteWorktree.title": "Supprimer le Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Supprimer le Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost":
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "ターミナルの切り替え",
|
||||
"agentManager.shortcuts.focusPanel": "パネルにフォーカス",
|
||||
"agentManager.shortcuts.openAgentManager": "Agent Managerを開く",
|
||||
"agentManager.shortcuts.showShortcuts": "キーボードショートカットを表示",
|
||||
"agentManager.dialog.deleteWorktree.title": "Worktreeを削除",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Worktreeを削除 ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost":
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "터미널 전환",
|
||||
"agentManager.shortcuts.focusPanel": "패널 포커스",
|
||||
"agentManager.shortcuts.openAgentManager": "Agent Manager 열기",
|
||||
"agentManager.shortcuts.showShortcuts": "키보드 단축키 표시",
|
||||
"agentManager.dialog.deleteWorktree.title": "Worktree 삭제",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Worktree 삭제 ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost": "? 디스크에서 Worktree를 제거하고 모든 세션의 연결을 해제합니다.",
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Veksle terminal",
|
||||
"agentManager.shortcuts.focusPanel": "Fokuser panel",
|
||||
"agentManager.shortcuts.openAgentManager": "Åpne Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "Vis tastatursnarveier",
|
||||
"agentManager.dialog.deleteWorktree.title": "Slett Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Slett Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost": "? Dette fjerner Worktree fra disken og kobler fra alle økter.",
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Przełącz terminal",
|
||||
"agentManager.shortcuts.focusPanel": "Fokus na panelu",
|
||||
"agentManager.shortcuts.openAgentManager": "Otwórz Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "Pokaż skróty klawiszowe",
|
||||
"agentManager.dialog.deleteWorktree.title": "Usuń Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Usunąć Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost":
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "Переключить терминал",
|
||||
"agentManager.shortcuts.focusPanel": "Фокус на панели",
|
||||
"agentManager.shortcuts.openAgentManager": "Открыть Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "Показать сочетания клавиш",
|
||||
"agentManager.dialog.deleteWorktree.title": "Удалить Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "Удалить Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost": "? Это удалит Worktree с диска и отключит все сессии.",
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "สลับเทอร์มินัล",
|
||||
"agentManager.shortcuts.focusPanel": "โฟกัสแผง",
|
||||
"agentManager.shortcuts.openAgentManager": "เปิด Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "แสดงปุ่มลัดแป้นพิมพ์",
|
||||
"agentManager.dialog.deleteWorktree.title": "ลบ Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "ลบ Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost":
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "切换终端",
|
||||
"agentManager.shortcuts.focusPanel": "聚焦面板",
|
||||
"agentManager.shortcuts.openAgentManager": "打开 Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "显示键盘快捷键",
|
||||
"agentManager.dialog.deleteWorktree.title": "删除 Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "删除 Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost": "?这将从磁盘中移除 Worktree 并取消所有会话的关联。",
|
||||
|
||||
@@ -49,6 +49,7 @@ export const dict = {
|
||||
"agentManager.shortcuts.toggleTerminal": "切換終端機",
|
||||
"agentManager.shortcuts.focusPanel": "聚焦面板",
|
||||
"agentManager.shortcuts.openAgentManager": "開啟 Agent Manager",
|
||||
"agentManager.shortcuts.showShortcuts": "顯示鍵盤快捷鍵",
|
||||
"agentManager.dialog.deleteWorktree.title": "刪除 Worktree",
|
||||
"agentManager.dialog.deleteWorktree.messagePre": "刪除 Worktree ",
|
||||
"agentManager.dialog.deleteWorktree.messagePost": "?這將從磁碟中移除 Worktree 並取消所有工作階段的關聯。",
|
||||
|
||||
Reference in New Issue
Block a user