feat(tools): append_file 工具输出支持 diff 预览 - #85
Merged
Conversation
Collaborator
Author
|
审阅后已推送两处修复: 本仓 commit e2ce2be(前端):
fork 侧 commit a1728d651(Pinvou/CodeWhale#2,已推到
待办(转正前):fork PR 合并并在合并 commit 上打 |
底座 append_file 输出 inline unified diff 后(Pinvou/CodeWhale#2),前端工具卡片 与 write_file 一样走 DiffView 渲染带行号、着色的 diff 预览;旧 session 落盘的 纯文本输出保留 appendBytes 字节摘要兜底。fork-guard 指纹与 fork-modifications.md 按同 PR 要求随 fork patch 登记。gitlink 与稳定 tag 待 fork PR 合并后本 PR 内更新。 Signed-off-by: hexin <372726039@qq.com>
审阅发现:旧文件超 512KB 时后端输出 "摘要 + [diff omitted] 说明", 前端 appendBytes 正则兜底会吞掉 omit 说明行,用户看不到 diff 被省略的 原因。含 [diff omitted] 时不再走字节摘要兜底,与 write_file 一样落到 OutputPre 展示完整原文;diff_viewer_ui_smoke 补该场景 fixture 与断言。 Signed-off-by: asto <asto18089@126.com> Signed-off-by: hexin <372726039@qq.com>
Signed-off-by: hexin <372726039@qq.com>
h3c-hexin
force-pushed
the
feat/append-file-diff-preview
branch
from
July 30, 2026 06:02
e2ce2be to
9c57ea0
Compare
h3c-hexin
marked this pull request as ready for review
July 30, 2026 06:03
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.
概述
让
append_file与write_file/edit_file一样展示带行号、着色和可展开的 inline unified diff,同时兼容旧 session 的纯字节摘要。变更
append_file输出 inline unified diff 和尾部字节摘要;旧文件超过 512KB 或非 UTF-8 时安全回退。DiffView;旧格式继续显示字节摘要;[diff omitted]保留完整原因。cb93e0f4466d,发布稳定标签pinvou-v0.9.0-r2;父仓 gitlink、固定标签、守护指纹及中英文 fork 文档已同步。实际验证
cargo fmt --all -- --checkcargo test -p codewhale-tui --lib tools::file --no-fail-fast:77 passed./scripts/verify-public-submodule.sh./scripts/fork-guard.sh --fastpython3 scripts/architecture-guard.pynode pinvou3-app/tests/unified_diff_parser.test.js:24 passednode pinvou3-app/tests/diff_viewer_ui_smoke.mjsnpm --prefix pinvou3-app run lint:ui风险
inline diff 仅在旧文件不超过 512KB 时生成;超限和非 UTF-8 文件不会读取并比较完整内容,避免大文件内存放大。