--- phase: 07-phase-06-mention-upload plan: 02 subsystem: gap-closure tags: [context-menu, priority-hint, skill-id, references, e2e] requires: - phase: 07-phase-06-mention-upload provides: 07-01-SUMMARY.md provides: - 修复右键打开 ContextMenu 时误触发“引用”的问题 - 优先提示前缀统一为“XClaw优先使用”并与展示层剥离规则对齐 - 提交态 Skill 拼接使用 skill_id,避免使用展示名 title affects: [frontend-chat-input, message-render, thread-submit-payload] tech-stack: added: [] patterns: - explicit-click-only context-menu reference action - submit/display separation with stable id-based hint composition key-files: created: - .planning/phases/07-phase-06-mention-upload/07-02-SUMMARY.md modified: - frontend/src/components/workspace/artifacts/artifact-file-list.tsx - frontend/src/components/workspace/messages/message-list-item.tsx - frontend/src/core/threads/priority-hint.ts - frontend/src/core/messages/utils.ts - frontend/src/core/threads/hooks.ts - frontend/src/core/threads/hooks.test.ts - frontend/tests/e2e/input-and-compose.spec.ts key-decisions: - "ContextMenu 引用动作仅绑定显式点击,移除 onSelect 触发路径。" - "优先提示统一改为 XClaw 前缀,并同步更新消息展示剥离规则。" - "Skill 拼接数据源统一使用 selectedSkills.skill_id。" requirements-completed: [P7-01, P7-02, P7-03, P7-04] duration: 35 min completed: 2026-04-17 --- # Phase 07 Plan 02 Summary 完成了 Phase 07 的 3 个 UAT gap closure:引用误触发、提示前缀唯一化、Skill 提示标识稳定化。 ## Implemented - 将 artifact 列表与消息附件中的 `ContextMenuItem` 引用动作从 `onSelect` 改为 `onClick`,避免仅右键打开菜单就自动引用。 - `priority-hint` 规则升级为 `XClaw优先使用...`,并保持“附件在前、Skill 在后、大小写不敏感去重”。 - `stripPriorityHintSuffix` 同步匹配新前缀,确保消息区继续只展示用户原文。 - `hooks.ts` 在两条发送链路中均改为使用 `selectedSkills.skill_id` 参与提交态拼接。 - 单测与 E2E 断言同步更新到新前缀。 ## 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|reference|context menu"`:1 passed ## Notes - 本计划为 `gap_closure: true`,直接对应 `07-UAT.md` 中 3 个已诊断缺口。