fix: better chat window with long queries

This commit is contained in:
2026-02-15 10:00:37 +01:00
parent b730f12ba0
commit b64023d69a
4 changed files with 16 additions and 6 deletions

View File

@@ -50,7 +50,7 @@ export class ChatEngine {
const drizzle = this.db.getLocal();
const id = `chat_${uuidv4()}`;
const title = input.title || 'New Chat';
const model = input.model || 'claude-sonnet-4';
const model = input.model || 'claude-sonnet-4-5';
const now = new Date();
await drizzle.insert(chatConversations).values({
@@ -383,7 +383,7 @@ When answering questions:
return rows[0].value;
}
return 'claude-sonnet-4';
return 'claude-sonnet-4-5';
}
/**

View File

@@ -308,7 +308,7 @@
.chat-input {
flex: 1;
min-height: 24px;
max-height: 120px;
max-height: 200px;
padding: 0;
font-size: 14px;
font-family: inherit;
@@ -318,6 +318,7 @@
border: none;
outline: none;
resize: none;
overflow-y: auto;
}
.chat-input::placeholder {

View File

@@ -140,6 +140,10 @@ export const ChatPanel: React.FC<ChatPanelProps> = ({ conversationId }) => {
if (!message || isStreaming) return;
setInputValue('');
// Reset textarea height
if (inputRef.current) {
inputRef.current.style.height = 'auto';
}
setIsStreaming(true);
streamingRef.current = '';
setStreamingContent('');
@@ -480,7 +484,12 @@ export const ChatPanel: React.FC<ChatPanelProps> = ({ conversationId }) => {
ref={inputRef}
className="chat-input"
value={inputValue}
onChange={(e) => setInputValue(e.target.value)}
onChange={(e) => {
setInputValue(e.target.value);
// Auto-grow the textarea
e.target.style.height = 'auto';
e.target.style.height = `${Math.min(e.target.scrollHeight, 200)}px`;
}}
onKeyDown={handleKeyDown}
placeholder="Type a message..."
rows={1}