deerflow2/.planning/phases/07-phase-06-mention-upload/07-01-SUMMARY.md

61 lines
2.5 KiB
Markdown
Raw Permalink 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: 01
subsystem: prompt-submit-and-display-separation
tags: [prompt-compose, references, skills, message-display, e2e]
requires:
- phase: 07-phase-06-mention-upload
provides: 07-01-PLAN.md
provides:
- 提交态拼接“优先使用”提示附件优先Skill次之
- 显示态与提交态分离(消息区不回显拼接提示)
- 规则单测与发送链路 e2e 回归
affects: [frontend-chat-input, thread-submit-payload, message-render]
tech-stack:
added:
- frontend/src/core/threads/priority-hint.ts
patterns:
- compose-before-submit with original-display preservation
- case-insensitive dedupe for attachment/skill labels
key-files:
created:
- .planning/phases/07-phase-06-mention-upload/07-01-SUMMARY.md
- frontend/src/core/threads/priority-hint.ts
modified:
- frontend/src/core/threads/hooks.ts
- frontend/src/core/threads/hooks.test.ts
- frontend/src/components/workspace/input-box.tsx
- frontend/src/components/ai-elements/prompt-input.tsx
- frontend/src/core/messages/utils.ts
- frontend/src/components/workspace/messages/message-list-item.tsx
- frontend/tests/e2e/input-and-compose.spec.ts
key-decisions:
- "发送 payload 使用 submitText消息显示继续使用用户原文。"
- "拼接模板固定为:优先使用【附件...】和【Skill...】;单类单出;大小写不敏感去重。"
- "在渲染层仅剥离固定后缀,避免拼接文案回显到用户消息区。"
requirements-completed: [P7-01, P7-02, P7-03, P7-04]
duration: 45 min
completed: 2026-04-17
---
# Phase 07 Plan 01 Summary
实现了“提交态增强文本 / 显示态原文”的完整链路:发送时自动拼接附件与 Skill 优先提示,消息区仍只展示用户输入内容。
## Implemented
- 新增 `priority-hint` 纯函数模块,封装 `buildPriorityHintText``composeSubmitText`
- `InputBox` 在提交时统一透传 `references + selectedSkills`,覆盖按钮发送、回车发送、建议词发送路径。
- `useThreadStream``useSubmitThread` 在调用 `thread.submit` 前组装 `submitText`
- `message-list-item` 渲染人类消息时增加固定后缀剥离,避免回显“优先使用【...】”。
## Verification
- `node --test frontend/src/core/threads/hooks.test.ts`7 passed
- `cd frontend && pnpm -s typecheck`passed
- `cd frontend && pnpm -s test:e2e --grep "DF-INPUT-008A"`passed
## Notes
- 本次新增 e2e 用例验证“请求体包含拼接文案,消息区不显示拼接文案”的核心回归场景。