feat(web): align AskUserQuestion with TUI - #50
Merged
Merged
Conversation
Web 端提问框重做,保持「方案 A」:提问挂起期间 composer dock 整体让位给提问框, 提交/取消后恢复;master 的 composer「直接输入 = 插话」分支随之成为不可达代码, 一并移除(daemon 插话端点、排队卡片的插话按钮与转录 interjected 标记保留)。 反馈卡改为按 AskUserQuestion 工具消息的落盘元数据就地派生:回合结束的 transcript self-heal 会用新 id 覆写最近一轮,缓存锚点会让卡片消失,因此取消 标记(cancelled)、插话标记(interjected)与每题 multi_select 都必须落盘; daemon 回填答案时派生 not_answered(与 TUI 同规则),让「跳过」在模型侧呈现为 Not answered。判定不看工具名 —— 历史页可能只剩工具结果消息或工具已改名。 - questionPicker.js:导航、非末题跳过、末题防误提交、草稿与选中态分离、Enter 优先级 - QuestionPicker:低饱和配色、黑底白勾序号、hover 复制/回车、内联自定义答案、 折叠态,Tab/数字键/方向键/Enter/Ctrl+Enter/Esc 快捷键 - QuestionFeedbackCard:提交/取消/插话三种形态;ToolBlock 不再渲染旧结果卡 - 测试:questionPicker / questionFeedback 持久化与改名·插话覆盖、 composerEditabilityArchitecture 守「提交在途不改 disabled」与 composer 让位契约、 tests/tool/ask_user_question_tool_test.cpp 断言 cancelled 与 multi_select 验证:web `pnpm test` 与 `pnpm build`(含 lookbehind 兼容检查)通过; C++ `*AskUserQuestion*`、`AskUserQuestionPrompter.*`、 `AgentLoopQuestionInterjection.*` 共 54 个用例通过。
shaohaozhi286
approved these changes
Sep 15, 2026
shaohaozhi286
left a comment
Collaborator
There was a problem hiding this comment.
已完成审核,并在 bbbb025 修复以下问题:
- 多选题双击、Enter 和数字键确认已选项时丢失答案;确认操作现保持选中。
- Enter 未使用悬停/键盘焦点/推荐项,以及中文输入法确认键误触发提交。
- 未绑定请求的临时反馈串到下一题或其他会话;反馈现由共享 ToolBlock 读取对应持久结果。
- 折叠/原生按钮快捷键副作用、Esc 定时器跨请求、窄容器溢出。
- 同步实际交互规格并修复 OpenSpec delta 格式。
验证:pnpm test 2417 条通过;pnpm build、i18n 目录生成、OpenSpec strict、git diff --check 通过;真实 Chromium 组件检查 13 项通过(连接为 mock)。修复提交的远端 web-tests 已通过。C++ 源码和测试与原 PR c998f33 完全相同,原提交的 unit-tests 已通过;最新提交的 C++ CI 正在复跑。
审核通过。
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.
Summary
对齐 Web 端 AskUserQuestion 与 TUI 行为,重构前端提问组件并补充单测。
主要改动:
web/src/components/QuestionPicker.jsx(+493/-...),拆分提问交互逻辑到web/src/lib/questionPicker.jsQuestionFeedbackCard.jsx与questionFeedback.js,支持提问反馈回填/编辑src/tool/ask_user_question_tool.cpp调整工具参数与摘要逻辑,新增tests/tool/ask_user_question_tool_test.cppweb/scripts/i18n-en-overrides.mjs、sourceCatalog.generated.js)Test plan
由 CI 自动验证:
pnpm test+pnpm build(web-tests)ctest+ 模型注册表校验(unit-tests)本地已确认分支仅含 1 个 commit,相对 origin/master 领先 1。