refactor(client): reuse official DSH DiffBlock for Git comparisons - #12
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49e313f9d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (operation === '\\') { | ||
| if (previous === '-' || previous === ' ') oldText = oldText.slice(0, -1) | ||
| if (previous === '+' || previous === ' ') newText = newText.slice(0, -1) | ||
| if (previous === '-' || previous === '+') newlineChanged = true |
There was a problem hiding this comment.
Compare both newline markers before reporting a change
When a modified file lacks a terminal newline both before and after the edit, Git emits a No newline at end of file marker after both the removed and added lines. This assignment sets newlineChanged for either marker, so the surface incorrectly claims the end-of-file newline changed even though only the line contents changed. Track the old and new missing-newline states separately and report a newline change only when they differ.
Useful? React with 👍 / 👎.
Git file comparisons now render through the official DSH
DiffBlock. This removes the plugin'sDiffTabline renderer and its patch styling while keeping Git fetching, staged/worktree semantics, existing sidebar addresses, and panel-local request state.A unified-patch adapter supplies old/new file fragments, reports binary and metadata-only changes, rejects incomplete output, and notes terminal-newline changes. The compatibility adapter supports both legacy and current official labels and avoids counting unchanged context as edits on DSH 0.1.5-rc.2. No DSH host/provider repository changes or new package dependencies are required.
Validation:
This reuses the official public component; the turn-bound
changes-reviewpage is not a Git data-source API. Browser interaction in a running Web/Desktop host was not exercised.