fix(desktop): copy and paste not working in text inputs #6522
alickreborn0
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Motivation
修复桌面端文本输入框无法复制粘贴的问题。macOS 通过应用菜单的 role 向文本输入派发剪切、复制、粘贴、全选和撤销快捷键,而桌面壳此前只注册了应用菜单,导致包括设置页 API Key 输入框在内的所有输入框都无法响应 Cmd+C / Cmd+V。
Changes
apps/desktop/src/main.ts:应用菜单模板新增标准编辑子菜单(undo/redo/cut/copy/paste/selectAllrole,所有平台统一注册)。apps/desktop/src/locale.ts:桌面壳 locale 字典新增 7 个中英文菜单文案键(编辑 / 撤销 / 重做 / 剪切 / 拷贝 / 粘贴 / 全选)。apps/desktop/tests/main-startup.spec.ts:新增测试断言菜单模板携带全部六个 role。Testing
pnpm exec vitest run apps/desktop/tests/:desktop 全部 30 个测试文件 196 通过(含新增菜单断言)。Proof
tsx scripts/run-oxlint.ts <changed files>:0 warnings 0 errors。Proof
tsc -b apps/desktop与tsc -b tsconfig.host.json:类型检查通过(host 图包含 desktop 测试)。pnpm run verify-client-ui-i18n、verify-agent-note-format、verify-translation-pairing:文档与 i18n 门禁通过。运行时验证:重建并重启桌面端后,通过主进程 inspector 读取实际注册的应用菜单,确认"编辑"菜单携带全部六个 role。
Proof
[{"label":"@deepseek-ai/dsh-desktop","roles":["normal","normal","separator","quit"]}, {"label":"编辑","roles":["undo","redo","separator","cut","copy","paste","selectall"]}]Commit link:
257ef7e
All reactions