fix: isolate thought bubble collapse state

This commit is contained in:
SiYue-ZO
2026-04-24 23:58:42 +08:00
parent 8d51d306b3
commit 683ce31f2b
2 changed files with 2 additions and 5 deletions
@@ -6,7 +6,6 @@ import {
IconDownload,
IconFileText,
} from "@tabler/icons-react"
import { useAtom } from "jotai"
import { useState } from "react"
import { useTranslation } from "react-i18next"
import ReactMarkdown from "react-markdown"
@@ -18,7 +17,7 @@ import remarkGfm from "remark-gfm"
import { Button } from "@/components/ui/button"
import { formatMessageTime } from "@/hooks/use-pico-chat"
import { cn } from "@/lib/utils"
import { type ChatAttachment, showThoughtsAtom } from "@/store/chat"
import { type ChatAttachment } from "@/store/chat"
interface AssistantMessageProps {
content: string
@@ -42,7 +41,7 @@ export function AssistantMessage({
const fileAttachments = attachments.filter(
(attachment) => attachment.type !== "image",
)
const [isExpanded, setIsExpanded] = useAtom(showThoughtsAtom)
const [isExpanded, setIsExpanded] = useState(true)
const formattedTimestamp =
timestamp !== "" ? formatMessageTime(timestamp) : ""
-2
View File
@@ -57,8 +57,6 @@ const DEFAULT_CHAT_STATE: ChatStoreState = {
export const chatAtom = atom<ChatStoreState>(DEFAULT_CHAT_STATE)
export const showThoughtsAtom = atom<boolean>(true)
const store = getDefaultStore()
export function getChatState() {