Skip to content

Commit fc0e72c

Browse files
committed
Fix the bug where switching sessions defaults to displaying the topmost item
1 parent f8a89de commit fc0e72c

7 files changed

Lines changed: 157 additions & 172 deletions

File tree

packages/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"react-dom": "^19.1.0",
2121
"react-markdown": "^10.1.0",
2222
"react-resizable-panels": "^2.1.7",
23-
"react-virtuoso": "^4.12.6",
23+
"@tanstack/react-virtual": "^3.12.6",
2424
"rehype-raw": "^7.0.0",
2525
"remark-gfm": "^4.0.1",
2626
"simple-git": "^3.27.0",

packages/desktop/src/agent/AgentWorkspace.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function ContextIndicator({ threadId }: { threadId: string }) {
2626
<button
2727
type="button"
2828
disabled
29+
aria-label="正在压缩上下文"
2930
className="w-5 h-5 flex items-center justify-center animate-pulse cursor-default"
3031
>
3132
<svg width="18" height="18" viewBox="0 0 18 18">
@@ -283,6 +284,8 @@ function InputBox({
283284
<button
284285
type="button"
285286
onClick={() => abort()}
287+
aria-label="停止生成"
288+
title="停止生成"
286289
className="w-9 h-9 shrink-0 flex items-center justify-center bg-[var(--border-hover)] hover:bg-[var(--border-strong)] text-[var(--text-primary)] rounded-full transition-colors"
287290
>
288291
<Square size={14} strokeWidth={2} fill="currentColor" />
@@ -292,6 +295,8 @@ function InputBox({
292295
type="button"
293296
onClick={handleSend}
294297
disabled={!text.trim()}
298+
aria-label="发送消息"
299+
title="发送消息"
295300
className="w-9 h-9 shrink-0 flex items-center justify-center bg-[var(--btn-send-bg)] disabled:bg-[var(--bg-card)] disabled:text-[var(--text-disabled)] text-[var(--text-inverse)] rounded-full transition-colors"
296301
>
297302
<Send size={18} strokeWidth={2} />
@@ -365,7 +370,7 @@ export default function AgentWorkspace({ sendMessage, abort }: AgentWorkspacePro
365370

366371
return (
367372
<div className="flex-1 flex flex-col overflow-hidden bg-[var(--bg-panel)]">
368-
<MessageStream key={currentThreadId} threadId={currentThreadId} />
373+
<MessageStream threadId={currentThreadId} />
369374
<ApprovalPanel threadId={currentThreadId} />
370375
<TodoPanel threadId={currentThreadId} />
371376
{isCompressing && (

0 commit comments

Comments
 (0)