Conversation
fix: 修复 Markdown Artifact 划选提问瞬闪与高亮缺失
两个展示层问题: 1. 文档工具调用以裸文本状态行散落正文流("找到 N 份候选文档"无图标、 无关联感),update 结果卡片突兀出现。现在连续的 find/read/update part 合并为一个 ThinkingState 时序块,每行带 步骤图标(search/book-open/file-pen)、运行中 spinner、失败警示色; 折叠标题汇总各步结果("找到 1 份候选文档 · 已读取「X」V1 · 已保存 修改")。update 提交完成后仍渲染 DocumentUpdateTool 结果卡片, 保留"查看本次版本与差异"入口。被思考/reasoning 分隔的调用拆为 独立块,保持真实时序。 2. updateProjectDocument 每次提交都写入一条修订版本 artifact (sourceMessageId = 本条消息),但气泡后的 MessageArtifacts 兜底 区只排除 createMarkdownArtifact 产出的 artifact,导致更新产物 在 action toolbar 下方重复出现一张下载卡片。现在 committed 更新 的 artifactId 同样被排除——详情由结果卡片承载。 ThinkingState Row.icon 扩展 "file-pen"(FilePenLine)供提交行使用。 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
展示层:
- updateProjectDocument 终态改为与正文 artifact 一致的 .acard 卡片:
committed 可点击(文档标题 + 已更新到 V{n} + 变更摘要 + 查看差异);
unchanged/conflict/rejected/output-error 为静态收据,失败态走
acard-failed 警示配色,不再向用户暴露 errorText。
- 同文档被后续提交覆盖的中间未保存结果不再出卡(只留在时序轨迹行),
避免「未保存」与最终成功卡并存造成误读;未落定消息中进行中的提交
计入后续尝试,落定后只认终态尝试。
- DocumentTrace 轨迹行补全结果摘要:找到标题/候选数、非最新标记、
update 执行中显示 changeSummary、完成后显示已保存处数。
- markdown-artifact-card 导出 ArtifactThumb 供结果卡复用;
artifact-card.css 增加 .s 变更摘要行样式。
Gate 3 harness:
- seed 一份 5 版本演示文档 + 6 组覆盖全部终态(committed / 冲突重试 /
unchanged / 终态 conflict / rejected / output-error)的演示对话;
- 场景下拉新增 6 个 document-* 场景,流式逐 chunk 演示轨迹推进,
committed/retry/conflict 真实写新版本(版本号持续递增);
- bootstrap/listDocuments/getDocumentHistory 接入文档目录。
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
修复文档工具调用的展示问题(#155 后续反馈),并把结果卡统一到 Artifact 视觉语言,附 gate-3 演示。
1. 工具调用流程展示(commit 1)
此前 find/read/update 三个文档工具 part 各自渲染为无图标的裸文本状态行,update 结果卡片突兀出现,看不出"查找→读取→思考→提交"的关联与时序。
assistant-part-render-plan.ts:连续的文档工具 part 合并为一个document渲染项(documents[]),被 reasoning 等分隔的调用拆为独立块,保持真实时序。thinking-trace.tsx:新增DocumentTrace——复用ThinkingState,每行按工具类型给图标(find=search / read=book-open / update=file-pen)、进行中 spinner、失败警示色;折叠态标题汇总各步结果。ThinkingState的Row.icon扩展"file-pen"(lucideFilePenLine)。2. 修订版本 artifact 落到 action toolbar 下方(commit 1)
updateProjectDocument每次提交都写入一条修订版本 artifact(sourceMessageId= 本条消息),但气泡后的MessageArtifacts兜底区只排除createMarkdownArtifact的产出,导致更新产物重复出现。现在 committed 更新的artifactId同样被排除——详情由结果卡片承载。3. 结果卡对齐 .acard 视觉语言 + 中间结果抑制(commit 2)
document-update-tool.tsx重写:committed → 可点击.acard(缩略图 + 文档标题 + 「已更新到 V{n}」+ 变更摘要 + 「查看差异」,整卡打开版本视图,支持fc-*深度配色);unchanged / conflict / rejected / output-error → 同形态静态收据,未保存类走acard-failed警示配色,不再向用户暴露原始errorText。anchored-assistant-body.tsx:同文档被后续提交覆盖的中间未保存结果不再出卡(只留在轨迹行),避免「未保存」与最终成功卡并存;未落定消息中进行中提交计入后续尝试,落定后只认终态尝试。DocumentTrace行内信息补全:find 显示「找到『标题』/未找到/N 份候选」,read 标注V{n} · 非最新,update 执行中露出 changeSummary、完成显示「已保存 N 处修改」。markdown-artifact-card.tsx导出ArtifactThumb;artifact-card.css新增.acard .s摘要行(两行截断)。4. Gate 3 harness 文档演示(commit 2)
mock-v1-runtime.ts:seed 一份 5 版本演示文档 + 6 组覆盖全部终态的演示对话;新增 6 个document-*场景(成功保存 / 冲突重试 / 无需修改 / 版本冲突 / 修改被拒 / 保存报错),fetchStream按节奏逐 chunk 发tool-input-available→tool-output-*,轨迹行可见真实 spinner 推进;commit/retry/conflict 场景真实写新版本(含并发提交模拟),版本号持续递增;bootstrap/listDocuments/getDocumentHistory接入文档目录。normalized-harness.tsx:场景下拉新增 6 项。访问:
/thread-chat-gate-3-harness/{uuid}(dev only)。Test plan
pnpm typechecke2e/thread-chat/ui-message-parts-rendering.test.mjs/message-artifacts.test.mjs/normalized-client-store.test.mjs/normalized-stream-session.test.mjs注:
chat-tool-set.test.mjs在干净 main 上已失败(route 工具集新增webSearch,断言未更新),与本次改动无关。仓库另有既有 lint 报错lib/axiom/server.ts(prefer-const),不在本 diff。Generated with Devin