feat(desktop): F1 opens command palette, Cmd+K clears terminal - #8248
Open
complyue wants to merge 2 commits into
Open
feat(desktop): F1 opens command palette, Cmd+K clears terminal#8248complyue wants to merge 2 commits into
complyue wants to merge 2 commits into
Conversation
- command palette now opens on F1 on every platform (VSCode convention), freeing Cmd+K for the terminal's clear-screen-and-scrollback action - terminal.clear registered as a first-class shortcut action: while the terminal panel has focus, Cmd+K (macOS) / Ctrl+K (Windows/Linux) clears the screen and scrollback through the shared shortcut registry, so the settings panel, conflict detection, and custom rebinding all apply - legacy macOS Cmd+K palette bindings are migrated away automatically so they cannot shadow terminal.clear - TabBar kbd hints, shortcut settings/cheatsheet, and docs follow
The cherry-picked Cmd+K refactor (631d84d) nets +1 line in App.tsx (5556 -> 5557), crossing its ratchet file-size budget by exactly one line. App.tsx is a legacy 5557-line file whose budget already tolerates 5556; the refactor needs this line, so raise this file's budget 4756 -> 4757. Full -update was rejected: it would rewrite 20+ unrelated baseline entries that main-v2 changed since the snapshot.
complyue
force-pushed
the
reasonix/delivery-20260807-191143-4f9886a924
branch
2 times, most recently
from
August 10, 2026 16:02
73fd188 to
95d2e2f
Compare
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.
背景
桌面端命令面板(Command Palette)原先占用了
Cmd+K/Ctrl+K全局快捷键,导致集成终端里无法使用 VSCode 风格的Cmd+K清屏——终端清屏是高频操作,这个冲突让用户被迫改用其他方式。该重构最初完成于个人分支
personal/desktop-dev-build(提交76fda5238),但该分支还混有其他无关改动(构建脚本、IME 提交确认修复等),不适合整体合入。本次将其干净地 cherry-pick 到 main-v2 最新头,形成独立、聚焦的 PR 分支。目的
F1打开命令面板(各平台与 VSCode 一致;面板打开时聚焦搜索框,Esc关闭)Cmd+K(macOS)/Ctrl+K(Windows/Linux)在终端获得焦点时清空屏幕与回滚缓冲,与 VSCode 集成终端语义一致价值
terminal-clear-shortcut.test.ts、更新keyboard-shortcuts.test.ts;en/zh/zh-TW 文案与GUIDE/GUIDE.zh-CN文档同步变更内容
13 个文件,+152/-19:
keyboardShortcuts.ts、App.tsx、CommandPalette.tsx、TabBar.tsx、TerminalView.tsx、styles.css__tests__/terminal-clear-shortcut.test.ts(新增)、__tests__/keyboard-shortcuts.test.tsdocs/GUIDE.md、docs/GUIDE.zh-CN.md另含 1 行 ratchet 边界调整(
tools/repolint/baseline.json):本重构对历史遗留的 5557 行App.tsx净 +1 行,将其 file-size budget 4756→4757。已拒绝全量-update(避免吞入无关债务差异),仅精确调整该文件,理由见提交信息。验证
gofmt/go vet ./.../go run ./tools/repolint全绿go test ./...通过;3 个失败均与环境相关,与本次改动无关:internal/remote2 个单测在超长$TMPDIR会话下 unix socket 路径超限(127 > 104 字符,main-v2 对照同样复现);internal/environment、internal/sandbox各 1 个单测在全量并发下瞬时超时(单独重跑均通过)pnpm testCache-impact: none - 仅 desktop/frontend TS、docs 与 repolint baseline 调整,不触及 provider 可见的系统提示前缀
Cache-guard: 未改动 internal/tool、internal/provider、internal/boot 等缓存敏感路径,现有 guard 不受影响
Documentation-impact: updated - GUIDE.md 与 GUIDE.zh-CN.md 的快捷键说明随重构同步更新