From 701dc1f18f2194feca2469d9853f42b93b03c154 Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Wed, 29 Apr 2026 21:13:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20AgentNotchView=20=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=20+=20=E5=90=AF=E5=8A=A8=E6=97=B6=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=B7=B2=E5=B0=B1=E7=BB=AA=E4=B8=8D=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/App/AppDelegate.swift | 1 - Sources/UI/AgentNotchView.swift | 13 +++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Sources/App/AppDelegate.swift b/Sources/App/AppDelegate.swift index 02a663d..67cbdb3 100644 --- a/Sources/App/AppDelegate.swift +++ b/Sources/App/AppDelegate.swift @@ -55,7 +55,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSSpeechSynthesizerDel // 两个权限都 OK → 直接启动 if hasAccessibility && hasInputMonitoring { startKeyMonitor() - showReadyAlert() return } diff --git a/Sources/UI/AgentNotchView.swift b/Sources/UI/AgentNotchView.swift index 4ec0fa4..2b01faf 100644 --- a/Sources/UI/AgentNotchView.swift +++ b/Sources/UI/AgentNotchView.swift @@ -126,9 +126,7 @@ struct AgentNotchView: View { // MARK: - 实时流式输出 private var streamingContentView: some View { - let hasTools = !tracker.toolEntries.isEmpty - - return ScrollViewReader { proxy in + ScrollViewReader { proxy in ScrollView(.vertical, showsIndicators: false) { Text(tracker.streamingContent) .font(.system(size: 12)) @@ -137,8 +135,8 @@ struct AgentNotchView: View { .frame(maxWidth: .infinity, alignment: .leading) .id("streaming_bottom") } - .frame(height: hasTools ? maxStreamingHeight : nil) - .frame(maxHeight: maxStreamingHeight) + .frame(minHeight: 40, maxHeight: maxStreamingHeight) + .layoutPriority(1) .padding(.horizontal, 14) .padding(.vertical, 6) .onChange(of: tracker.streamingContent) { _, _ in @@ -172,11 +170,10 @@ struct AgentNotchView: View { .clipped() .padding(.horizontal, 4) .onReceive(tracker.$toolEntries) { entries in - // 并行工具调用防抖:0.1s 内连续出现只滚一次到底 scrollWorkItem?.cancel() let workItem = DispatchWorkItem { - withAnimation { - if let lastID = entries.last?.id { + if let lastID = entries.last?.id { + withAnimation(nil) { proxy.scrollTo(lastID, anchor: .bottom) } }