fix(preview): derive file list from tool-edit history, not git diffs - #185
Merged
Conversation
The Preview tab now uses a dedicated touchedFiles signal that scans all completed edit/write/patch tool parts in the session for filediff metadata. This ensures documents remain visible even after being committed or reverted, since the source of truth is 'what did this session touch' rather than 'what does the working tree currently diff against HEAD'. The git-based reviewDiffs is still used as a supplement (for files that somehow appear in diffs but weren't captured as tool parts), but touchedFiles takes priority.
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.
The Preview tab file list now uses a touchedFiles signal that scans all completed edit/write/patch tool parts in the session, independent of git state.
Previously, the file list came from
reviewDiffswhich is git-snapshot-based — files vanished from the Preview once committed or reverted. Now documents remain visible as long as the session touched them.Changes:
touchedFilesmemo insession.tsxthat walks all message parts forfilediffmetadataSessionPreviewTabusestouchedFilesas primary source,diffsas supplementhasMarkdownFileschecks both sourcesFixes the bug where reopening a session after a rebuild (or after committing edits) would show an empty Preview file list.