fix: show cumulative diff in Files Changed panel - #181
Merged
jeonghun-jj-lee merged 1 commit intoAug 11, 2026
Conversation
- Add three-layer diff resolution: primary diffFull, per-file fallback A (git show from-ref vs disk), then existing summary/metadata fallbacks - Track in-flight files from completed tool parts with filediff metadata - Log warning on diffFull failure before falling through (observability) - Add Snapshot.diffFromDisk(ref, files) for per-file fallback - Rename 'Modified Files' → 'Files Changed' across TUI and web app - Update empty-state copy to 'File changes from current session will appear here'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #179
Problem
The Files Changed panel showed only the last edit's diff per file, while line-count badges showed the correct cumulative totals — a mismatch that made the panel unreliable for reviewing session changes.
Changes
Three-layer diff resolution in
Session.diff()fromhash + agent filesdiffFull(from, to)filtered to agent filesgit show <from>:<path>vs current diskfromhashIn-flight file tracking
agentFilesAbsolutenow also collects files from completedtoolparts carryingfilediff.filemetadata, so files edited mid-turn appear immediately.Observability
The silent
catchCause(() => succeed([]))is replaced with a warn-level log before falling through.Label rename
"Modified Files" → "Files Changed" across TUI sidebar, web app side panel, and mobile tab — aligning with CONTEXT.md, the enterprise share page, and the existing e2e assertion.
Empty-state copy
"Project changes will appear here" → "File changes from current session will appear here"
Files
packages/opencode/src/snapshot/index.ts— newdiffFromDisk(ref, files)methodpackages/opencode/src/session/session.ts— in-flight tracking, observability, Fallback Apackages/tui/src/feature-plugins/sidebar/files.tsx— label renamepackages/app/src/pages/session/session-side-panel.tsx— label rename (×2)packages/app/src/pages/session.tsx— label renamepackages/ui/src/i18n/en.ts— empty-state copy