Skip to content

fix(test): refresh close-tab bindings before headless shortcuts - #1886

Merged
1lck merged 2 commits into
previewfrom
codex/1885-close-tab-test-bindings
Nov 13, 2026
Merged

1lck merged 2 commits into
previewfrom
codex/1885-close-tab-test-bindings

Conversation

@1lck

@1lck 1lck commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

关联 Issue / Linked issue

PR 类型 / Type

  • fix:缺陷修复

改动说明 / What changes

背景 / Why

Linux 的关闭标签测试在直接新增用户绑定后仍使用旧帧。真实设置页已通知刷新,测试辅助函数遗漏这一动作;macOS 原测试始终使用已有默认 Command-W,未覆盖同一问题。

改动 / Changes

  • 抽出测试绑定辅助函数,更新内存设置后调用既有 invalidator.Invalidate,与真实 SetKeymap 一致。
  • 新增所有平台都运行的用户 Control-W 回归,先消费旧帧,再修改绑定并立即触发,确认日志页签关闭且选中普通文件。无需 sleep、重试或扩大期限。
  • 新增防复发 Note,记录 Driver.Pump 仅按 wake 绘制及真实设置刷新顺序。
  • 快捷键矩阵补上回归证据与具体验证动作;实现状态与原生窗口 pending 不变。

不在本 PR 范围内 / Out of scope

不改产品快捷键、Viva、Core、Java 或设置持久化;不把无头测试当原生窗口验收。

类型专属:fix

复现与根因

检查项

  • 先写正式跨平台回归;修复前失败,修复后通过,红绿证据保留
  • [N/A] 无法自动化:本问题可无头复现
  • 搜索 closeTabChord、pressCloseTab、真实 SetKeymap 和 Driver.Pump;修正辅助函数供现有两个消费者使用
  • 同一辅助函数与新增回归覆盖两端,目标平台由本 PR CI 验证
  • 只改测试/Note/矩阵,不夹带产品修复或重构;无新增既有债务
  • Note:2026-11-13-close-tab-test-binding-invalidation.md

范围检查 / Scope checks

功能矩阵 / Feature matrix

  • 更新 keymap-customization 的两端证据与验证动作,原生窗口仍 pending
  • 矩阵验证与 origin/preview..HEAD 门禁通过
  • 不提交生成视图
  • [N/A] 未更新理由:已更新

统一日志系统 / Structured logging

N/A:只修改测试输入准备,不新增或改变产品操作/生命周期/失败路径。

界面文案 / i18n

N/A:没有产品界面文字或生成词条改动。

逻辑归属 / Logic placement

N/A:没有新增业务逻辑;测试辅助函数遵守既有呈现层刷新约定,不改 Core 边界。

性能与内存 / Performance and memory

N/A:没有产品运行时、资源、计时器或缓冲改动;仅在测试设置变更后发一次已有刷新通知。

设置 / Settings

N/A:真实设置页实现不变,仅使测试准备与其刷新顺序一致。

插件契约 / Plugin contract

N/A:未改插件/Core/SDK/API/fixture/版本 pin。

发行包与资源 / Bundle and resources

  • runtime-bundle-immutability 门禁通过
  • [N/A] 资源复用清单:没有资源路径、构建或下载改动

无用代码与重构 / Dead code and refactoring

  • 没有本次造成的无用代码,也没有发现需要另建单的既有债务

验证 / Verification

命令或操作 平台 结果
新用户绑定测试 -count=1,未刷新版本 macOS 确认红例:1 log tabs, the file selected false
desktop-go.sh test ./internal/workbench -run '^TestCloseTab' -count=1 macOS 通过
同范围 -race macOS 通过
run-go-tests-with-timing.mjs 全量 ./...,-p=1 -parallel=1 -count=1 macOS 3426 条记录:3400 通过、26 跳过;新用户绑定 80 ms,其他关闭测试 0/80/100 ms;HTML/JUnit 单项报告 close-tab-binding-all
测试静态提交差异门禁、Note、矩阵/变更门禁、bundle 只读 macOS 通过

未能执行的检查和原因: 本地没有跑 Linux/Windows;目标平台依靠本 PR 原生 CI。未启动 VM,不声称原生窗口验证。全工作区静态扫描受用户已有未跟踪 extension-host/node_modules 影响,未删除或豁免;实际 PR 提交差异门禁通过。

提交前确认 / Final checks

  • 单独从最新 origin/preview 创建 codex/1885-close-tab-test-bindings,目标 preview
  • Draft 后本地验证通过再 ready
  • 只暂存三份本次文件,不提交用户已有文件、构建产物或凭据
  • 测试无头实例结束,未保留应用/JVM;VM 仍关闭

@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Nov 13, 2026
@1lck
1lck marked this pull request as ready for review November 13, 2026 22:55
@lithe-code-review

lithe-code-review Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Lithe Review

结论: ✅ 通过
范围: preview ← codex/1885-close-tab-test-bindings · head: 4f7d239

未发现需要阻塞合并的问题。

Scope Check

