Skip to content

fix(tui): restore modified files sidebar#37613

Open
letanphuc wants to merge 2 commits into
anomalyco:devfrom
letanphuc:sidebar-modified-files
Open

fix(tui): restore modified files sidebar#37613
letanphuc wants to merge 2 commits into
anomalyco:devfrom
letanphuc:sidebar-modified-files

Conversation

@letanphuc

@letanphuc letanphuc commented Jul 18, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #30877

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The TUI Modified Files section has been empty since session-level diffs were disabled in #30127. The sidebar still requests a session diff without a message ID, but that request currently returns an empty list.

This change tracks the files changed by write, edit, and apply_patch. Before the first edit, the original file state is saved in private session storage. The session diff endpoint compares only those tracked files with their current contents, so generated build output and unrelated working-tree changes are not shown. Files restored to their original state, including files created and later deleted, disappear from the list.

The TUI refreshes this lazy diff after an assistant turn completes. Existing sessions continue to use snapshot diffs or legacy tool metadata when private baselines are unavailable.

Baseline contents are removed from tool metadata before tool parts are persisted or emitted, because tool metadata is exposed by session APIs and sharing.

How did you verify your code works?

  • Ran bun typecheck from packages/opencode and packages/tui.
  • Ran 64 focused opencode tests covering session diffs, processor behavior, write, and edit.
  • Ran 9 TUI sync and hydration tests.
  • The pre-push hook ran the repository-wide typecheck: 30 tasks passed.
  • Tested non-Git projects, missing .gitignore, generated build files, relative paths, and create-then-delete behavior.

Screenshots / recordings

No visual styling changed. The existing Modified Files section is populated again after agent edits.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found two potentially related PRs that address similar issues:

  1. PR fix(opencode): restore session diff summary #37542: fix(opencode): restore session diff summary

  2. PR fix(session): restore session summary from per-turn diffs (#30877) #33444: fix(session): restore session summary from per-turn diffs ([Bug] v1.16.0: TUI sidebar "Modified Files" section completely hidden after path truncation fix #30877)

Both PRs appear to be addressing the same root problem of restoring diff and summary functionality after #30127 removed eager session-level diff generation. The current PR (37613) specifically focuses on the TUI sidebar restoration with per-file baseline tracking, while #37542 and #33444 address related session-level diff restoration work.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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] v1.16.0: TUI sidebar "Modified Files" section completely hidden after path truncation fix

1 participant