From 9699b4805c3fe1230033f22159d1d824388f4fe8 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Tue, 21 Oct 2025 10:52:02 +0700 Subject: [PATCH] chore: add smooth animation when step inside thinking and tool call --- web-app/src/containers/ThinkingBlock.tsx | 50 +++++++++++++++++------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/web-app/src/containers/ThinkingBlock.tsx b/web-app/src/containers/ThinkingBlock.tsx index fe4e5d234..e09c8b2f0 100644 --- a/web-app/src/containers/ThinkingBlock.tsx +++ b/web-app/src/containers/ThinkingBlock.tsx @@ -1,3 +1,5 @@ +/* eslint-disable react-hooks/rules-of-hooks */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { ChevronDown, ChevronUp, Loader, Check } from 'lucide-react' import { create } from 'zustand' import { RenderMarkdown } from './RenderMarkdown' @@ -119,7 +121,10 @@ const ThinkingBlock = ({ : '' return ( -
+
{t('done')} {timeDisplay && ( @@ -167,7 +172,7 @@ const ThinkingBlock = ({ } return ( -
+
{contentDisplay}
) @@ -188,7 +193,7 @@ const ThinkingBlock = ({ className="mx-auto w-full cursor-pointer break-words" onClick={handleClick} > -
+
{loading && ( @@ -201,21 +206,29 @@ const ThinkingBlock = ({ {!loading && steps.length > 0 && (isExpanded ? ( - + ) : ( - + ))} - {headerTitle} + + {headerTitle} +
{/* Streaming/Condensed View - shows previous finished step */} {loading && stepToRenderWhenStreaming && ( -
-
-
+
+
+
{/* Bullet point */} -
+
{/* Previous completed step content */} {renderStepContent(stepToRenderWhenStreaming, N - 2)}
@@ -225,14 +238,23 @@ const ThinkingBlock = ({ {/* Expanded View - shows all steps */} {isExpanded && !loading && ( -
-
+
+
{steps.map((step, index) => ( -
+
{/* Bullet point/Icon position relative to line */}