From 29ae39bc2e2178ad4b0d18fb3b2b6327b70f47a8 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:06:53 +0100 Subject: [PATCH 01/23] =?UTF-8?q?=E2=9C=A8=20feat:=20Implement=20Show=20Th?= =?UTF-8?q?inking=20feature;=20refactor:=20testing=20thinking=20render=20o?= =?UTF-8?q?ptimizations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/Artifacts/Thinking.tsx | 93 ++++++++++++------- .../Chat/Messages/Content/Markdown.tsx | 50 +++++----- .../components/Chat/Messages/HoverButtons.tsx | 4 +- .../components/Chat/Messages/MessageAudio.tsx | 1 - .../components/Nav/SettingsTabs/Chat/Chat.tsx | 4 + .../Nav/SettingsTabs/Chat/ShowThinking.tsx | 37 ++++++++ client/src/localization/languages/Eng.ts | 3 + client/src/store/settings.ts | 2 +- 8 files changed, 132 insertions(+), 62 deletions(-) create mode 100644 client/src/components/Nav/SettingsTabs/Chat/ShowThinking.tsx diff --git a/client/src/components/Artifacts/Thinking.tsx b/client/src/components/Artifacts/Thinking.tsx index 4335603788b..a2ebb0cd860 100644 --- a/client/src/components/Artifacts/Thinking.tsx +++ b/client/src/components/Artifacts/Thinking.tsx @@ -1,49 +1,78 @@ -import { useState } from 'react'; +import { useState, useMemo, memo, useCallback } from 'react'; +import { useRecoilState } from 'recoil'; import { Atom, ChevronDown } from 'lucide-react'; -import type { MouseEvent } from 'react'; -import useLocalize from '~/hooks/useLocalize'; +import type { MouseEvent, FC } from 'react'; +import { useLocalize } from '~/hooks'; +import store from '~/store'; -interface ThinkingProps { - children: React.ReactNode; -} +const ThinkingContent: FC<{ children: React.ReactNode }> = memo(({ children }) => ( +
{children}
+{children}
+- -
-{children}
+{children}