Skip to content

fix: show cumulative diff in Files Changed panel - #181

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
fix/179-files-changed-cumulative-diff
Aug 11, 2026
Merged

fix: show cumulative diff in Files Changed panel#181
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
fix/179-files-changed-cumulative-diff

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

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()

Layer When What
Primary from hash + agent files Batch diffFull(from, to) filtered to agent files
Fallback A (new) Primary returns empty Per-file git show <from>:<path> vs current disk
Fallback B (existing) No from hash Last-edit patch + summed line counts

In-flight file tracking

agentFilesAbsolute now also collects files from completed tool parts carrying filediff.file metadata, 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 — new diffFromDisk(ref, files) method
  • packages/opencode/src/session/session.ts — in-flight tracking, observability, Fallback A
  • packages/tui/src/feature-plugins/sidebar/files.tsx — label rename
  • packages/app/src/pages/session/session-side-panel.tsx — label rename (×2)
  • packages/app/src/pages/session.tsx — label rename
  • packages/ui/src/i18n/en.ts — empty-state copy

- 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'
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 12d024d into local/amicode Aug 11, 2026
1 of 4 checks passed
@jeonghun-jj-lee
jeonghun-jj-lee deleted the fix/179-files-changed-cumulative-diff branch August 11, 2026 01:01
@jeonghun-jj-lee
jeonghun-jj-lee restored the fix/179-files-changed-cumulative-diff branch August 11, 2026 08:02
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.

BUG: Modified Files panel shows only the last edit, not the full cumulative diff

1 participant