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/agent-manager-modifier-shortcut-peek.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": minor
---

Show the ⌘1-9 (Ctrl+1-9 on Windows/Linux) shortcut badges on every Agent Manager sidebar card while the modifier key is held, making it easy to see which number jumps to which worktree before pressing it.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ const AgentManagerContent: Component = () => {
const [repoBranch, setRepoBranch] = createSignal<string | undefined>()
const [busyWorktrees, setBusyWorktrees] = createSignal<Map<string, WorktreeBusyState>>(new Map())
const [staleWorktreeIds, setStaleWorktreeIds] = createSignal<Set<string>>(new Set())
/** True while the ⌘/Ctrl jump modifier is held — reveals the ⌘1-9 badges on all sidebar items. */
const [held, setHeld] = createSignal(false)
const [worktreesLoaded, setWorktreesLoaded] = createSignal(false)
const [sessionsLoaded, setSessionsLoaded] = createSignal(false)
const [isGitRepo, setIsGitRepo] = createSignal(true)
Expand Down Expand Up @@ -1207,6 +1209,18 @@ const AgentManagerContent: Component = () => {
}
window.addEventListener("keydown", deleteKeyHandler)

// Reveal the ⌘/Ctrl+1-9 jump badges on all sidebar items while the modifier is held.
// Capture phase so the terminal's key handlers can't swallow them; blur resets state
// when the keyup is lost (e.g. Cmd+Tab away).
const modifier = isMac ? "Meta" : "Control"
const modTrack = (e: KeyboardEvent) => {
if (e.key === modifier) setHeld(e.type === "keydown")
}
const modReset = () => setHeld(false)
window.addEventListener("keydown", modTrack, true)
window.addEventListener("keyup", modTrack, true)
window.addEventListener("blur", modReset)

// When the panel regains focus (e.g. returning from terminal), focus the prompt
// and clear any stale body styles left by Kobalte modal overlays (dropdowns/dialogs
// set pointer-events:none and overflow:hidden on body, but cleanup never runs if
Expand Down Expand Up @@ -1578,6 +1592,9 @@ const AgentManagerContent: Component = () => {
window.removeEventListener("message", handler)
window.removeEventListener("keydown", preventDefaults, true)
window.removeEventListener("keydown", deleteKeyHandler)
window.removeEventListener("keydown", modTrack, true)
window.removeEventListener("keyup", modTrack, true)
window.removeEventListener("blur", modReset)
window.removeEventListener("focus", onWindowFocus)
window.removeEventListener("newTaskRequest", newTaskHandler, true)
drafts.cleanup()
Expand Down Expand Up @@ -2269,7 +2286,7 @@ const AgentManagerContent: Component = () => {
>
<div
class="am-sidebar"
classList={{ "am-sidebar-collapsed": sidebarCollapsed() }}
classList={{ "am-sidebar-collapsed": sidebarCollapsed(), "am-show-shortcuts": held() }}
style={{ width: sidebarCollapsed() ? "0px" : `${sidebarWidth()}px` }}
inert={sidebarCollapsed() || undefined}
>
Expand Down
19 changes: 19 additions & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,25 @@ button.am-section-toggle:hover .am-section-label {
color: var(--text-weak);
}

/* Jump modifier held (⌘/Ctrl): reveal shortcut badges on every item, not just the
hovered one. Scoped via :has so items without a badge (beyond ⌘9) keep their stats.
The close button stays hidden so holding the modifier never exposes the delete action. */
.am-show-shortcuts .am-wt-hover-actions:has(.am-shortcut-badge) {
opacity: 1;
visibility: visible;
}
.am-show-shortcuts .am-wt-hover-actions .am-worktree-close {
display: none;
}
.am-show-shortcuts .am-wt-actions-cell:has(.am-shortcut-badge) > .am-worktree-stats,
.am-show-shortcuts .am-wt-actions-cell:has(.am-shortcut-badge) > .am-worktree-stats-skeleton {
opacity: 0;
visibility: hidden;
}
.am-show-shortcuts .am-local-item .am-shortcut-badge {
opacity: 1;
}

.am-worktree-item:has(.am-worktree-rename-input) .am-wt-row2 {
display: none;
}
Expand Down
Loading