deerflow2/.planning/phases/07-phase-06-mention-upload/07-02-PLAN.md

98 lines
3.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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: "ContextMenuItem reference handler"
- path: "frontend/src/core/threads/hooks.ts"
provides: "skill_id 拼接入 submitText"
contains: "selected skills mapping"
- path: "frontend/src/core/messages/utils.ts"
provides: "XClaw 前缀剥离"
contains: "stripPriorityHintSuffix"
---
<objective>
关闭 07-UAT 中 3 个 gapContextMenu 自动引用、拼接前缀不够独特、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>
</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>
</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>
</task>
</tasks>
<verification>
- `cd frontend && node --test src/core/threads/hooks.test.ts`
- `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>