Skip to content

fix(preview): derive file list from tool-edit history, not git diffs - #185

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
feat/162-preview-tab
Aug 11, 2026
Merged

fix(preview): derive file list from tool-edit history, not git diffs#185
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
feat/162-preview-tab

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

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 reviewDiffs which 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:

  • Added touchedFiles memo in session.tsx that walks all message parts for filediff metadata
  • SessionPreviewTab uses touchedFiles as primary source, diffs as supplement
  • hasMarkdownFiles checks both sources

Fixes the bug where reopening a session after a rebuild (or after committing edits) would show an empty Preview file list.

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.
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 9826815 into local/amicode Aug 11, 2026
1 of 4 checks passed
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.

1 participant