From 769eee2187fac03087315366f4a2a0e40c0867bc Mon Sep 17 00:00:00 2001 From: Canyon Robins Date: Tue, 20 May 2025 18:19:24 -0700 Subject: [PATCH] [Condense] Show indicator message when context is condensing (#3765) * [Condense] Show indicator message when context is condensing * changeset * translations --- .changeset/four-emus-invite.md | 5 ++++ webview-ui/src/components/chat/ChatRow.tsx | 5 +++- webview-ui/src/components/chat/ChatView.tsx | 12 ++++++++- .../components/chat/ContextCondenseRow.tsx | 25 +++++++++++++++++++ webview-ui/src/i18n/locales/ca/chat.json | 1 + webview-ui/src/i18n/locales/de/chat.json | 1 + webview-ui/src/i18n/locales/en/chat.json | 1 + webview-ui/src/i18n/locales/es/chat.json | 1 + webview-ui/src/i18n/locales/fr/chat.json | 1 + webview-ui/src/i18n/locales/hi/chat.json | 1 + webview-ui/src/i18n/locales/it/chat.json | 1 + webview-ui/src/i18n/locales/ja/chat.json | 1 + webview-ui/src/i18n/locales/ko/chat.json | 1 + webview-ui/src/i18n/locales/nl/chat.json | 1 + webview-ui/src/i18n/locales/pl/chat.json | 1 + webview-ui/src/i18n/locales/pt-BR/chat.json | 1 + webview-ui/src/i18n/locales/ru/chat.json | 1 + webview-ui/src/i18n/locales/tr/chat.json | 1 + webview-ui/src/i18n/locales/vi/chat.json | 1 + webview-ui/src/i18n/locales/zh-CN/chat.json | 1 + webview-ui/src/i18n/locales/zh-TW/chat.json | 1 + 21 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 .changeset/four-emus-invite.md diff --git a/.changeset/four-emus-invite.md b/.changeset/four-emus-invite.md new file mode 100644 index 0000000000..34c5ebf5af --- /dev/null +++ b/.changeset/four-emus-invite.md @@ -0,0 +1,5 @@ +--- +"roo-cline": patch +--- + +Add a UI indicator while the context is condensing diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 63ed225354..8777f595ce 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -32,7 +32,7 @@ import { Markdown } from "./Markdown" import { CommandExecution } from "./CommandExecution" import { CommandExecutionError } from "./CommandExecutionError" import { AutoApprovedRequestLimitWarning } from "./AutoApprovedRequestLimitWarning" -import { ContextCondenseRow } from "./ContextCondenseRow" +import { CondensingContextRow, ContextCondenseRow } from "./ContextCondenseRow" interface ChatRowProps { message: ClineMessage @@ -929,6 +929,9 @@ export const ChatRowContent = ({ /> ) case "condense_context": + if (message.partial) { + return + } return message.contextCondense ? : null default: return ( diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 4c1ce902b2..2f5eadc3ab 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -979,8 +979,18 @@ const ChatViewComponent: React.ForwardRefRenderFunction { const { t } = useTranslation() @@ -14,6 +15,19 @@ export const ContextCondenseRow = ({ cost, prevContextTokens, newContextTokens,
setIsExpanded(!isExpanded)}> +
+ +
{t("chat:contextCondense.title")} @@ -33,3 +47,14 @@ export const ContextCondenseRow = ({ cost, prevContextTokens, newContextTokens,
) } + +export const CondensingContextRow = () => { + const { t } = useTranslation() + return ( +
+ + + {t("chat:contextCondense.condensing")} +
+ ) +} diff --git a/webview-ui/src/i18n/locales/ca/chat.json b/webview-ui/src/i18n/locales/ca/chat.json index bff7eb1efb..c84b2da67e 100644 --- a/webview-ui/src/i18n/locales/ca/chat.json +++ b/webview-ui/src/i18n/locales/ca/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "Context condensat", + "condensing": "Condensant context...", "tokens": "tokens" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/de/chat.json b/webview-ui/src/i18n/locales/de/chat.json index 89145300ce..03ad678f2d 100644 --- a/webview-ui/src/i18n/locales/de/chat.json +++ b/webview-ui/src/i18n/locales/de/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "Kontext komprimiert", + "condensing": "Kontext wird komprimiert...", "tokens": "Tokens" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/en/chat.json b/webview-ui/src/i18n/locales/en/chat.json index d443df39aa..ce3ee7d7d3 100644 --- a/webview-ui/src/i18n/locales/en/chat.json +++ b/webview-ui/src/i18n/locales/en/chat.json @@ -132,6 +132,7 @@ }, "contextCondense": { "title": "Context Condensed", + "condensing": "Condensing context...", "tokens": "tokens" }, "instructions": { diff --git a/webview-ui/src/i18n/locales/es/chat.json b/webview-ui/src/i18n/locales/es/chat.json index 3b2576ac0e..228f2668e9 100644 --- a/webview-ui/src/i18n/locales/es/chat.json +++ b/webview-ui/src/i18n/locales/es/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "Contexto condensado", + "condensing": "Condensando contexto...", "tokens": "tokens" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/fr/chat.json b/webview-ui/src/i18n/locales/fr/chat.json index 860eb98947..f8bafe98e1 100644 --- a/webview-ui/src/i18n/locales/fr/chat.json +++ b/webview-ui/src/i18n/locales/fr/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "Contexte condensé", + "condensing": "Condensation du contexte...", "tokens": "tokens" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/hi/chat.json b/webview-ui/src/i18n/locales/hi/chat.json index 21886ad0a5..f903fd9745 100644 --- a/webview-ui/src/i18n/locales/hi/chat.json +++ b/webview-ui/src/i18n/locales/hi/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "संदर्भ संक्षिप्त किया गया", + "condensing": "संदर्भ संघनित कर रहा है...", "tokens": "टोकन" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/it/chat.json b/webview-ui/src/i18n/locales/it/chat.json index 34b737a423..f6df9e2ff2 100644 --- a/webview-ui/src/i18n/locales/it/chat.json +++ b/webview-ui/src/i18n/locales/it/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "Contesto condensato", + "condensing": "Condensazione del contesto...", "tokens": "token" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/ja/chat.json b/webview-ui/src/i18n/locales/ja/chat.json index 3b91864ac8..822849b2ab 100644 --- a/webview-ui/src/i18n/locales/ja/chat.json +++ b/webview-ui/src/i18n/locales/ja/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "コンテキスト要約", + "condensing": "コンテキストを圧縮中...", "tokens": "トークン" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/ko/chat.json b/webview-ui/src/i18n/locales/ko/chat.json index 40222b5a37..04056f2010 100644 --- a/webview-ui/src/i18n/locales/ko/chat.json +++ b/webview-ui/src/i18n/locales/ko/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "컨텍스트 요약됨", + "condensing": "컨텍스트 압축 중...", "tokens": "토큰" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/nl/chat.json b/webview-ui/src/i18n/locales/nl/chat.json index f37cbfe491..365f222f28 100644 --- a/webview-ui/src/i18n/locales/nl/chat.json +++ b/webview-ui/src/i18n/locales/nl/chat.json @@ -211,6 +211,7 @@ }, "contextCondense": { "title": "Context samengevat", + "condensing": "Context aan het samenvatten...", "tokens": "tokens" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/pl/chat.json b/webview-ui/src/i18n/locales/pl/chat.json index 22bdbbea4a..7fbb169576 100644 --- a/webview-ui/src/i18n/locales/pl/chat.json +++ b/webview-ui/src/i18n/locales/pl/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "Kontekst skondensowany", + "condensing": "Kondensowanie kontekstu...", "tokens": "tokeny" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/pt-BR/chat.json b/webview-ui/src/i18n/locales/pt-BR/chat.json index 63d7b205e0..ee97a9051e 100644 --- a/webview-ui/src/i18n/locales/pt-BR/chat.json +++ b/webview-ui/src/i18n/locales/pt-BR/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "Contexto condensado", + "condensing": "Condensando contexto...", "tokens": "tokens" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/ru/chat.json b/webview-ui/src/i18n/locales/ru/chat.json index 4489224452..cf0c9355c6 100644 --- a/webview-ui/src/i18n/locales/ru/chat.json +++ b/webview-ui/src/i18n/locales/ru/chat.json @@ -211,6 +211,7 @@ }, "contextCondense": { "title": "Контекст сжат", + "condensing": "Сжатие контекста...", "tokens": "токены" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/tr/chat.json b/webview-ui/src/i18n/locales/tr/chat.json index a7ee2117c7..8cf36f8d3e 100644 --- a/webview-ui/src/i18n/locales/tr/chat.json +++ b/webview-ui/src/i18n/locales/tr/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "Bağlam Özetlendi", + "condensing": "Bağlam yoğunlaştırılıyor...", "tokens": "token" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/vi/chat.json b/webview-ui/src/i18n/locales/vi/chat.json index 46a7dfd7bc..6480061d32 100644 --- a/webview-ui/src/i18n/locales/vi/chat.json +++ b/webview-ui/src/i18n/locales/vi/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "Ngữ cảnh đã tóm tắt", + "condensing": "Đang cô đọng ngữ cảnh...", "tokens": "token" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/zh-CN/chat.json b/webview-ui/src/i18n/locales/zh-CN/chat.json index 05a7d389ca..db2161baf5 100644 --- a/webview-ui/src/i18n/locales/zh-CN/chat.json +++ b/webview-ui/src/i18n/locales/zh-CN/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "上下文已压缩", + "condensing": "正在压缩上下文...", "tokens": "tokens" }, "followUpSuggest": { diff --git a/webview-ui/src/i18n/locales/zh-TW/chat.json b/webview-ui/src/i18n/locales/zh-TW/chat.json index aca6da7412..ab7f573b60 100644 --- a/webview-ui/src/i18n/locales/zh-TW/chat.json +++ b/webview-ui/src/i18n/locales/zh-TW/chat.json @@ -201,6 +201,7 @@ }, "contextCondense": { "title": "上下文已壓縮", + "condensing": "正在壓縮上下文...", "tokens": "tokens" }, "followUpSuggest": {