From 3edb844d935038641ca370435a4fd80f78becf63 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Fri, 18 Jul 2025 09:24:48 -0700 Subject: [PATCH] improv: compaction ui --- .../StepContainer/ResponseActions.tsx | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/gui/src/components/StepContainer/ResponseActions.tsx b/gui/src/components/StepContainer/ResponseActions.tsx index 4fda49ac8..673e05d9a 100644 --- a/gui/src/components/StepContainer/ResponseActions.tsx +++ b/gui/src/components/StepContainer/ResponseActions.tsx @@ -40,10 +40,22 @@ export default function ResponseActions({ const ideMessenger = useContext(IdeMessengerContext); const currentSessionId = useAppSelector((state) => state.session.id); const selectedModel = useAppSelector(selectSelectedChatModel); + const contextPercentage = useAppSelector( + (state) => state.session.contextPercentage, + ); + const isPruned = useAppSelector((state) => state.session.isPruned); const ruleGenerationSupported = useMemo(() => { return selectedModel && modelSupportsTools(selectedModel); }, [selectedModel]); + const percent = Math.round((contextPercentage ?? 0) * 100); + const buttonColorClass = + isLast && (isPruned || percent > 80) + ? "text-warning" + : "text-description-muted"; + + const showLabel = isLast && (isPruned || percent >= 60); + const onGenerateRule = () => { dispatch(setShowDialog(true)); dispatch(setDialogMessage()); @@ -82,11 +94,26 @@ export default function ResponseActions({
- +
+ + {showLabel && ( + + Compact conversation + + )} +
{isLast && ruleGenerationSupported && (