/Users/ar/Projects/Taglauncher/Users/ar/Projects/Taglauncher/src/Users/ar/Documents/技术实验室/TagLauncher-WindowServer-CursorUIViewService-诊断说明-2026-07-01.mdcodex/pro-custom-hotkeys-8.2.04c6f31c Remove non-source materials from source worktree0ae3a93 Prepare TagLauncher 8.3.1 candidate,并带 tag v8.3.1-build20260701.2302;这不是本轮会诊创建的 commit。TagLauncher 8.3.0 (20260701.2029)。/Applications/TagLauncher.app 当前读到:8.3.0 (20260701.2234)。src/Apptag/Info.plist 读到:8.3.1 (20260701.2302)。src/Apptag/ContentView.swift、src/Apptag/ApptagApp.swift、src/Scripts/tag_editor_mouse_event_qa.sh 对当前 HEAD 已无 diff,说明相关修复已经进入 0ae3a93。20260701.2029 是本地验收 DMG,不是正式冻结包;会话记录已明确其未冻结 commit / tag。26.0701-Taglauncher.发布修复-编辑标签崩溃和额度刷新.md。TextFieldContainer.mouseDown 和 DismissibleHostingView.mouseDown 中“把同一 NSEvent 手动转发给 NSTextField.mouseDown / TextFieldContainer.mouseDown”改为 focus-only 路径,并新增 tag_editor_mouse_event_qa.sh 防回归。CODE_GOVERNANCE.md、CODEGRAPH.md、全局 code / debugging / QA / delivery / session memory 规则。mouseDown / monitor。ApptagApp.swift、OverlayWindowController.swift、QuickSearch.swift、ContentView.swift、AppGridCollectionView.swift、TagNavigationView.swift、AppGridSupport.swift、PreferencesView.swift、AppDragCoordinator.swift。20260701.2029 故障包很可能命中过“同一鼠标事件被手动转发到 NSTextField.mouseDown”的问题。container.mouseDown(with: event) / tf.mouseDown(with: event) / textField.mouseDown(with: event),而当前工作区已修成 focusTextField() / makeFirstResponder + selectText。NSControl/NSView mouseDown、forwardMethod、NSTextInputContext、IMKInputSession 与这个问题高度吻合。20260701.2234 后已有静态 QA 防回归。On Behalf Of 链路足以把 TagLauncher 列为重点触发入口 / 放大因素。QuickSearchNativeTextField 和 delegate command path 没有 marked-text guard。NSApp.activate / makeKeyAndOrderFront / orderFrontRegardless,并排 4 次 delayed focus。TagNavigationView.mouseDown 里有阻塞式 while + window?.nextEvent(... inMode: .eventTracking),缺失窗口失活 / mouseUp 丢失 / monitor 吞事件时的硬退出条件。AppGridCollectionHostView / Usage Tips 的 hitTest 会触发状态变更、first responder、hover 刷新,hitTest 不再是纯命中测试。NSEvent.mouseLocation 映射,可能吞掉同 App 其它窗口事件。.nonactivatingPanel 但允许 key/main,同时 AppDelegate 多处切 activation policy、activate、orderFront。20260701.2234 比 20260701.2029 明显更安全,但在 macOS 27 + 简体中文输入法环境下仍不应视为彻底安全。建议进入阻塞修复 / 诊断增强,而不是直接发布。src/Apptag/QuickSearch.swift 的 doCommandBy 与 QuickSearchNativeTextField.keyDown。P0:IME 候选窗鼠标点击可能被 Quick Search global mouse monitor 当作外部点击关闭。
src/Apptag/ApptagApp.swift 的 installQuickSearchExternalMouseMonitor;src/Apptag/ContentView.swift 的 closeQuickSearch。P1:Quick Search 输入期间重复抢焦点 / 重排窗口。
QuickSearchPanelPresentationView.updateNSView、Coordinator.apply、QuickSearchTextField.requestFocus、promoteOverlayToForegroundInput。P1:DismissibleHostingView.mouseDown 仍在顶层同步切文本 first responder。
src/Apptag/ApptagApp.swift。P1:TagNavigationView.mouseDown 阻塞式事件循环。
src/Apptag/TagNavigationView.swift。mouseUp 丢失、窗口隐藏、App resign active 或事件被 monitor 吞掉时,主线程可能困在 mouseDown 栈。P1:Usage Tips 的 hitTest / local monitor 有副作用和误吞风险。
src/Apptag/AppGridCollectionView.swift。hitTest 触发 hover/first responder/刷新;非本窗口事件按屏幕坐标映射后可能被吞。P1:App note 泡泡使用 SwiftUI TextField + 非激活 overlay + 主动提升焦点。
src/Apptag/AppGridSupport.swift、src/Apptag/ContentView.swift、src/Apptag/ApptagApp.swift。P2:Quick Search 点击启动缺少 de-dupe guard。
src/Apptag/QuickSearch.swift、src/Apptag/ContentView.swift。P2:拖拽碎纸预览使用无限 CA 动画,依赖正常结束路径清理。
src/Apptag/AppDragCoordinator.swift。本轮只做只读 / 静态检查,不做源码修改,不构建。
已执行并通过:
cd /Users/ar/Projects/Taglauncher/src
bash Scripts/tag_editor_mouse_event_qa.sh
bash Scripts/quick_search_launch_contract_qa.sh
结果:
PASS Tag editor mouse event QA: text-field clicks focus without recursive mouseDown forwarding
PASS quick search launch contract
已执行:
cd /Users/ar/Projects/Taglauncher
git diff --check -- src/Apptag/ContentView.swift src/Apptag/ApptagApp.swift src/Apptag/QuickSearch.swift src/Apptag/OverlayWindowController.swift src/Apptag/AppGridCollectionView.swift src/Scripts/tag_editor_mouse_event_qa.sh
结果:无输出,表示相关 diff 无 whitespace 错误。
不作为有效证据:
cd /Users/ar/Projects/Taglauncher/src
bash Scripts/window_logic_qa.sh
该脚本会操作 Dock、defaults、LaunchAgent 和 GUI,不适合本轮只读会诊;已中断,退出码 130。脚本含 trap cleanup EXIT,后续检查 TagLauncher 仍在运行、TAGLAUNCHER_QA_PRO_STATE 为空。
用途:复查 20260701 WindowServer / CursorUIViewService 会诊中的静态门禁和版本基线。
前置条件:
/Users/ar/Projects/Taglauncher/Users/ar/Projects/Taglauncher/src静态 QA:
cd /Users/ar/Projects/Taglauncher/src
bash Scripts/tag_editor_mouse_event_qa.sh
bash Scripts/quick_search_launch_contract_qa.sh
版本基线核对:
defaults read /Applications/TagLauncher.app/Contents/Info CFBundleShortVersionString
defaults read /Applications/TagLauncher.app/Contents/Info CFBundleVersion
plutil -p /Users/ar/Projects/Taglauncher/src/Apptag/Info.plist
源码风险定位:
cd /Users/ar/Projects/Taglauncher
rg -n "mouseDown|mouseDragged|mouseUp|sendEvent|hitTest|NSTextInputContext|inputContext|firstResponder|makeFirstResponder|addLocalMonitor|addGlobalMonitor|orderFrontRegardless|makeKeyAndOrderFront|NSVisualEffectView|reloadData" src/Apptag --glob '*.swift'
建议新增的真实复现步骤:
makeFirstResponder、orderFront、inputContext activate 次数和 WindowServer / CursorUIViewService CPU。mouseDown 事件循环有退出。搜索关键词:WindowServer、CursorUIViewService、20260701.2029、20260701.2234、Quick Search IME、markedText、mouseDown forwardMethod、tag_editor_mouse_event_qa、Usage Tips hitTest、TagNavigation nextEvent
.diag 文件;本轮基于管理员整理的诊断说明和项目源码审查。0ae3a93,仍有 6 个历史 Release 文档文件处于 modified 状态。后续修复前必须先明确是否基于 0ae3a93 / v8.3.1-build20260701.2302 继续。window_logic_qa.sh 是 GUI/系统状态脚本,不适合只读会诊;后续若要跑,需按 QA 场景安排并确保用户知道会操作本机 GUI/Dock。DismissibleHostingView.mouseDown 对文本控件的外层截获收窄:已编辑或 marked text 时放行原生事件。TagNavigationView.mouseDown 改成非阻塞状态机,或至少加失活 / 超时 / mouseUp 丢失保护。hitTest 副作用和 local monitor 对非 overlay 事件的误吞风险。