Implement toggle thinking blocks with localStorage persistence
- Add preferences store to manage user preferences in localStorage - Toggle thinking blocks visibility via command palette (default: hidden) - Dynamic command label shows current state (Show/Hide Thinking Blocks) - Filter reasoning parts based on preference in message-stream - Conditionally render reasoning parts in message-part component - Support function labels in Command interface for dynamic text
This commit is contained in:
@@ -4,6 +4,7 @@ import MessageItem from "./message-item"
|
||||
import ToolCall from "./tool-call"
|
||||
import { sseManager } from "../lib/sse-manager"
|
||||
import Kbd from "./kbd"
|
||||
import { preferences } from "../stores/preferences"
|
||||
|
||||
interface MessageStreamProps {
|
||||
instanceId: string
|
||||
@@ -72,7 +73,7 @@ export default function MessageStream(props: MessageStreamProps) {
|
||||
|
||||
const textParts = message.parts.filter((p) => p.type === "text" && !p.synthetic)
|
||||
const toolParts = message.parts.filter((p) => p.type === "tool")
|
||||
const reasoningParts = message.parts.filter((p) => p.type === "reasoning")
|
||||
const reasoningParts = preferences().showThinkingBlocks ? message.parts.filter((p) => p.type === "reasoning") : []
|
||||
|
||||
const isQueued = message.type === "user" && message.id > lastAssistantMessageId
|
||||
|
||||
|
||||
Reference in New Issue
Block a user