anomalyco / anomalyco/opencode

Web UI Git Changes panel shows entire file as changed instead of line-level diff

Open
#41,979 0 comments 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 12, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description
Description

The OpenCode Web UI (opencode web) incorrectly renders an entire tracked file as changed in the Git Changes panel, even when the underlying Git diff contains only a single-line change.

The same diff is rendered correctly in the OpenCode TUI.

Reproduction Steps
  1. Use any Git repository with a tracked source file.
  2. Make a small change to a single line, such as an indentation or whitespace change.
  3. Run:
git diff -- <file>
  1. Confirm that Git reports only a single-line hunk, for example:
@@ -10,7 +10,7 @@
-    example line
+      example line
  1. Open the same repository using the OpenCode TUI:
opencode
  1. Confirm that the TUI correctly displays only the modified line.

  2. Open the same repository using:

opencode web
  1. Open the Git Changes panel.

  2. The Web UI displays the entire file as changed instead of displaying only the actual changed line.

Expected Behavior

The Web UI Git Changes panel should display the same hunk-level diff provided by Git.

Only the lines actually added or removed should be highlighted.

Actual Behavior

The Web UI displays the entire file as changed, even though the underlying Git diff contains only a single-line hunk.

Evidence

The same repository state produces different results:

Git CLI
  ↓
Correct single-line diff

OpenCode TUI
  ↓
Correct single-line diff

OpenCode Web UI
  ↓
Entire file appears changed

This suggests that the underlying Git diff is correct and that the issue is likely occurring during Web UI diff processing or rendering.

Environment
  • OS: Windows
  • OpenCode version: 1.18.16
  • Git version: 2.52.0.windows.1
  • OpenCode interface: Web UI
Additional Verification

The issue is reproducible with a simple one-line whitespace/indentation change.

The raw git diff does not show the entire file as modified.

The OpenCode TUI correctly renders the same diff.

Therefore, this does not appear to be a Git whole-file diff or an EOL conversion issue.

Expected Result Across Interfaces

Both interfaces should represent the same underlying Git diff:

Git diff
   ↓
TUI      → single changed line
Web UI   → single changed line

Instead, the current behavior is:

Git diff
   ↓
TUI      → correct
Web UI   → entire file changed
Request

Please investigate the Web UI Git Changes diff rendering to determine why a valid hunk-level Git diff is being rendered as a full-file change.

Plugins

No response

OpenCode version

1.18.16

Steps to reproduce

No response

Screenshot and/or share link
Image
Operating System

Windows 11

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.