mirror of
https://github.com/siteboon/claudecodeui.git
synced 2025-12-13 21:59:37 +00:00
Compare commits
2 Commits
fefcc0f338
...
72e97c4fbc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72e97c4fbc | ||
|
|
b5d1fed354 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@siteboon/claude-code-ui",
|
"name": "@siteboon/claude-code-ui",
|
||||||
"version": "1.10.4",
|
"version": "1.10.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@siteboon/claude-code-ui",
|
"name": "@siteboon/claude-code-ui",
|
||||||
"version": "1.10.4",
|
"version": "1.10.5",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/claude-agent-sdk": "^0.1.29",
|
"@anthropic-ai/claude-agent-sdk": "^0.1.29",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@siteboon/claude-code-ui",
|
"name": "@siteboon/claude-code-ui",
|
||||||
"version": "1.10.4",
|
"version": "1.10.5",
|
||||||
"description": "A web-based UI for Claude Code CLI",
|
"description": "A web-based UI for Claude Code CLI",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "server/index.js",
|
"main": "server/index.js",
|
||||||
|
|||||||
@@ -79,6 +79,16 @@ function mapCliOptionsToSDK(options = {}) {
|
|||||||
// Map model (default to sonnet)
|
// Map model (default to sonnet)
|
||||||
sdkOptions.model = options.model || 'sonnet';
|
sdkOptions.model = options.model || 'sonnet';
|
||||||
|
|
||||||
|
// Map system prompt configuration
|
||||||
|
sdkOptions.systemPrompt = {
|
||||||
|
type: 'preset',
|
||||||
|
preset: 'claude_code' // Required to use CLAUDE.md
|
||||||
|
};
|
||||||
|
|
||||||
|
// Map setting sources for CLAUDE.md loading
|
||||||
|
// This loads CLAUDE.md from project, user (~/.config/claude/CLAUDE.md), and local directories
|
||||||
|
sdkOptions.settingSources = ['project', 'user', 'local'];
|
||||||
|
|
||||||
// Map resume session
|
// Map resume session
|
||||||
if (sessionId) {
|
if (sessionId) {
|
||||||
sdkOptions.resume = sessionId;
|
sdkOptions.resume = sessionId;
|
||||||
@@ -374,7 +384,7 @@ async function queryClaudeSDK(command, options = {}, ws) {
|
|||||||
for await (const message of queryInstance) {
|
for await (const message of queryInstance) {
|
||||||
// Capture session ID from first message
|
// Capture session ID from first message
|
||||||
if (message.session_id && !capturedSessionId) {
|
if (message.session_id && !capturedSessionId) {
|
||||||
console.log('📝 Captured session ID:', message.session_id);
|
|
||||||
capturedSessionId = message.session_id;
|
capturedSessionId = message.session_id;
|
||||||
addSession(capturedSessionId, queryInstance, tempImagePaths, tempDir);
|
addSession(capturedSessionId, queryInstance, tempImagePaths, tempDir);
|
||||||
|
|
||||||
|
|||||||
@@ -2603,7 +2603,8 @@ function ChatInterface({ selectedProject, selectedSession, ws, sendMessage, mess
|
|||||||
const scrollToBottom = useCallback(() => {
|
const scrollToBottom = useCallback(() => {
|
||||||
if (scrollContainerRef.current) {
|
if (scrollContainerRef.current) {
|
||||||
scrollContainerRef.current.scrollTop = scrollContainerRef.current.scrollHeight;
|
scrollContainerRef.current.scrollTop = scrollContainerRef.current.scrollHeight;
|
||||||
setIsUserScrolledUp(false);
|
// Don't reset isUserScrolledUp here - let the scroll handler manage it
|
||||||
|
// This prevents fighting with user's scroll position during streaming
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -3536,9 +3537,12 @@ function ChatInterface({ selectedProject, selectedSession, ws, sendMessage, mess
|
|||||||
if (scrollContainerRef.current && chatMessages.length > 0 && !isLoadingSessionRef.current) {
|
if (scrollContainerRef.current && chatMessages.length > 0 && !isLoadingSessionRef.current) {
|
||||||
// Only scroll if we're not in the middle of loading a session
|
// Only scroll if we're not in the middle of loading a session
|
||||||
// This prevents the "double scroll" effect during session switching
|
// This prevents the "double scroll" effect during session switching
|
||||||
// Also reset scroll state
|
// Reset scroll state when switching sessions
|
||||||
setIsUserScrolledUp(false);
|
setIsUserScrolledUp(false);
|
||||||
setTimeout(() => scrollToBottom(), 200); // Delay to ensure full rendering
|
setTimeout(() => {
|
||||||
|
scrollToBottom();
|
||||||
|
// After scrolling, the scroll event handler will naturally set isUserScrolledUp based on position
|
||||||
|
}, 200); // Delay to ensure full rendering
|
||||||
}
|
}
|
||||||
}, [selectedSession?.id, selectedProject?.name]); // Only trigger when session/project changes
|
}, [selectedSession?.id, selectedProject?.name]); // Only trigger when session/project changes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user