Skip to content

Commit 66bd209

Browse files
committed
[Condense] Show indicator message when context is condensing
1 parent ff837d5 commit 66bd209

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { Markdown } from "./Markdown"
3232
import { CommandExecution } from "./CommandExecution"
3333
import { CommandExecutionError } from "./CommandExecutionError"
3434
import { AutoApprovedRequestLimitWarning } from "./AutoApprovedRequestLimitWarning"
35-
import { ContextCondenseRow } from "./ContextCondenseRow"
35+
import { CondensingContextRow, ContextCondenseRow } from "./ContextCondenseRow"
3636

3737
interface ChatRowProps {
3838
message: ClineMessage
@@ -929,6 +929,9 @@ export const ChatRowContent = ({
929929
/>
930930
)
931931
case "condense_context":
932+
if (message.partial) {
933+
return <CondensingContextRow />
934+
}
932935
return message.contextCondense ? <ContextCondenseRow {...message.contextCondense} /> : null
933936
default:
934937
return (

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,8 +979,18 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
979979
result.push([...currentGroup])
980980
}
981981

982+
if (isCondensing) {
983+
// Show indicator after clicking condense button
984+
result.push({
985+
type: "say",
986+
say: "condense_context",
987+
ts: Date.now(),
988+
partial: true,
989+
})
990+
}
991+
982992
return result
983-
}, [visibleMessages])
993+
}, [isCondensing, visibleMessages])
984994

985995
// scrolling
986996

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { VSCodeBadge } from "@vscode/webview-ui-toolkit/react"
44

55
import { ContextCondense } from "@roo/schemas"
66
import { Markdown } from "./Markdown"
7+
import { ProgressIndicator } from "./ProgressIndicator"
78

89
export const ContextCondenseRow = ({ cost, prevContextTokens, newContextTokens, summary }: ContextCondense) => {
910
const { t } = useTranslation()
@@ -14,6 +15,19 @@ export const ContextCondenseRow = ({ cost, prevContextTokens, newContextTokens,
1415
<div
1516
className="flex items-center justify-between cursor-pointer select-none"
1617
onClick={() => setIsExpanded(!isExpanded)}>
18+
<div
19+
style={{
20+
width: 16,
21+
height: 16,
22+
display: "flex",
23+
alignItems: "center",
24+
justifyContent: "center",
25+
}}>
26+
<span
27+
className={`codicon codicon-check`}
28+
style={{ color: "var(--vscode-charts-green)", fontSize: 16, marginBottom: "-1.5px" }}
29+
/>
30+
</div>
1731
<div className="flex items-center gap-2 flex-grow">
1832
<span className="codicon codicon-compress text-blue-400" />
1933
<span className="font-bold text-vscode-foreground">{t("chat:contextCondense.title")}</span>
@@ -33,3 +47,14 @@ export const ContextCondenseRow = ({ cost, prevContextTokens, newContextTokens,
3347
</div>
3448
)
3549
}
50+
51+
export const CondensingContextRow = () => {
52+
const { t } = useTranslation()
53+
return (
54+
<div className="flex items-center gap-2">
55+
<ProgressIndicator />
56+
<span className="codicon codicon-compress text-blue-400" />
57+
<span className="font-bold text-vscode-foreground">{t("chat:contextCondense.condensing")}</span>
58+
</div>
59+
)
60+
}

webview-ui/src/i18n/locales/en/chat.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
},
133133
"contextCondense": {
134134
"title": "Context Condensed",
135+
"condensing": "Condensing context...",
135136
"tokens": "tokens"
136137
},
137138
"instructions": {

0 commit comments

Comments
 (0)