Skip to content

Commit e86884c

Browse files
authored
[Condense] Show indicator message when context is condensing (RooCodeInc#3765)
* [Condense] Show indicator message when context is condensing * changeset * translations
1 parent 27e47de commit e86884c

File tree

21 files changed

+62
-2
lines changed

21 files changed

+62
-2
lines changed

.changeset/four-emus-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Add a UI indicator while the context is condensing

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/ca/chat.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
},
202202
"contextCondense": {
203203
"title": "Context condensat",
204+
"condensing": "Condensant context...",
204205
"tokens": "tokens"
205206
},
206207
"followUpSuggest": {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
},
202202
"contextCondense": {
203203
"title": "Kontext komprimiert",
204+
"condensing": "Kontext wird komprimiert...",
204205
"tokens": "Tokens"
205206
},
206207
"followUpSuggest": {

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": {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
},
202202
"contextCondense": {
203203
"title": "Contexto condensado",
204+
"condensing": "Condensando contexto...",
204205
"tokens": "tokens"
205206
},
206207
"followUpSuggest": {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
},
202202
"contextCondense": {
203203
"title": "Contexte condensé",
204+
"condensing": "Condensation du contexte...",
204205
"tokens": "tokens"
205206
},
206207
"followUpSuggest": {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
},
202202
"contextCondense": {
203203
"title": "संदर्भ संक्षिप्त किया गया",
204+
"condensing": "संदर्भ संघनित कर रहा है...",
204205
"tokens": "टोकन"
205206
},
206207
"followUpSuggest": {

0 commit comments

Comments
 (0)