110 lines
4.5 KiB
Markdown
110 lines
4.5 KiB
Markdown
---
|
||
phase: 07-phase-06-mention-upload
|
||
plan: 02
|
||
type: execute
|
||
wave: 1
|
||
depends_on:
|
||
- 07-01
|
||
files_modified:
|
||
- frontend/src/components/workspace/artifacts/artifact-file-list.tsx
|
||
- frontend/src/components/workspace/messages/message-list-item.tsx
|
||
- frontend/src/core/threads/hooks.ts
|
||
- frontend/src/core/threads/priority-hint.ts
|
||
- frontend/src/core/messages/utils.ts
|
||
- frontend/src/core/threads/hooks.test.ts
|
||
- frontend/tests/e2e/input-and-compose.spec.ts
|
||
autonomous: true
|
||
gap_closure: true
|
||
requirements:
|
||
- P7-01
|
||
- P7-02
|
||
- P7-03
|
||
- P7-04
|
||
must_haves:
|
||
truths:
|
||
- "右键仅打开 ContextMenu,不会在未点击‘引用’前触发引用动作。"
|
||
- "拼接提示统一为‘XClaw优先使用...’,并在消息区剥离该后缀。"
|
||
- "提交态拼接 Skill 标识使用 skill_id,不使用 skill 的展示名。"
|
||
artifacts:
|
||
- path: "frontend/src/components/workspace/artifacts/artifact-file-list.tsx"
|
||
provides: "ContextMenu 引用动作改为显式点击触发"
|
||
contains: "onClick={() => {"
|
||
- path: "frontend/src/core/threads/hooks.ts"
|
||
provides: "skill_id 拼接入 submitText"
|
||
contains: "skill.skill_id"
|
||
- path: "frontend/src/core/messages/utils.ts"
|
||
provides: "XClaw 前缀剥离"
|
||
contains: "stripPriorityHintSuffix"
|
||
---
|
||
|
||
<objective>
|
||
关闭 07-UAT 中 3 个 gap:ContextMenu 自动引用、拼接前缀不够独特、Skill 使用 title 而非 id。
|
||
|
||
Purpose: 让提示拼接语义更可追踪,避免误触引用,同时保持 UI 展示与提交 payload 语义解耦。
|
||
Output: 修复提交链路与右键引用交互,并补齐回归测试。
|
||
</objective>
|
||
|
||
<tasks>
|
||
|
||
<task>
|
||
<name>Task 1: 修复 ContextMenu 引用误触发</name>
|
||
<files>frontend/src/components/workspace/artifacts/artifact-file-list.tsx, frontend/src/components/workspace/messages/message-list-item.tsx</files>
|
||
<action>
|
||
将“引用”动作从易误触发的 `onSelect` 路径收敛到显式点击触发;确保仅在用户明确选择“引用”菜单项时才 dispatch mention event。
|
||
</action>
|
||
<acceptance_criteria>
|
||
- 右键打开菜单时不会自动触发引用。
|
||
- 菜单项点击后才触发引用并回填输入区。
|
||
</acceptance_criteria>
|
||
<verify>
|
||
<automated>rg -n "ContextMenuItem|onSelect|onClick|dispatchMentionReference" frontend/src/components/workspace/artifacts/artifact-file-list.tsx frontend/src/components/workspace/messages/message-list-item.tsx</automated>
|
||
</verify>
|
||
<done>ContextMenu 引用行为仅由显式用户点击触发,右键打开菜单不再自动引用。</done>
|
||
</task>
|
||
|
||
<task>
|
||
<name>Task 2: 拼接前缀改为 XClaw优先使用</name>
|
||
<files>frontend/src/core/threads/priority-hint.ts, frontend/src/core/messages/utils.ts, frontend/src/core/threads/hooks.test.ts</files>
|
||
<action>
|
||
将提示前缀从“优先使用”统一替换为“XClaw优先使用”,并同步更新消息区剥离逻辑与单测断言。
|
||
</action>
|
||
<acceptance_criteria>
|
||
- 请求 payload 中出现“XClaw优先使用【...】”。
|
||
- 消息区仍不显示该后缀。
|
||
- 单测全部通过。
|
||
</acceptance_criteria>
|
||
<verify>
|
||
<automated>rg -n "XClaw优先使用|stripPriorityHintSuffix|composeSubmitText" frontend/src/core/threads/priority-hint.ts frontend/src/core/messages/utils.ts frontend/src/core/threads/hooks.ts</automated>
|
||
</verify>
|
||
<done>前缀与剥离规则统一为 XClaw 版本,提交态与展示态语义保持一致。</done>
|
||
</task>
|
||
|
||
<task>
|
||
<name>Task 3: Skill 提示使用 skill_id</name>
|
||
<files>frontend/src/core/threads/hooks.ts, frontend/tests/e2e/input-and-compose.spec.ts</files>
|
||
<action>
|
||
提交文本组装时将 Skill 输入源改为 `selectedSkills.skill_id`,不要使用 `title`。补充/调整 E2E 断言验证请求体中的 skill_id 出现。
|
||
</action>
|
||
<acceptance_criteria>
|
||
- 拼接中 Skill 部分使用 id 列表。
|
||
- 发送按钮与回车路径行为一致。
|
||
</acceptance_criteria>
|
||
<verify>
|
||
<automated>rg -n "selectedSkills|skill_id|composeSubmitText" frontend/src/core/threads/hooks.ts</automated>
|
||
<automated>cd frontend && pnpm -s test:e2e --grep "DF-INPUT-008A|reference|context menu"</automated>
|
||
</verify>
|
||
<done>提交提示中的 Skill 标识稳定使用 skill_id,且主要发送入口回归通过。</done>
|
||
</task>
|
||
|
||
</tasks>
|
||
|
||
<verification>
|
||
- `cd frontend && pnpm -s typecheck`
|
||
- `cd frontend && pnpm -s test:e2e --grep "DF-INPUT-008A|reference|context menu"`
|
||
</verification>
|
||
|
||
<success_criteria>
|
||
- 07-UAT 提到的 3 条 gap 在代码和测试层均可回归。
|
||
- 形成可直接执行的 gap closure 计划。
|
||
</success_criteria>
|