mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-19 04:14:46 +08:00
feat: adjust thinking layout, and implement auto scrolling
This commit is contained in:
@@ -316,9 +316,8 @@ function ThoughtBlock({
|
|||||||
isStreaming?: boolean;
|
isStreaming?: boolean;
|
||||||
hasMainContent?: boolean;
|
hasMainContent?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const [isOpen, setIsOpen] = useState(true); // 初始状态为展开
|
const [isOpen, setIsOpen] = useState(true);
|
||||||
|
|
||||||
// 当开始有主要内容时,自动折叠思考块
|
|
||||||
const [hasAutoCollapsed, setHasAutoCollapsed] = useState(false);
|
const [hasAutoCollapsed, setHasAutoCollapsed] = useState(false);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
@@ -385,16 +384,27 @@ function ThoughtBlock({
|
|||||||
isStreaming ? "border-primary/20 bg-primary/5" : "border-border",
|
isStreaming ? "border-primary/20 bg-primary/5" : "border-border",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<CardContent className="py-6">
|
<CardContent>
|
||||||
<Markdown
|
<div className="flex h-40 w-full overflow-y-auto">
|
||||||
className={cn(
|
<ScrollContainer
|
||||||
"prose dark:prose-invert max-w-none transition-colors duration-200",
|
className={cn(
|
||||||
isStreaming ? "prose-primary" : "opacity-80",
|
"flex h-full w-full flex-col overflow-hidden",
|
||||||
)}
|
className,
|
||||||
animated={isStreaming}
|
)}
|
||||||
>
|
scrollShadow={false}
|
||||||
{content}
|
autoScrollToBottom
|
||||||
</Markdown>
|
>
|
||||||
|
<Markdown
|
||||||
|
className={cn(
|
||||||
|
"prose dark:prose-invert max-w-none transition-colors duration-200",
|
||||||
|
isStreaming ? "prose-primary" : "opacity-80",
|
||||||
|
)}
|
||||||
|
animated={isStreaming}
|
||||||
|
>
|
||||||
|
{content}
|
||||||
|
</Markdown>
|
||||||
|
</ScrollContainer>
|
||||||
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</CollapsibleContent>
|
</CollapsibleContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user