Skip to content

fix(source-control): 修复 DiffViewer 中 staged/unstaged 文件模型路径冲突#430

Merged
J3n5en merged 2 commits into
J3n5en:mainfrom
hellomrbigshot:fix/source-control-diff-sync
May 13, 2026
Merged

fix(source-control): 修复 DiffViewer 中 staged/unstaged 文件模型路径冲突#430
J3n5en merged 2 commits into
J3n5en:mainfrom
hellomrbigshot:fix/source-control-diff-sync

Conversation

@hellomrbigshot
Copy link
Copy Markdown
Contributor

@hellomrbigshot hellomrbigshot commented Apr 28, 2026

  1. 将非 commit 视图下的 original/modified 虚拟路径按 staged/unstaged 区分,避免同一路径导致 diff 同步异常。
  2. 修复 折叠未修改代码 在 暂存/取消暂存 切换时不生效的问题

具体体现是现在在版本管理下的更改文件,右边的内容经常不是最新的内容,比如
image
正确的 diff 应该是这样的
image

将非 commit 视图下的 `original/modified` 虚拟路径按 `staged/unstaged` 区分,避免同一路径导致 diff 同步异常。
@github-actions
Copy link
Copy Markdown
Contributor

Claude Code is working…

I'll analyze this and get back to you.

View job run

- 使用 diff 签名(含 staged/unstaged、commit/worktree)判断变更,避免误判导致不刷新
- 在 diff-ready 与手动拉取 lineChanges 后强制刷新 `hideUnchangedRegions`,并增加 rAF 调度与卸载清理
@github-actions
Copy link
Copy Markdown
Contributor

Claude Code is working…

I'll analyze this and get back to you.

View job run

@J3n5en J3n5en merged commit 40dfe52 into J3n5en:main May 13, 2026
1 check failed
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.

2 participants