From d784ec4611a25ae9108f7c9bc00c3bdabc8f832f Mon Sep 17 00:00:00 2001 From: SiYue-ZO <2835601846@qq.com> Date: Sat, 25 Apr 2026 00:14:28 +0800 Subject: [PATCH] feat: add thought visibility toggle --- .../src/components/chat/chat-page.tsx | 56 +++++++++++++------ web/frontend/src/i18n/locales/en.json | 1 + web/frontend/src/i18n/locales/zh.json | 1 + web/frontend/src/store/chat.ts | 7 +++ 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/web/frontend/src/components/chat/chat-page.tsx b/web/frontend/src/components/chat/chat-page.tsx index 1012fe7ad..b0244c0b5 100644 --- a/web/frontend/src/components/chat/chat-page.tsx +++ b/web/frontend/src/components/chat/chat-page.tsx @@ -1,4 +1,5 @@ import { IconPlus } from "@tabler/icons-react" +import { useAtom } from "jotai" import { type ChangeEvent, useEffect, useRef, useState } from "react" import { useTranslation } from "react-i18next" import { toast } from "sonner" @@ -15,12 +16,14 @@ import { TypingIndicator } from "@/components/chat/typing-indicator" import { UserMessage } from "@/components/chat/user-message" import { PageHeader } from "@/components/page-header" import { Button } from "@/components/ui/button" +import { Switch } from "@/components/ui/switch" import { useChatModels } from "@/hooks/use-chat-models" import { useGateway } from "@/hooks/use-gateway" import { usePicoChat } from "@/hooks/use-pico-chat" import { useSessionHistory } from "@/hooks/use-session-history" import type { ConnectionState } from "@/store/chat" import type { ChatAttachment } from "@/store/chat" +import { showThoughtsAtom } from "@/store/chat" import type { GatewayState } from "@/store/gateway" const MAX_IMAGE_SIZE_BYTES = 7 * 1024 * 1024 @@ -109,6 +112,7 @@ export function ChatPage() { const [hasScrolled, setHasScrolled] = useState(false) const [input, setInput] = useState("") const [attachments, setAttachments] = useState([]) + const [showThoughts, setShowThoughts] = useAtom(showThoughtsAtom) const { messages, @@ -265,6 +269,18 @@ export function ChatPage() { ) } > +
+ + {t("chat.showThoughts")} + + +
+