Skip to content

fix(preview): fetch touched files from server + fix i18n parity - #187

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
fix/preview-touched-files-server
Aug 11, 2026
Merged

fix(preview): fetch touched files from server + fix i18n parity#187
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
fix/preview-touched-files-server

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Problem

The Preview tab's file list was empty after reopening a session because:

  1. The client-side touchedFiles memo only walked loaded message parts — but the session paginates at 20 messages, so earlier edits were invisible
  2. The file read/write endpoints rejected absolute paths outside the workspace directory

Fix

New server endpoint: GET /session/:sessionID/touched-files scans ALL messages (unpaginated) for completed edit/write/patch tool parts with filediff metadata. Returns [{file, status}] independent of git state.

Client: touchedFilesQuery fetches from this endpoint (keyed on sessionDiffVersion so it refetches on new edits), with a client-side fallback for the live session before the server catches up.

Absolute path support (from PR #186): file read/write handlers now serve absolute paths directly via fs/promises — the traversal guard only blocks relative-path escapes.

i18n parity: Added 3 missing keys (session.archived.readOnly, session.archived.unarchive, common.unarchive) to all 17 non-English locales, fixing the pre-existing test failure.

Verification

  • opencode typecheck: clean
  • @opencode-ai/app typecheck: clean
  • Unit tests: 900/900 pass (including i18n parity)
  • Server session tests: 21/21 pass

@jeonghun-jj-lee
jeonghun-jj-lee force-pushed the fix/preview-touched-files-server branch 5 times, most recently from db29b47 to 6c73f6c Compare August 11, 2026 12:59
The Preview tab's file list now queries a new server endpoint
GET /session/:sessionID/touched-files that scans ALL messages in the
session for tool parts with filediff metadata — independent of git state
and client-side message pagination (which only loads the last 20 messages).

This fixes the bug where reopening a session wouldn't show files edited
earlier in the conversation.

Also adds missing i18n keys (session.archived.readOnly,
session.archived.unarchive, common.unarchive) to all 17 non-English
locales, fixing the pre-existing parity test failure.
@jeonghun-jj-lee
jeonghun-jj-lee force-pushed the fix/preview-touched-files-server branch from 6c73f6c to b2ece68 Compare August 11, 2026 13:03
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 151d263 into local/amicode Aug 11, 2026
1 check passed
@jeonghun-jj-lee
jeonghun-jj-lee deleted the fix/preview-touched-files-server branch August 11, 2026 13:04
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