Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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-intro-screen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": minor
---

Explain worktrees, parallel agents, PR status, and conflict resolution with an inline Agent Manager introduction. Remember whether it is enabled and let users restore it from the welcome screen.
2 changes: 2 additions & 0 deletions packages/kilo-docs/source-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
<!-- packages/opencode/src/kilocode/provider/error.ts -->
- <https://kilo.ai/docs/ai-providers#custom-provider>
<!-- packages/kilo-vscode/webview-ui/src/components/settings/CustomProviderDialog.tsx -->
- <https://kilo.ai/docs/automate/agent-manager-workflows>
<!-- packages/kilo-vscode/webview-ui/agent-manager/intro/AgentManagerIntro.tsx -->
- <https://kilo.ai/docs/automate/mcp/what-is-mcp>
<!-- packages/kilo-vscode/webview-ui/src/components/marketplace/InstallModal.tsx -->
- <https://kilo.ai/docs/code-with-ai/platforms/github>
Expand Down
9 changes: 8 additions & 1 deletion packages/kilo-vscode/src/agent-manager/vscode-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { TelemetryProxy, type TelemetryEventName } from "../services/telemetry"
import type { AutoApproveController } from "../commands/toggle-auto-approve"
import type { RemoteStatusService } from "../services/RemoteStatusService"

const INTRO_KEY = "kilo.agentManager.introDismissed"

export class VscodeHost implements Host {
private diffVirtual: DiffVirtualProvider | undefined
private autoApprove: AutoApproveController | undefined
Expand Down Expand Up @@ -104,6 +106,7 @@ export class VscodeHost implements Host {
title: "Agent Manager",
port,
browserAutomation: this.browserAutomation(),
introDismissed: this.context.globalState.get<boolean>(INTRO_KEY) === true,
frameSrc: ["localhost", "127.0.0.1"].map((host) => `http://${host}:*`).join(" "),
})

Expand Down Expand Up @@ -135,7 +138,11 @@ export class VscodeHost implements Host {
}
provider.setRemoteService(this.remoteService)
provider.attachToWebview(panel.webview, {
onBeforeMessage: opts.onBeforeMessage,
onBeforeMessage: async (msg) => {
if (msg.type !== "agentManager.setIntroDismissed") return opts.onBeforeMessage(msg)
if (typeof msg.dismissed === "boolean") await this.context.globalState.update(INTRO_KEY, msg.dismissed)
return null
},
})
provider.setStreamVisibility(panel.active && panel.visible)
const streams = panel.onDidChangeViewState((event) =>
Expand Down
3 changes: 2 additions & 1 deletion packages/kilo-vscode/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export function buildWebviewHtml(
topBarSurface?: string
agentManagerSettings?: boolean
browserAutomation?: boolean
introDismissed?: boolean
frameSrc?: string
sidebar?: "left" | "right"
},
Expand Down Expand Up @@ -111,7 +112,7 @@ export function buildWebviewHtml(
</head>
<body>
<div id="root"></div>
<script nonce="${nonce}">window.ICONS_BASE_URI = "${opts.iconsBaseUri}"; window.KILO_SHIKI_WORKER_URI = "${opts.workerUri}"; window.KILO_MARKDOWN_SHIKI_WORKER_URI = "${markdownWorkerUri}"; window.KILO_TOP_BAR = ${opts.topBar !== false}; window.KILO_TOP_BAR_SURFACE = "${opts.topBarSurface ?? "sidebar_title"}"; window.KILO_AGENT_MANAGER_SETTINGS = ${opts.agentManagerSettings === true}; window.KILO_BROWSER_AUTOMATION = ${opts.browserAutomation === true};</script>
<script nonce="${nonce}">window.ICONS_BASE_URI = "${opts.iconsBaseUri}"; window.KILO_SHIKI_WORKER_URI = "${opts.workerUri}"; window.KILO_MARKDOWN_SHIKI_WORKER_URI = "${markdownWorkerUri}"; window.KILO_TOP_BAR = ${opts.topBar !== false}; window.KILO_TOP_BAR_SURFACE = "${opts.topBarSurface ?? "sidebar_title"}"; window.KILO_AGENT_MANAGER_SETTINGS = ${opts.agentManagerSettings === true}; window.KILO_BROWSER_AUTOMATION = ${opts.browserAutomation === true}; window.KILO_AGENT_MANAGER_INTRO_DISMISSED = ${opts.introDismissed === true};</script>
<script nonce="${nonce}" src="${opts.scriptUri}"></script>
</body>
</html>`
Expand Down
4 changes: 4 additions & 0 deletions packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ const EDIT_PREVIEW_PANEL_FILE = path.join(ROOT, "webview-ui/agent-manager/EditPr
const CSS_FILES = [
path.join(ROOT, "webview-ui/agent-manager/agent-manager.css"),
path.join(ROOT, "webview-ui/agent-manager/agent-manager-review.css"),
path.join(ROOT, "webview-ui/agent-manager/intro/intro.css"),
path.join(ROOT, "webview-ui/browser/browser.css"),
]
const TSX_FILES = [
path.join(ROOT, "webview-ui/agent-manager/AgentManagerApp.tsx"),
path.join(ROOT, "webview-ui/agent-manager/intro/AgentManagerIntro.tsx"),
path.join(ROOT, "webview-ui/agent-manager/intro/IntroGraph.tsx"),
path.join(ROOT, "webview-ui/src/components/chat/MessageList.tsx"),
path.join(ROOT, "webview-ui/agent-manager/SubagentPanel.tsx"),
path.join(ROOT, "webview-ui/agent-manager/EditPreviewPanel.tsx"),
path.join(ROOT, "webview-ui/agent-manager/SessionRowActions.tsx"),
Expand Down
73 changes: 52 additions & 21 deletions packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import { ProviderShell } from "../src/context/provider-shell"
import { ChatView } from "../src/components/chat"
import HistoryView from "../src/components/history/HistoryView"
import { NewWorktreeDialog } from "./NewWorktreeDialog"
import { AgentManagerEmptyState, createIntro } from "./intro/AgentManagerIntro"
import { createModeRouter } from "./mode-router"
import { ProjectList } from "./ProjectList"
import { SidebarBody } from "./SidebarBody"
Expand Down Expand Up @@ -1918,6 +1919,52 @@ const AgentManagerContent: Component = () => {
vscode.postMessage({ type: "agentManager.addSessionToWorktree", worktreeId: sel })
}
}
const selectChatSession = (id: string) => {
if (addSessionToCurrentWorktree(id)) return
if (localSessionIDs().includes(id)) {
session.selectSession(id)
if (selection() === null) setSelection(LOCAL)
requestChatFocus()
return
}
// Navigate to owning worktree instead of forcing into local mode
if (worktreeSessionIds().has(id)) {
const ms = managedSessions().find((s) => s.id === id)
if (ms?.worktreeId) {
selectWorktree(ms.worktreeId)
session.selectSession(id)
setReviewActive(false)
requestChatFocus()
return
}
}
openLocally(id)
}

const intro = createIntro({
reveal: () => {
const id = session.currentSessionID() ?? activePendingId()
if (!id || session.messages().length || session.loading() || readOnly() || settingUpSelection()) {
selectLocal()
addPendingTab()
}
closeHistory()
terms.setActiveId(undefined)
setReviewActive(false)
},
focus: requestChatFocus,
})
const chatEmptyState = () => (
<AgentManagerEmptyState
base={repoDefaultBranch()}
git={isGitRepo()}
intro={intro}
onCreateWorktree={showNewWorktreeDialog}
onSelectSession={selectChatSession}
onShowHistory={() => openHistory()}
/>
)

const handleForkSession = (sessionId: string, messageId?: string) => {
const sel = selection()
const msg = { type: "agentManager.forkSession" as const, sessionId, ...(messageId ? { messageId } : {}) }
Expand Down Expand Up @@ -2301,6 +2348,7 @@ const AgentManagerContent: Component = () => {
t={t}
onSearchRef={(ref) => (sidebarSearchMenu = ref)}
onShortcuts={handleShowKeyboardShortcuts}
onHelp={intro.open}
onHistory={openHistory}
shortcutMap={projectShortcutMap}
activityFor={activity.project}
Expand Down Expand Up @@ -2331,6 +2379,7 @@ const AgentManagerContent: Component = () => {
onNewSection={newSection}
onShortcuts={metrics.click("keyboard_shortcuts", "worktrees_header", handleShowKeyboardShortcuts)}
onHistory={() => openHistory()}
onHelp={intro.open}
projectId={activeProjectId()}
sections={sections}
sortedWorktrees={sortedWorktrees}
Expand Down Expand Up @@ -2507,28 +2556,10 @@ const AgentManagerContent: Component = () => {
<div class="am-chat-wrapper" classList={{ "am-chat-wrapper-hidden": contextEmpty() }}>
<ChatView
worktrees={references}
onSelectSession={(id) => {
if (addSessionToCurrentWorktree(id)) return
if (localSessionIDs().includes(id)) {
session.selectSession(id)
if (selection() === null) setSelection(LOCAL)
requestChatFocus()
return
}
// Navigate to owning worktree instead of forcing into local mode
if (worktreeSessionIds().has(id)) {
const ms = managedSessions().find((s) => s.id === id)
if (ms?.worktreeId) {
selectWorktree(ms.worktreeId)
session.selectSession(id)
setReviewActive(false)
requestChatFocus()
return
}
}
openLocally(id)
}}
onSelectSession={selectChatSession}
onShowHistory={() => openHistory()}
emptyState={chatEmptyState}
introduction={intro.visible()}
onForkMessage={readOnly() ? undefined : handleForkSession}
onForkSession={readOnly() ? undefined : handleForkSession}
readonly={readOnly()}
Expand Down
12 changes: 11 additions & 1 deletion packages/kilo-vscode/webview-ui/agent-manager/ProjectList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createMemo, type Component } from "solid-js"
import { IconButton } from "@kilocode/kilo-ui/icon-button"
import { TooltipKeybind } from "@kilocode/kilo-ui/tooltip"
import { Tooltip, TooltipKeybind } from "@kilocode/kilo-ui/tooltip"
import type {
AgentManagerStateMessage,
AgentProjectSnapshot,
Expand Down Expand Up @@ -54,6 +54,7 @@ interface Props {
t: LanguageContextValue["t"]
onSearchRef: (ref: SidebarSearchMenuRef) => void
onShortcuts: () => void
onHelp: () => void
onHistory: (projectId: string) => void
shortcutMap?: () => Map<string, number>
}
Expand Down Expand Up @@ -198,6 +199,15 @@ export const ProjectList: Component<Props> = (props) => {
onClick={props.onShortcuts}
/>
</TooltipKeybind>
<Tooltip value={props.t("agentManager.intro.reopen")} placement="bottom">
<IconButton
icon="help"
size="small"
variant="ghost"
aria-label={props.t("agentManager.intro.reopen")}
onClick={props.onHelp}
/>
</Tooltip>
</>
}
onAdd={() => vscode.postMessage({ type: "agentManager.addProject" })}
Expand Down
2 changes: 2 additions & 0 deletions packages/kilo-vscode/webview-ui/agent-manager/SidebarBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface SidebarBodyProps {
onNewSection: () => void
onShortcuts: () => void
onHistory: () => void
onHelp: () => void
sections: () => SectionState[]
sortedWorktrees: () => WorktreeState[]
worktrees: () => WorktreeState[]
Expand Down Expand Up @@ -193,6 +194,7 @@ export const SidebarBody: Component<SidebarBodyProps> = (props) => {
onSection={props.onNewSection}
onShortcuts={props.onShortcuts}
onHistory={props.onHistory}
onHelp={props.onHelp}
onSettings={() =>
vscode.postMessage({ type: "openSettingsPanel", tab: "agentManager", projectId: props.projectId })
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { parseBindingTokens } from "./keybind-tokens"
const isMac = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.userAgent)

interface WorktreeItemProps {
preview?: boolean
worktree: WorktreeState
/** Stable composite ID used by multi-project sidebar bodies. */
sidebarId?: string
Expand Down Expand Up @@ -204,7 +205,7 @@ export const WorktreeItem: Component<WorktreeItemProps> = (props) => {
"am-wt-grouped": props.grouped,
"am-wt-group-end": props.groupEnd,
}}
data-sidebar-id={props.sidebarId ?? props.worktree.id}
data-sidebar-id={props.preview ? undefined : (props.sidebarId ?? props.worktree.id)}
onClick={() => props.onClick()}
>
<div class="am-wt-icon" data-activity={state()} aria-label={t(label(state()))}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface WorktreeSectionActionsProps extends WorktreeCreateProps {
onShortcuts: () => void
onSettings: () => void
onHistory: () => void
onHelp: () => void
}

export const WorktreeSectionActions: Component<WorktreeSectionActionsProps> = (props) => (
Expand Down Expand Up @@ -60,6 +61,15 @@ export const WorktreeSectionActions: Component<WorktreeSectionActionsProps> = (p
onClick={props.onHistory}
/>
</Tooltip>
<Tooltip value={props.t("agentManager.intro.reopen")} placement="bottom">
<IconButton
icon="help"
size="small"
variant="ghost"
aria-label={props.t("agentManager.intro.reopen")}
onClick={props.onHelp}
/>
</Tooltip>
<IconButton
icon="settings-gear"
size="small"
Expand Down
27 changes: 27 additions & 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.

28 changes: 28 additions & 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.

Loading
Loading