chore: thinking block auto collapse when streaming finish (#5202)
* chore: thinking block auto collapse when streaming finish * chore: fix padding
This commit is contained in:
parent
8ee4969aa9
commit
a84034c552
@ -5,13 +5,13 @@ import { useAppState } from '@/hooks/useAppState'
|
||||
|
||||
interface Props {
|
||||
text: string
|
||||
id: number
|
||||
id: string
|
||||
}
|
||||
|
||||
// Zustand store for thinking block state
|
||||
type ThinkingBlockState = {
|
||||
thinkingState: { [id: number]: boolean }
|
||||
toggleState: (id: number) => void
|
||||
thinkingState: { [id: string]: boolean }
|
||||
toggleState: (id: string) => void
|
||||
}
|
||||
|
||||
const useThinkingStore = create<ThinkingBlockState>((set) => ({
|
||||
@ -57,7 +57,7 @@ const ThinkingBlock = ({ id, text }: Props) => {
|
||||
</div>
|
||||
|
||||
{isExpanded && (
|
||||
<div className="mt-2 pl-6 text-main-view-fg/60">
|
||||
<div className="mt-2 pl-6 pr-4 text-main-view-fg/60">
|
||||
<RenderMarkdown content={text.replace(/<\/?think>/g, '').trim()} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -300,7 +300,11 @@ export const ThreadContent = memo(
|
||||
|
||||
{reasoningSegment && (
|
||||
<ThinkingBlock
|
||||
id={item.index ?? Number(item.id)}
|
||||
id={
|
||||
item.isLastMessage
|
||||
? `${item.thread_id}-last`
|
||||
: `${item.thread_id}-${item.index ?? item.id}`
|
||||
}
|
||||
text={reasoningSegment}
|
||||
/>
|
||||
)}
|
||||
|
||||
@ -35,7 +35,7 @@ export default defineConfig(({ mode }) => {
|
||||
process.env.TAURI_ENV_PLATFORM?.includes('windows') ?? 'false'
|
||||
),
|
||||
IS_LINUX: JSON.stringify(
|
||||
process.env.TAURI_ENV_PLATFORM?.includes('unix') ?? 'false'
|
||||
process.env.TAURI_ENV_PLATFORM?.includes('linux') ?? 'false'
|
||||
),
|
||||
IS_IOS: JSON.stringify(
|
||||
process.env.TAURI_ENV_PLATFORM?.includes('ios') ?? 'false'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user