Merge pull request #2659 from SiYue-ZO/fix/thought-bubble-collapse-state

fix: isolate thought bubble collapse state
This commit is contained in:
美電球 2026-04-25 11:30:35 +08:00 committed by GitHub
commit 93e9bddc6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 5 deletions

View file

@ -6,7 +6,6 @@ import {
IconDownload, IconDownload,
IconFileText, IconFileText,
} from "@tabler/icons-react" } from "@tabler/icons-react"
import { useAtom } from "jotai"
import { useState } from "react" import { useState } from "react"
import { useTranslation } from "react-i18next" import { useTranslation } from "react-i18next"
import ReactMarkdown from "react-markdown" import ReactMarkdown from "react-markdown"
@ -18,7 +17,7 @@ import remarkGfm from "remark-gfm"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button"
import { formatMessageTime } from "@/hooks/use-pico-chat" import { formatMessageTime } from "@/hooks/use-pico-chat"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
import { type ChatAttachment, showThoughtsAtom } from "@/store/chat" import { type ChatAttachment } from "@/store/chat"
interface AssistantMessageProps { interface AssistantMessageProps {
content: string content: string
@ -42,7 +41,7 @@ export function AssistantMessage({
const fileAttachments = attachments.filter( const fileAttachments = attachments.filter(
(attachment) => attachment.type !== "image", (attachment) => attachment.type !== "image",
) )
const [isExpanded, setIsExpanded] = useAtom(showThoughtsAtom) const [isExpanded, setIsExpanded] = useState(true)
const formattedTimestamp = const formattedTimestamp =
timestamp !== "" ? formatMessageTime(timestamp) : "" timestamp !== "" ? formatMessageTime(timestamp) : ""

View file

@ -57,8 +57,6 @@ const DEFAULT_CHAT_STATE: ChatStoreState = {
export const chatAtom = atom<ChatStoreState>(DEFAULT_CHAT_STATE) export const chatAtom = atom<ChatStoreState>(DEFAULT_CHAT_STATE)
export const showThoughtsAtom = atom<boolean>(true)
const store = getDefaultStore() const store = getDefaultStore()
export function getChatState() { export function getChatState() {