Repository navigation
fix(web-ui): 变更卡片和多文件编辑记录支持打开文件 - #1105
Merged
Merged
Conversation
DSH 的编辑记录点击文件路径即可在右侧打开文件。31f39333e 新增轮末变更卡片后, 编辑记录在本轮结束后折叠,卡片只能展开 diff;一次调用改多个文件时编辑记录也不再提供路径链接。 - 轮末变更卡片:单文件点击标题打开,多文件在每行末尾提供打开按钮 - 多文件编辑记录:展开后的文件路径可点击打开 - 复用聊天中已有的 openFile,与点击消息里的文件路径同一入口
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Collaborator
|
感谢贡献!我们也在隔离 Web 环境补测了浅色/深色主题、390px 手机端以及多文件 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
问题:一轮结束后,回复末尾的「已编辑 xx / 查看变更」卡片只能原地展开 diff,没办法打开整个文件。
来历:
ToolRow的onOpenFile)。docs/product/standalone-web.md和相关 issue(如 [Bug] 同一文件多次编辑时,文件变更卡片显示"N 个文件"但 N 是修改次数,且列表重复同一路径 #218)里都没有说明这是有意为之。改动:
ui-chat):ui-toolToolRow):展开后列出的文件路径可以点,样式沿用单文件编辑记录现成的路径链接(.fileLink)。和单文件一样,失败或取消的调用不给链接。openFile,和点击消息里的文件路径是同一个入口,绝对路径、相对路径都由fileAddressFor处理。data-phone)上 ↗ 按钮和单文件标题的点击区域都不小于 44px。docs/product/standalone-web.md「编辑调用与本轮文件变更」一节。代码量
统计方法:
git diff --numstat -M ab1a0df68...HEAD(共 1 个提交,基于mainab1a0df68)。分类规则:docs/及所有.md。ui-chat)ui-tool)业务代码的构成:
ui-chat(+133 / −35):TurnChangesCard.module.css(+67 / −0)与TurnChangesCard.tsx(+63 / −35):单文件标题可点击打开、多文件行尾增加 ↗ 打开按钮及移动端 44px 点击热区。TurnTailNodeView.tsx(+1 / −0)与locale.ts(+2 / −0):透传openFile与补充文案。ui-tool(+12 / −1):ToolRow.tsx:多文件编辑记录展开后的路径复用.fileLink与onOpenFile。Related issues
N/A
UI Demo
截图来自本机开发版 Web 的真实会话,路径前缀已脱敏。
桌面,单文件卡片,鼠标悬停在标题上:
桌面,多文件卡片,鼠标悬停在第一行的打开按钮上:
点击后在右侧边栏打开完整文件(只截了右侧栏):
手机(390px),单文件卡片和多文件卡片:
Test plan
apps/web-ui不写组件测试,这次也没有新增测试。prettier --check。TurnChangesCard.tsx、TurnTailNodeView.tsx、ToolRow.tsx跑了tsc --noEmit,改动部分没有类型错误。npm start web -- --port 4401 --host 127.0.0.1 --keep-host起开发版 Web,连接现有 Host。浏览器是 Playwright 驱动的 Chrome,桌面 1440px、手机 390px,深色主题。aria-expandedfalse → true),不打开文件。.fileLink样式和onOpenFile。