Skip to content

Commit b1702cd

Browse files
refactor(agent-manager): remove redundant header buttons (#4568)
* refactor(agent-manager): remove redundant header buttons Remove the 'New Agent' (Plus) and 'Refresh messages' (RefreshCw) buttons from the session detail header. These actions are already available in the sidebar, making the header buttons redundant. Changes: - Remove am-header-actions div with both buttons - Remove unused imports: Plus, RefreshCw, selectedSessionIdAtom, useSetAtom - Remove handleRefresh and handleNew functions * Update remove-agent-manager-header-buttons.md
1 parent c018a5a commit b1702cd

File tree

2 files changed

+7
-45
lines changed

2 files changed

+7
-45
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"kilo-code": patch
3+
---
4+
5+
Remove redundant "New Agent" and "Refresh messages" buttons from agent manager session detail header.

webview-ui/src/kilocode/agent-manager/components/SessionDetail.tsx

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React, { useState, useEffect, useMemo, useRef } from "react"
2-
import { useAtom, useAtomValue, useSetAtom } from "jotai"
2+
import { useAtom, useAtomValue } from "jotai"
33
import { useTranslation } from "react-i18next"
44
import {
55
selectedSessionAtom,
6-
selectedSessionIdAtom,
76
startSessionFailedCounterAtom,
87
pendingSessionAtom,
98
preferredRunModeAtom,
@@ -19,19 +18,7 @@ import { ChatInput } from "./ChatInput"
1918
import { BranchPicker } from "./BranchPicker"
2019
import { vscode } from "../utils/vscode"
2120
import { formatRelativeTime, createRelativeTimeLabels } from "../utils/timeUtils"
22-
import {
23-
Loader2,
24-
SendHorizontal,
25-
RefreshCw,
26-
GitBranch,
27-
Folder,
28-
ChevronDown,
29-
AlertCircle,
30-
Zap,
31-
Layers,
32-
X,
33-
Plus,
34-
} from "lucide-react"
21+
import { Loader2, SendHorizontal, GitBranch, Folder, ChevronDown, AlertCircle, Zap, Layers, X } from "lucide-react"
3522
import DynamicTextArea from "react-textarea-autosize"
3623
import { cn } from "../../../lib/utils"
3724
import { StandardTooltip } from "../../../components/ui"
@@ -43,7 +30,6 @@ export function SessionDetail() {
4330
const pendingSession = useAtomValue(pendingSessionAtom)
4431
const machineUiState = useAtomValue(sessionMachineUiStateAtom)
4532
const selectedSessionState = useAtomValue(selectedSessionMachineStateAtom)
46-
const setSelectedSessionId = useSetAtom(selectedSessionIdAtom)
4733
const prevSessionStateRef = useRef<{ id: string; status: string } | undefined>(undefined)
4834

4935
// Hooks must be called unconditionally before any early returns
@@ -79,14 +65,6 @@ export function SessionDetail() {
7965
return <NewAgentForm />
8066
}
8167

82-
const handleRefresh = () => {
83-
vscode.postMessage({ type: "agentManager.refreshSessionMessages", sessionId: selectedSession.sessionId })
84-
}
85-
86-
const handleNew = () => {
87-
setSelectedSessionId(null)
88-
}
89-
9068
// Use state machine UI state as the single source of truth for activity/spinner
9169
const sessionUiState = machineUiState[selectedSession.sessionId]
9270
const isActive = sessionUiState?.isActive ?? false
@@ -136,27 +114,6 @@ export function SessionDetail() {
136114
)}
137115
</div>
138116
</div>
139-
140-
<div className="am-header-actions">
141-
{!showSpinner && (
142-
<button
143-
className="am-icon-btn"
144-
onClick={handleNew}
145-
aria-label={t("sessionDetail.newButtonTitle")}
146-
title={t("sessionDetail.newButtonTitle")}>
147-
<Plus size={14} />
148-
</button>
149-
)}
150-
{!isActive && (
151-
<button
152-
className="am-icon-btn"
153-
onClick={handleRefresh}
154-
aria-label={t("sessionDetail.refreshButtonTitle")}
155-
title={t("sessionDetail.refreshButtonTitle")}>
156-
<RefreshCw size={14} />
157-
</button>
158-
)}
159-
</div>
160117
</div>
161118

162119
{selectedSession.status === "error" && selectedSession.error && (

0 commit comments

Comments
 (0)