fix: scroll bouncing during streaming and skills/cwd awareness

1. Change StickToBottom resize mode from "smooth" to "instant" to
   prevent scroll position bouncing when new streaming content
   arrives faster than the smooth animation completes.

2. Use SDK's preset append mode for system prompts instead of
   replacing Claude Code's default prompt. This preserves Claude
   Code's built-in awareness of skills (.claude/commands/), working
   directory context, and other default behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
7418andClaude Opus 4.6 committed 2026-02-07 00:18:52 +08:00
1 parent 8b27f69a6f
commit f310fab397
2 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ export const Conversation = ({ className, ...props }: ConversationProps) => (
<StickToBottom
className={cn("relative flex-1 overflow-y-hidden", className)}
initial="smooth"
resize="smooth"
resize="instant"
role="log"
{...props}
/>
+7 -1
View File
@@ -166,7 +166,13 @@ export function streamClaude(options: ClaudeStreamOptions): ReadableStream<strin
}
if (systemPrompt) {
queryOptions.systemPrompt = systemPrompt;
// Use preset append mode to keep Claude Code's default system prompt
// (which includes skills, working directory awareness, etc.)
queryOptions.systemPrompt = {
type: 'preset',
preset: 'claude_code',
append: systemPrompt,
};
}
if (mcpServers && Object.keys(mcpServers).length > 0) {