From a84034c552cb9d0bb5ebb6e566fd2c1955762cc0 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Thu, 5 Jun 2025 14:29:33 +0700 Subject: [PATCH] chore: thinking block auto collapse when streaming finish (#5202) * chore: thinking block auto collapse when streaming finish * chore: fix padding --- web-app/src/containers/ThinkingBlock.tsx | 8 ++++---- web-app/src/containers/ThreadContent.tsx | 6 +++++- web-app/vite.config.ts | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/web-app/src/containers/ThinkingBlock.tsx b/web-app/src/containers/ThinkingBlock.tsx index 1353474d5..c1445acf3 100644 --- a/web-app/src/containers/ThinkingBlock.tsx +++ b/web-app/src/containers/ThinkingBlock.tsx @@ -5,13 +5,13 @@ import { useAppState } from '@/hooks/useAppState' interface Props { text: string - id: number + id: string } // Zustand store for thinking block state type ThinkingBlockState = { - thinkingState: { [id: number]: boolean } - toggleState: (id: number) => void + thinkingState: { [id: string]: boolean } + toggleState: (id: string) => void } const useThinkingStore = create((set) => ({ @@ -57,7 +57,7 @@ const ThinkingBlock = ({ id, text }: Props) => { {isExpanded && ( -
+
/g, '').trim()} />
)} diff --git a/web-app/src/containers/ThreadContent.tsx b/web-app/src/containers/ThreadContent.tsx index 01e5ed59c..dea8fe7d9 100644 --- a/web-app/src/containers/ThreadContent.tsx +++ b/web-app/src/containers/ThreadContent.tsx @@ -300,7 +300,11 @@ export const ThreadContent = memo( {reasoningSegment && ( )} diff --git a/web-app/vite.config.ts b/web-app/vite.config.ts index 9c3b6f4e0..49a9c4419 100644 --- a/web-app/vite.config.ts +++ b/web-app/vite.config.ts @@ -35,7 +35,7 @@ export default defineConfig(({ mode }) => { process.env.TAURI_ENV_PLATFORM?.includes('windows') ?? 'false' ), IS_LINUX: JSON.stringify( - process.env.TAURI_ENV_PLATFORM?.includes('unix') ?? 'false' + process.env.TAURI_ENV_PLATFORM?.includes('linux') ?? 'false' ), IS_IOS: JSON.stringify( process.env.TAURI_ENV_PLATFORM?.includes('ios') ?? 'false'