逻辑块(仓库相对路径:符号) 归属 依据
desktop/internal/workbench/close_tab_shortcut_test.go:closeTabChord / bindCloseTab 平台 API 的测试适配 使用 Viva keymap.Chord,通过 windowWake.Invalidate 调用 app.Invalidator 请求刷新;未新增共享业务规则。
desktop/internal/workbench/close_tab_shortcut_test.go:TestCloseTabUserBindingClosesTheSelectedEditorTab UI 框架测试 使用无头 app.Driver.ShortcutChord 驱动真实输入路径,断言日志标签关闭及普通文件重新选中。
新增 Agent Note、快捷键功能矩阵 无可执行逻辑 记录刷新约束和验证证据。

Checked and cleared

  • bindCloseTab 的“修改绑定 → 请求刷新”顺序与 settings.go:SetKeymap 一致;既有编辑器和终端测试均经 closeTabChord 使用该修复。
  • 新回归测试没有平台跳过条件,macOS 也显式安装 Control-W,覆盖原先默认 Command-W 未覆盖的路径。
  • 新测试未增加 sleep、重试、轮询或期限;复用既有 fixture 和 t.Cleanup 驱动清理。
  • 两个平台共用同一份测试,三平台 CI 均通过 scripts/desktop/check.sh 执行 test ./...。
  • 功能矩阵仅补充证据与操作步骤,两端验证状态均保持 pending,没有将无头测试写成原生窗口验收。

Summary

修复位置与根因一致,改动限于测试准备和验证资料,没有改变产品快捷键行为或 Core 边界。

Verification

  • 实际检查:固定 1cad09c...4f7d239 的全部三份文件、base 测试,以及设置刷新、快捷键注册与分发、fixture、清理和 CI 调用链;限定范围的 git diff --check 通过。
  • PR 提供的结果:macOS 回归修复前失败、修复后通过;定向测试及 race 通过;全量测试报告 3400 通过、26 跳过,新回归耗时 80 ms。以上未由本次审查独立运行。
  • 已提供的 head 检查:pins、格式与脚本、矩阵、Agent Notes 成功;Linux、Windows、macOS 测试仍在运行。
  • 本次按要求未运行仓库代码、测试、门禁或应用,未访问网络。三平台最终 CI 结果尚待确认,原生窗口验收仍为 pending。

@lithe-code-review

Copy link
Copy Markdown

Lithe 运行验收

版本:4f7d239bc2e8e41425eac3562f0f16a6de5c7350;状态:partial。
本报告独立于代码审查;只报告实际执行的场景,不代表所有问题均已修复。

对照:共同祖先 1cad09c2a60425eb9f8a7db7f5039c765c949c11 → PR head;当前目标分支合并适用性:未运行。

  • 条件不足,未验证:Exercise TestCloseTabShortcutClosesTheSelectedEditorTab, which exists in both revisions. In a fresh fixture, open an ordinary file and LSP Logs, send unbound Control-W to consume the old frame, install Control-W through that revision's existing test helper, and immediately send the chord once. Evidence level: Go/Viva headless workbench integration.
    • Go toolchain go1.27.3, Git Bash, and the Windows MinGW/cgo build toolchain are absent from the capability inventory. The checkout also requires the pinned Viva dependency and matching Core library/header at revision 0be1d34f8926fc284a23874a4f6a57a14e339de8, which are not supplied as runnable artifacts. Node, Bun, and Cargo alone cannot execute this workbench path.
  • 条件不足,未验证:Exercise the existing TestCloseTabShortcutClosesTheFocusedTerminal consumer of closeTabChord, alongside TestCloseTabDefaultsToCommandWOnlyOnMacOS. Observe Driver-selected terminal routing rather than native keyboard focus.
    • Requires the same unavailable Go/Viva/Core and Windows native build prerequisites. A repeatable terminal run also needs an explicitly isolated shell configuration and bounded child-process cleanup; the existing test uses default shell selection, which cannot be assumed safe from user-profile effects.
  • 条件不足,未验证:Verify the stale-frame sequence using newly installed Control-W on macOS, independently of the existing default Command-W. Keep default Command-W behavior as a separate guard.
    • No macOS runtime is available. A frozen behavioral entry point usable on both revisions is also missing: the new user-binding regression exists only at head, while the baseline macOS test uses default Command-W. Missing-test or zero-test results must not be treated as behavioral evidence.

未覆盖:

  • Windows runtime confirmation of immediate binding refresh, including the unbound Control-W guard and subsequent ordinary-file closure.
  • Linux execution and macOS explicit-user-binding parity; neither platform is available.
  • Runtime confirmation that terminal-directed closure preserves the file and releases owned resources.
  • The new explicit-user-binding test is absent from baseline. Selecting it there would run zero tests and cannot establish correct behavior.
  • Note/matrix validators, race checks, full-suite results, and CI claims were not independently verified. Native-window acceptance remains pending and is explicitly outside this fix.

工作副本与运行状态已清理;可复用编译缓存按 12 GiB / 7 天预算保留。
详细步骤和原始证据保存在服务器受限目录(14 天、总计不超过 1 GiB);当前没有公开下载链接。

@1lck
1lck merged commit 81bc8ce into preview Nov 13, 2026
9 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant