You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When clicking a file in the desktop app's "Git changes" sidebar, the diff view now shows the entire file contents instead of only the changed lines.
Steps to reproduce
Open OpenCode desktop app
Make changes to a file in the project
Open the Git Changes sidebar on the right
Click on a changed file
Expected: Only changed lines (with a few lines of surrounding context) are shown. Actual: The entire file contents are displayed.
Root cause
Commit f023c63a6 (fix(app): stabilize virtual session timeline interactions (#28422)) refactored packages/ui/src/components/session-diff.ts and removed the logic that stripped context lines from patches before rendering.
The old code manually parsed patch hunks, extracted only the -/+ lines, and passed those reconstructed before/after strings to parseDiffFromFile — so only changed regions were shown. It also had a patchIsPartial flag that used parsePatchFiles (which respects hunk boundaries) when the patch didn't start from line 1.
The new code always passes the raw patch string directly to parsePatchFiles. Since the backend generates patches with context: Number.MAX_SAFE_INTEGER (packages/opencode/src/snapshot/index.ts:689) and context: Infinity (packages/opencode/src/file/index.ts:558), every line in the file appears as a context line in the patch, causing the full file to render.
Possible fixes
Backend: Change the context option in structuredPatch calls from Number.MAX_SAFE_INTEGER/Infinity to a standard value like 3 (the unified diff default).
Frontend: Restore the hunk-parsing logic in session-diff.ts that reconstructed before/after content from only the -/+ lines.
Activity
github-actions commentedon Jul 28, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.