Skip to content

refactor(client): reuse official DSH DiffBlock for Git comparisons - #12

Merged
cherrchen merged 2 commits into
mainfrom
feat/git-diff-page
Sep 30, 2026
Merged

cherrchen merged 2 commits into
mainfrom
feat/git-diff-page

Conversation

@cherrchen

Copy link
Copy Markdown
Owner

Git file comparisons now render through the official DSH DiffBlock. This removes the plugin's DiffTab line 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:

  • Development pin 0.2.0-rc.2: 187 tests, compatibility check, standalone type/build, 4 artifact checks, documentation check, and npm pack inspection.
  • Each other supported DSH release: fresh temporary install, compatibility check, 78 relevant regression tests, standalone build, and artifact checks.
  • Real temporary Git repositories cover staging, additions/deletions, Unicode paths, binary changes, renames, and missing terminal newlines.
  • Bilingual README/changelog and their blob records are synchronized.

This reuses the official public component; the turn-bound changes-review page is not a Git data-source API. Browser interaction in a running Web/Desktop host was not exercised.

@cherrchen
cherrchen marked this pull request as ready for review September 30, 2026 09:08
@cherrchen

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/client/git-diff-adapter.ts Outdated
if (operation === '\\') {
if (previous === '-' || previous === ' ') oldText = oldText.slice(0, -1)
if (previous === '+' || previous === ' ') newText = newText.slice(0, -1)
if (previous === '-' || previous === '+') newlineChanged = true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@cherrchen
cherrchen merged commit 1013689 into main Sep 30, 2026
10 checks passed
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.

1 participant