Skip to content

fix(windows): 收口 Capsule helper-window 生命周期并进入回归评审#140

Closed
Cooper-X-Oak wants to merge 3 commits into
Open-Less:mainfrom
Cooper-X-Oak:codex/fix-windows-capsule-dead-zone-followup
Closed

fix(windows): 收口 Capsule helper-window 生命周期并进入回归评审#140
Cooper-X-Oak wants to merge 3 commits into
Open-Less:mainfrom
Cooper-X-Oak:codex/fix-windows-capsule-dead-zone-followup

Conversation

@Cooper-X-Oak
Copy link
Copy Markdown
Contributor

@Cooper-X-Oak Cooper-X-Oak commented May 1, 2026

治理归属

  • 族群:D 族群 / helper-window 生命周期契约
  • canonical issue:[windows] Capsule 生命周期未对齐 macOS,导致死区 / 截图可选中 / 拖拽卡顿 #139
  • 主修范围:capsule hidden / inactive / non-participating 语义,linger,dead zone,screenshot selectable,drag stutter
  • 不默认并入:capsule geometry / clipping / distortion、startup visible/ready ownership、QA helper-window 语义
  • 参考:
    • docs/windows-window-governance-board.zh-CN.md
    • docs/2026-05-02-window-capability-family-audit.md
    • docs/github-tracking/windows-window-family-canonical-map.md

摘要

Closes #139

这个 PR 现在从“问题收敛中”推进到“regression review 中”。

本轮已经完成:

  • Windows helper-window lifecycle root cause 收敛
  • inactive 路径的 native hide / non-topmost 收口
  • 冷启动最新 debug 包回归
  • 人工桌面症状回归:
    • click dead zone:通过
    • screenshot selectable:通过
    • drag stutter:通过

修复 / 新增 / 改进

  • 对齐 PR 目标:关注 Windows Capsule helper-window lifecycle,而不是单点 dead zone workaround
  • 收口 Windows 上 visible / hidden / inactive / non-participating 的 Capsule 语义
  • 在 backend 上补齐 inactive 后的 native hide 行为,避免 transparent topmost helper window lingering
  • 新增 lifecycle contract / smoke 辅助脚本,帮助后续回归持续验证
  • docs/github-tracking/issue-139-capsule-lifecycle.md 保持同一问题口径

兼容

  • 不包含:Capsule geometry / rounded corner / titlebar frame 纯视觉适配
  • 不包含:QA hotkey / selection ask 输入源逻辑
  • 对现有用户 / 本地环境 / 构建流程的影响:只聚焦 lifecycle 主线,不扩大到 UI polish 线

测试计划

  • 命令:node openless-all/app/scripts/windows-lifecycle-contract.test.mjs

  • 结果:通过

  • 证据路径:本地命令输出

  • 命令:npm run build

  • 结果:通过

  • 证据路径:本地命令输出

  • 命令:cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml

  • 结果:通过

  • 证据路径:本地命令输出

  • 命令:powershell -ExecutionPolicy Bypass -File openless-all/app/scripts/windows-runtime-smoke.ps1

  • 结果:通过 launch / hotkey installed baseline

  • 证据路径:本地命令输出

  • 命令:人工桌面回归(latest debug cold start -> dictation start/stop)

  • 结果:点击 / 截图 / 拖拽三项全部通过

  • 证据路径:当前线程回归记录

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Cooper-X-Oak, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@Cooper-X-Oak Cooper-X-Oak marked this pull request as ready for review May 1, 2026 16:40
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@Cooper-X-Oak Cooper-X-Oak changed the title fix(windows): 修复 Capsule 非录音态残留点击死区 fix(windows): 对齐 Capsule 生命周期与 macOS,消除残留透明窗问题 May 1, 2026
@Cooper-X-Oak Cooper-X-Oak marked this pull request as draft May 1, 2026 17:40
@Cooper-X-Oak Cooper-X-Oak changed the title fix(windows): 对齐 Capsule 生命周期与 macOS,消除残留透明窗问题 docs(windows): 跟踪 Capsule helper-window 生命周期 May 1, 2026
@Cooper-X-Oak Cooper-X-Oak marked this pull request as ready for review May 1, 2026 19:16
@Cooper-X-Oak Cooper-X-Oak changed the title docs(windows): 跟踪 Capsule helper-window 生命周期 fix(windows): 收口 Capsule helper-window 生命周期并进入回归评审 May 1, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@appergb
Copy link
Copy Markdown
Collaborator

appergb commented May 2, 2026

合并决定 + 一项后续调整,记录如下:

合入

PR #140 的核心收尾会全部并入 main:

  • hide_capsule_window_if_present() Win32 hard-hide 路径(FindWindowW + ShowWindow(SW_HIDE) + SetWindowPos(HWND_NOTOPMOST, SWP_HIDEWINDOW)),收回 Windows capsule "linger / dead zone / 截图可选中 / 拖拽卡顿"。
  • 配套 docs 与 windows-capsule-lifecycle-smoke.ps1 / windows-capsule-watch.ps1 / windows-ui-config.test.mjs

后续调整(合并后立即跟进,不在本 PR 内)

emit_capsulevisible 判定三平台统一回 !matches!(state, CapsuleState::Idle),覆盖 macOS / Windows / Linux:

冲突解决

跟 main 上 PR #160 的 use 块产生 import 排序冲突——两边导入完全相同的 8 个 Win32 符号,仅字母顺序不同,无语义差异。按"以最后修改为准"取 main 当前 HEAD 的排序。

合并后的回滚补丁会以单独 commit 落到 main,commit message 引用本 PR;PR 会被本地合并后关闭。

appergb pushed a commit that referenced this pull request May 2, 2026
…ead-zone-followup

fix(windows): 收口 Capsule helper-window 生命周期并进入回归评审

合入 PR #140 全部修复(保留 #140 author 提交)。冲突点(Win32 use 块导入排序)
取 main HEAD 排序——两边导入相同符号,仅字母顺序不同,无语义差异。

合并后 emit_capsule 的 visible 判定将三平台统一回 !Idle,由后续 commit 跟进——
保留 macOS 已习惯的 Done/Cancelled/Error toast,Windows linger 由本 PR 加的
hide_capsule_window_if_present() Win32 hard-hide 路径解决,不靠改 visible 语义。
appergb pushed a commit that referenced this pull request May 2, 2026
PR #140 在 Windows 上把 emit_capsule 的 visible 判定从 !Idle 缩窄到
仅 Recording/Transcribing/Polishing,副作用是 macOS / Linux 用户也失去了
"已粘贴 N 字" / "已取消" / 错误文案这一组完成 toast。

本 commit 把 visible 切回原本的 `!matches!(state, CapsuleState::Idle)`,
覆盖三平台。Windows 上 linger 的真实问题(dead zone / 截图选中 / 拖动卡顿)
由 PR #140 引入的 hide_capsule_window_if_present() Win32 hard-hide 路径
在 visible=false 分支处理——不依赖改 visible 语义。

closes the visible-narrowing follow-up referenced in PR #140 review comment。
@appergb
Copy link
Copy Markdown
Collaborator

appergb commented May 2, 2026

已通过本地 rebase + main merge 合入(merge commit 保留 Cooper-X-Oak 原作者)。配套 visible 三平台统一回 !Idle 的 follow-up 已在后续 commit 落地,详见 main 历史。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[windows] Capsule 生命周期未对齐 macOS,导致死区 / 截图可选中 / 拖拽卡顿

2 participants