Skip to content

feat(input): 输入框内添加文件(@file/@directory 结构化引用)#507

Closed
KevinYoung-Kw wants to merge 2 commits intoop7418:mainfrom
KevinYoung-Kw:输入框内添加文件

Hidden character warning

The head ref may contain hidden characters: "\u8f93\u5165\u6846\u5185\u6dfb\u52a0\u6587\u4ef6"
Closed

feat(input): 输入框内添加文件(@file/@directory 结构化引用)#507
KevinYoung-Kw wants to merge 2 commits intoop7418:mainfrom
KevinYoung-Kw:输入框内添加文件

Conversation

@KevinYoung-Kw
Copy link
Copy Markdown
Contributor

@KevinYoung-Kw KevinYoung-Kw commented Apr 16, 2026

Summary

这个 PR 聚焦输入框内 @ 文件引用能力,不和 feat/global-search 混在一起。

主要改动:

  • 新增 GET /api/files/suggest,支持 session 范围内文件/目录候选(相对路径 + type)
  • @file / @directory 走结构化 mentions,发送链路支持:
    • @file -> files[] 附件
    • @directory -> 目录摘要(不递归注入全文)
  • 输入框胶囊 UI/UX 改进:
    • skill / file / directory 增加类型 icon
    • skill 与 file 胶囊统一同一行混排
    • 按选择顺序显示(不按类别分组)
  • 交互修复:
    • 删除一个 mention 不会把全部 mention 清空
    • Backspace 在 mention 末尾时一次删除整个 @file token
    • 非有效路径不渲染为有效 mention 胶囊

Tests

  • npm run -s typecheck
  • npx playwright test src/__tests__/e2e/mention-ui.spec.ts
  • 新增/更新 unit + e2e:
    • src/__tests__/unit/files-suggest-route.test.ts
    • src/__tests__/unit/message-input-interactions.test.ts
    • src/__tests__/e2e/mention-ui.spec.ts

Notes

  • 这是独立 feature 分支:输入框内添加文件
  • feat/global-search 分支保持分离,便于评审与回滚

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 16, 2026

@KevinYoung-Kw is attempting to deploy a commit to the op7418's projects Team on Vercel.

A member of the Team first needs to authorize it.

@KevinYoung-Kw
Copy link
Copy Markdown
Contributor Author

已改为 ASCII 分支重发,避免 hidden character warning,并包含 lint 修复(setState-in-effect)。请优先 review #508

@KevinYoung-Kw KevinYoung-Kw deleted the 输入框内添加文件 branch April 16, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant