Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 7da429d

Browse files
Revert "feat: add task header highlight for visual status indication" (#11349)
Revert "feat: add task header highlight for visual status indication (#11305)" This reverts commit 5313cb5.
1 parent c74acf3 commit 7da429d

28 files changed

Lines changed: 24 additions & 434 deletions

packages/types/src/global-settings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ export const globalSettingsSchema = z.object({
167167
ttsSpeed: z.number().optional(),
168168
soundEnabled: z.boolean().optional(),
169169
soundVolume: z.number().optional(),
170-
taskHeaderHighlightEnabled: z.boolean().optional(),
171170

172171
maxOpenTabsContext: z.number().optional(),
173172
maxWorkspaceFiles: z.number().optional(),
@@ -361,7 +360,6 @@ export const EVALS_SETTINGS: RooCodeSettings = {
361360
ttsSpeed: 1,
362361
soundEnabled: false,
363362
soundVolume: 0.5,
364-
taskHeaderHighlightEnabled: false,
365363

366364
terminalShellIntegrationTimeout: 30000,
367365
terminalCommandDelay: 0,

packages/types/src/vscode-extension-host.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ export type ExtensionState = Pick<
285285
| "ttsSpeed"
286286
| "soundEnabled"
287287
| "soundVolume"
288-
| "taskHeaderHighlightEnabled"
289288
| "terminalOutputPreviewSize"
290289
| "terminalShellIntegrationTimeout"
291290
| "terminalShellIntegrationDisabled"

src/core/webview/ClineProvider.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,6 @@ export class ClineProvider
21162116
historyPreviewCollapsed,
21172117
reasoningBlockCollapsed,
21182118
enterBehavior,
2119-
taskHeaderHighlightEnabled,
21202119
cloudUserInfo,
21212120
cloudIsAuthenticated,
21222121
sharingEnabled,
@@ -2261,7 +2260,6 @@ export class ClineProvider
22612260
historyPreviewCollapsed: historyPreviewCollapsed ?? false,
22622261
reasoningBlockCollapsed: reasoningBlockCollapsed ?? true,
22632262
enterBehavior: enterBehavior ?? "send",
2264-
taskHeaderHighlightEnabled: taskHeaderHighlightEnabled ?? false,
22652263
cloudUserInfo,
22662264
cloudIsAuthenticated: cloudIsAuthenticated ?? false,
22672265
cloudAuthSkipModel: this.context.globalState.get<boolean>("roo-auth-skip-model") ?? false,
@@ -2503,7 +2501,6 @@ export class ClineProvider
25032501
historyPreviewCollapsed: stateValues.historyPreviewCollapsed ?? false,
25042502
reasoningBlockCollapsed: stateValues.reasoningBlockCollapsed ?? true,
25052503
enterBehavior: stateValues.enterBehavior ?? "send",
2506-
taskHeaderHighlightEnabled: stateValues.taskHeaderHighlightEnabled ?? false,
25072504
cloudUserInfo,
25082505
cloudIsAuthenticated,
25092506
sharingEnabled,

webview-ui/src/components/chat/TaskHeader.tsx

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -68,43 +68,27 @@ const TaskHeader = ({
6868
todos,
6969
}: TaskHeaderProps) => {
7070
const { t } = useTranslation()
71-
const { apiConfiguration, currentTaskItem, clineMessages, isBrowserSessionActive, taskHeaderHighlightEnabled } =
72-
useExtensionState()
71+
const { apiConfiguration, currentTaskItem, clineMessages, isBrowserSessionActive } = useExtensionState()
7372
const { id: modelId, info: model } = useSelectedModel(apiConfiguration)
7473
const [isTaskExpanded, setIsTaskExpanded] = useState(false)
7574
const [showLongRunningTaskMessage, setShowLongRunningTaskMessage] = useState(false)
7675
const { isOpen, openUpsell, closeUpsell, handleConnect } = useCloudUpsell({
7776
autoOpenOnAuth: false,
7877
})
7978

80-
// Determine if this is a subtask (has a parent)
81-
const isSubtask = !!parentTaskId
82-
83-
// Find the last message that isn't a resume action (shared by isTaskComplete and highlightClass)
84-
const lastRelevantMessage = useMemo(() => {
85-
const msgs = clineMessages || []
86-
const idx = findLastIndex(msgs, (m) => !(m.ask === "resume_task" || m.ask === "resume_completed_task"))
87-
return idx !== -1 ? msgs[idx] : undefined
88-
}, [clineMessages])
89-
9079
// Check if the task is complete by looking at the last relevant message (skipping resume messages)
91-
const isTaskComplete = lastRelevantMessage?.ask === "completion_result"
92-
93-
// Compute highlight CSS class: green for task complete, yellow for user attention needed
94-
const highlightClass = useMemo(() => {
95-
if (!taskHeaderHighlightEnabled || isSubtask) return undefined
96-
if (!lastRelevantMessage || lastRelevantMessage.partial) return undefined
97-
98-
if (lastRelevantMessage.ask === "completion_result") {
99-
return "task-header-highlight-green"
100-
}
101-
102-
if (lastRelevantMessage.ask) {
103-
return "task-header-highlight-yellow"
104-
}
105-
106-
return undefined
107-
}, [taskHeaderHighlightEnabled, isSubtask, lastRelevantMessage])
80+
const isTaskComplete =
81+
clineMessages && clineMessages.length > 0
82+
? (() => {
83+
const lastRelevantIndex = findLastIndex(
84+
clineMessages,
85+
(m) => !(m.ask === "resume_task" || m.ask === "resume_completed_task"),
86+
)
87+
return lastRelevantIndex !== -1
88+
? clineMessages[lastRelevantIndex]?.ask === "completion_result"
89+
: false
90+
})()
91+
: false
10892

10993
useEffect(() => {
11094
const timer = setTimeout(() => {
@@ -157,6 +141,9 @@ const TaskHeader = ({
157141

158142
const hasTodos = todos && Array.isArray(todos) && todos.length > 0
159143

144+
// Determine if this is a subtask (has a parent)
145+
const isSubtask = !!parentTaskId
146+
160147
const handleBackToParent = () => {
161148
if (parentTaskId) {
162149
vscode.postMessage({ type: "showTaskWithId", text: parentTaskId })
@@ -187,14 +174,12 @@ const TaskHeader = ({
187174
</DismissibleUpsell>
188175
)}
189176
<div
190-
data-testid="task-header-container"
191177
className={cn(
192178
"px-3 pt-2.5 pb-2 flex flex-col gap-1.5 relative z-1 cursor-pointer",
193179
"bg-vscode-input-background hover:bg-vscode-input-background/90",
194180
"text-vscode-foreground/80 hover:text-vscode-foreground",
195181
"shadow-lg shadow-vscode-sideBar-background/50 rounded-xl",
196182
hasTodos && "border-b-0",
197-
highlightClass,
198183
)}
199184
onClick={(e) => {
200185
// Don't expand if clicking on todos section

webview-ui/src/components/chat/__tests__/TaskHeader.spec.tsx

Lines changed: 0 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ let mockExtensionState: {
4040
apiConfiguration: ProviderSettings
4141
currentTaskItem: { id: string } | null
4242
clineMessages: any[]
43-
taskHeaderHighlightEnabled?: boolean
4443
} = {
4544
apiConfiguration: {
4645
apiProvider: "anthropic",
@@ -49,7 +48,6 @@ let mockExtensionState: {
4948
} as ProviderSettings,
5049
currentTaskItem: { id: "test-task-id" },
5150
clineMessages: [],
52-
taskHeaderHighlightEnabled: false,
5351
}
5452

5553
// Mock the ExtensionStateContext
@@ -217,7 +215,6 @@ describe("TaskHeader", () => {
217215
} as ProviderSettings,
218216
currentTaskItem: { id: "test-task-id" },
219217
clineMessages: [],
220-
taskHeaderHighlightEnabled: false,
221218
}
222219
})
223220

@@ -426,175 +423,6 @@ describe("TaskHeader", () => {
426423
})
427424
})
428425

429-
describe("Task header highlight", () => {
430-
const completionMessages = [
431-
{
432-
type: "ask",
433-
ask: "completion_result",
434-
ts: Date.now(),
435-
text: "Task completed!",
436-
},
437-
]
438-
439-
beforeEach(() => {
440-
mockExtensionState = {
441-
apiConfiguration: {
442-
apiProvider: "anthropic",
443-
apiKey: "test-api-key",
444-
apiModelId: "claude-3-opus-20240229",
445-
} as ProviderSettings,
446-
currentTaskItem: { id: "test-task-id" },
447-
clineMessages: [],
448-
taskHeaderHighlightEnabled: false,
449-
}
450-
})
451-
452-
it("should apply green highlight class when task is complete and highlight is enabled", () => {
453-
mockExtensionState = {
454-
...mockExtensionState,
455-
clineMessages: completionMessages,
456-
taskHeaderHighlightEnabled: true,
457-
}
458-
459-
renderTaskHeader()
460-
461-
const container = screen.getByTestId("task-header-container")
462-
expect(container.classList.contains("task-header-highlight-green")).toBe(true)
463-
expect(container.classList.contains("task-header-highlight-yellow")).toBe(false)
464-
})
465-
466-
it("should apply yellow highlight class when task needs user attention and highlight is enabled", () => {
467-
mockExtensionState = {
468-
...mockExtensionState,
469-
clineMessages: [
470-
{
471-
type: "ask",
472-
ask: "tool",
473-
ts: Date.now(),
474-
text: "Need permission to use tool",
475-
},
476-
],
477-
taskHeaderHighlightEnabled: true,
478-
}
479-
480-
renderTaskHeader()
481-
482-
const container = screen.getByTestId("task-header-container")
483-
expect(container.classList.contains("task-header-highlight-yellow")).toBe(true)
484-
expect(container.classList.contains("task-header-highlight-green")).toBe(false)
485-
})
486-
487-
it("should not apply highlight when highlight is disabled", () => {
488-
mockExtensionState = {
489-
...mockExtensionState,
490-
clineMessages: completionMessages,
491-
taskHeaderHighlightEnabled: false,
492-
}
493-
494-
renderTaskHeader()
495-
496-
const container = screen.getByTestId("task-header-container")
497-
expect(container.classList.contains("task-header-highlight-green")).toBe(false)
498-
expect(container.classList.contains("task-header-highlight-yellow")).toBe(false)
499-
})
500-
501-
it("should not apply highlight when task is a subtask", () => {
502-
mockExtensionState = {
503-
...mockExtensionState,
504-
clineMessages: completionMessages,
505-
taskHeaderHighlightEnabled: true,
506-
}
507-
508-
renderTaskHeader({ parentTaskId: "parent-task-123" })
509-
510-
const container = screen.getByTestId("task-header-container")
511-
expect(container.classList.contains("task-header-highlight-green")).toBe(false)
512-
expect(container.classList.contains("task-header-highlight-yellow")).toBe(false)
513-
})
514-
515-
it("should not apply highlight when last message is partial", () => {
516-
mockExtensionState = {
517-
...mockExtensionState,
518-
clineMessages: [
519-
{
520-
type: "ask",
521-
ask: "completion_result",
522-
ts: Date.now(),
523-
text: "Task completed!",
524-
partial: true,
525-
},
526-
],
527-
taskHeaderHighlightEnabled: true,
528-
}
529-
530-
renderTaskHeader()
531-
532-
const container = screen.getByTestId("task-header-container")
533-
expect(container.classList.contains("task-header-highlight-green")).toBe(false)
534-
expect(container.classList.contains("task-header-highlight-yellow")).toBe(false)
535-
})
536-
537-
it("should not apply highlight when no clineMessages exist", () => {
538-
mockExtensionState = {
539-
...mockExtensionState,
540-
clineMessages: [],
541-
taskHeaderHighlightEnabled: true,
542-
}
543-
544-
renderTaskHeader()
545-
546-
const container = screen.getByTestId("task-header-container")
547-
expect(container.classList.contains("task-header-highlight-green")).toBe(false)
548-
expect(container.classList.contains("task-header-highlight-yellow")).toBe(false)
549-
})
550-
551-
it("should not apply highlight when last relevant message has no ask type", () => {
552-
mockExtensionState = {
553-
...mockExtensionState,
554-
clineMessages: [{ type: "say", say: "text", ts: Date.now(), text: "Working..." }],
555-
taskHeaderHighlightEnabled: true,
556-
}
557-
558-
renderTaskHeader()
559-
560-
const container = screen.getByTestId("task-header-container")
561-
expect(container.classList.contains("task-header-highlight-green")).toBe(false)
562-
expect(container.classList.contains("task-header-highlight-yellow")).toBe(false)
563-
})
564-
565-
it("should apply green class when completion_result is followed by resume messages", () => {
566-
mockExtensionState = {
567-
...mockExtensionState,
568-
clineMessages: [
569-
{
570-
type: "ask",
571-
ask: "completion_result",
572-
ts: Date.now() - 2000,
573-
text: "Task completed!",
574-
},
575-
{
576-
type: "ask",
577-
ask: "resume_completed_task",
578-
ts: Date.now() - 1000,
579-
text: "Resume completed task?",
580-
},
581-
{
582-
type: "ask",
583-
ask: "resume_task",
584-
ts: Date.now(),
585-
text: "Resume task?",
586-
},
587-
],
588-
taskHeaderHighlightEnabled: true,
589-
}
590-
591-
renderTaskHeader()
592-
593-
const container = screen.getByTestId("task-header-container")
594-
expect(container.classList.contains("task-header-highlight-green")).toBe(true)
595-
})
596-
})
597-
598426
describe("Context window percentage calculation", () => {
599427
// The percentage should be calculated as:
600428
// contextTokens / (contextWindow - reservedForOutput) * 100

0 commit comments

Comments
 (0)