Repository navigation
fix(desktop): 快捷键录制测试按当前平台挑选未占用的组合键 - #2041
Merged
Merged
Conversation
TestKeymapAddRecordsTheChordPressedAfterIt 固定用 Ctrl+Alt+Shift+J 当作没有 动作占用的组合键。macOS 上成立,但 Linux 和 Windows 上它是“选择所有匹配” (editor.selectAllOccurrences)的默认快捷键,测试在前置检查就失败,main 的 Desktop CI 从 #2020 合入起在这两个平台一直是红的。 改为在 Ctrl+Alt+Shift 加字母里挑当前平台默认目录中第一个没被占用、可绑定的 组合键;三个平台上都会选到 A。测试本身的录制、写入和 Escape 断言不变。
27 tasks done
17 of 25 tasks
19 of 22 tasks
xiaoyumuxi
marked this pull request as ready for review
November 16, 2026 14:26
17 of 20 tasks
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
Closes #…。PR 类型 / Type
改动说明 / What changes
背景 / Why
#2020 合入后,main 上的 Desktop CI 在 Linux 和 Windows 两条线每次都失败在同一个测试:
测试辅助函数
unboundAction写死了 Ctrl+Alt+Shift+J,认为它是一个没有动作占用的组合键。这在 macOS 上成立,但在 macOS 以外,Ctrl+Alt+Shift+J 从 #1799 起就是“选择所有匹配”(editor.selectAllOccurrences)的默认快捷键(desktop/internal/shortcuts/shortcuts.go的selectAllOccurrencesDefault)。因此测试在前置检查就失败了,真正要验证的录制行为一次都没跑到。macOS CI 一直是绿的,所以合入前没有发现。改动 / Changes
desktop/internal/settingswindow/keymap_view_test.go:unboundAction不再写死组合键,改为在 Ctrl+Alt+Shift 加 a–z 里挑选当前平台默认目录中第一个未被占用(Overrides(nil).Owner)且可绑定(shortcuts.Bindable)的组合键;全部被占用时用明确的消息失败。按当前默认目录,三个平台都会选到 Ctrl+Alt+Shift+A。不在本 PR 范围内 / Out of scope
localshell集成测试(TestIntegratedBashDebugTrapReportsEachCommandLineOnce、TestIntegratedSystemBashReportsEachCommandLineOnce、TestClosingAnIntegratedShell…)也在失败,它们来自终端相关的改动(fix(terminal): drop the shell-integration reports nothing reads #2031、feat(terminal): mark PowerShell's command starts through PSReadLine #2033 等),与本测试无关,这里不处理。TestDebugAnnouncedAdapterBreakpointPauseContinueStop和 Windows 上偶发的TestWindowCloseWaitsForSuccessfulSave也不处理。类型专属:fix
复现与根因
go test -run TestKeymapAddRecordsTheChordPressedAfterIt ./internal/settingswindow/,实际结果是在前置检查报editor.selectAllOccurrences already holds Ctrl+Alt+Shift+J;期望结果是测试选一个未占用的组合键,并验证录制流程。main 上的失败记录:run 43852038415、43845378900、43841187804、43839612949。git log -S或git blame查):feat(desktop): 设置页紧凑排布:快捷键录制修复、插件设置单行、工具链下拉框 #2020(988653efe)新增的unboundAction用了一个只在 macOS 上空闲的固定组合键;非 macOS 默认值由 Epic(0.7.0): 基于 Viva 框架的跨平台方案的迁移(#1794) #1799(0faecba49)引入。检查项
unboundAction只有这一个调用方。.agents/notes/implemented/bug-fix/记录:只改测试,不改变行为约束。范围检查 / Scope checks
功能矩阵 / Feature matrix
N/A:只改测试,没有用户可观察的变化。
插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空shared/i18n/;插件的构建步骤、资源路径和补丁没有写进docs/ci-builds.md、Agent Note 或 Skill:没有改文案或文档UI 验证 / UI evidence
N/A:只改测试辅助函数,界面没有变化。
统一日志系统 / Structured logging
N/A:没有改日志路径。
界面文案 / i18n
N/A:没有新增或修改界面文案。
逻辑归属 / Logic placement
N/A:没有改业务逻辑。
性能与内存 / Performance and memory
N/A:只改测试。
设置 / Settings
N/A:没有改设置项或设置页。
插件契约 / Plugin contract
N/A:不涉及插件契约或宿主方法。
发行包与资源 / Bundle and resources
N/A:不涉及运行时资源。
无用代码与重构 / Dead code and refactoring
refactor标签的 Issue,没有在本 PR 顺手处理:没有发现验证 / Verification
scripts/desktop/desktop-go.sh test -count=1 -v -run TestKeymap ./internal/settingswindow/scripts/desktop/desktop-go.sh test -count=1 ./internal/settingswindow/ ./internal/shortcuts/scripts/desktop/desktop-go.sh vet ./internal/settingswindow/、gofmt -l.agents/skills/write-stable-tests/scripts/verify-test-stability.sh.agents/skills/write-stable-tests/scripts/test-stability-macos.sh --package ./internal/settingswindow -- --filter TestKeymapAddRecordsTheChordPressedAfterItshortcuts.go的非 macOS 默认值:Ctrl+Alt+Shift 加字母只有 J 被占用(另外两个是上下方向键)rg …)未能执行的检查和原因: 没有在本机实际运行 Linux 和 Windows 测试。Linux 由本 Draft PR 的 CI 验证;Windows 要等标记 ready 后的完整 CI 验证,没有使用本机 Windows 虚拟机。
提交前确认 / Final checks
main创建;目标分支:feat、fix、docs 为main,release 以发布流程要求为准.build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图