fix(desktop): 优化推荐提示词发送与 Tab 交互 - #3310
Conversation
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2bf28cd88a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f17ee0a61f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20cff1da82
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/components/new-chat/ChatInput.tsx | 集中推荐词接受逻辑,统一按钮与 Enter 的发送路径,并将 Tab 提示改为可点击键帽。 |
| apps/desktop/src/renderer/components/new-chat/tests/composerPromptRecommendation.test.ts | 增加推荐词发送、Tab 接受和 Enter 路由的源码契约断言。 |
| apps/desktop/src/renderer/tests/promptRecommendationBadge.test.ts | 更新 Tab 键帽布局、样式、焦点轮廓和点击处理的源码断言。 |
| apps/desktop/src/renderer/tests/chatInputSteerShortcut.test.ts | 将发送快捷键的预期调用路径更新为完整的语音停止与发送入口。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
R[推荐词可见] --> A{用户操作}
A -->|点击发送或发送型 Enter| I[填入推荐词]
I --> S[执行既有发送链]
A -->|物理 Tab 或点击键帽| F[仅填入推荐词]
F --> E[保持编辑器焦点]
Reviews (2): Last reviewed commit: "fix(desktop): 对齐推荐词键帽设计规范" | Re-trigger Greptile
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
MagicLizi
left a comment
There was a problem hiding this comment.
按维护者指示批准;合并仍需通过 review-pr 的代码审查与其余安全门。
|
命中 UI 路径(ChatInput.tsx)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面,便于确认界面符合 DESIGN.md 设计规范。本条不阻断合并。 |
|
合了。推荐词现在是「Tab 填入、发送才真正发出去」,键盘路径终于跟按钮一致。 |
这次改了什么
摘要
优化 Desktop 输入框里的推荐提示词交互:推荐词可见时发送按钮保持可用,点击发送会直接消费并发送该推荐词;当前配置判定为发送的 Enter 快捷键也复用发送按钮的完整路径。选择
modifier-enter时,裸 Enter 仍保持原生换行。Tab 提示改为紧跟推荐文字的可点击键帽,点击或按物理 Tab 都只填入完整推荐词而不发送;键帽进一步缩小为更轻量的键盘按键造型,颜色继续与提示文字一致;圆角使用已登记的 8px inner-control 层级,键盘焦点使用主题无关的 Focus Blue。
同时将 3 条读取
ChatInput.tsx源码的测试断言改为忽略 Prettier 造成的空白与换行差异,不放宽原有语义检查。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
UI 变化
docs/design-rules/DESIGN.md§2 Color System:键帽聚焦时使用--focus-ring的主题无关 Focus Blue。docs/design-rules/DESIGN.md§3 Typography:沿用text-11字号 token,不新增任意字号。docs/design-rules/DESIGN.md§4 Inputs:推荐文字继续使用输入框的弱提示层级,避免误读为已输入正文。docs/design-rules/DESIGN.md§5 Border Radius:键帽使用已登记的rounded-lg(8px inner-control)层级,不使用任意圆角。docs/design-rules/DESIGN.md§10 Theme System & Token Reference:颜色使用现有语义 token,并通过text-inherit/border-current与推荐文字保持一致,自动适配 Light / Dark 主题。怎么验证的
自动验证
手工验证
send-suggested-prompt-e1ac09,启动结果DESKTOP_DEV_VERDICT=ready未执行的验证
modifier-enter裸 Enter 换行,已完成自动验证,尚未在开发版中重新手工操作确认。origin/main复现的 2 项基线失败,等待 CI 在当前环境复核。风险
风险分类
影响与回滚
提交前检查
git commit -s,见 DCO)