Skip to content

File access parity: browse the whole sandbox, and show diffs on changed files in chat - #340

Merged
yuga-hashimoto merged 2 commits into
mainfrom
claude/issue-330-6c62bc
Sep 19, 2026
Merged

yuga-hashimoto merged 2 commits into
mainfrom
claude/issue-330-6c62bc

Conversation

@yuga-hashimoto

Copy link
Copy Markdown
Owner

Summary

Closes #330.

Two review-related gaps OpenCode already handled that Claude Code and Antigravity did not:

  • Unrestricted file browsing — the workspace Explorer was locked to a single fixed workspace.path, so anything outside it (/root, /tmp, …) was invisible even though the app's own folder picker (RuntimeFolderBrowser/WorkspaceFolders) could already reach the whole sandbox rootfs and device storage. The Explorer now navigates freely up past the original root, reusing that same containment logic (WorkspaceFolders.hostDirectory) instead of ClaudeWorkspaceFiles's old two-root-only resolution.
  • Changed files + diff in chat — the "file changes" card after a turn showed only file names, non-interactively, and nothing called the diff-capable sessionDiff/vcsDiff APIs that already existed for git-based backends. The card is now clickable and opens a diff dialog. A new RuntimeCapabilities.diffCapable flag (true for OpenCode local/remote and Claude Code, false for Antigravity) gates whether a diff is actually fetched — Antigravity and non-git workspaces show the file list with a "diff unavailable" message instead of a hard error (this also fixes a pre-existing bug where Antigravity's Explorer Changes tab threw an unrecognized error).

Changes

  • ClaudeWorkspaceFiles now delegates root resolution to WorkspaceFolders.hostDirectory, gaining rootfs + device-storage browsing and adding synthetic /workspace (and device storage) entries when listing / so navigating up to the root is never a dead end.
  • WorkspaceExplorerViewModel tracks the browsed directory as an absolute sandbox path instead of a workspace-relative one; navigateUp/open reuse WorkspaceFolders.parentOf/normalize. Search and git status/diff stay scoped to the original workspace on purpose.
  • AntigravityTarget gains non-git-repo stub vcsInfo/vcsStatus/vcsDiff/sessionDiff (mirroring ClaudeCodeTarget's own fallback) and the shared Throwable.isNonGitWorkspaceError() extension (extracted out of WorkspaceExplorerViewModel).
  • ChatViewModel gains openPatchDiff/dismissPatchDiff and PatchDiffState (Loading/Loaded/Unavailable); ChatPart.Patch now carries the owning message id so sessionDiff can be scoped to the turn.
  • New ChatDiffDialog composable reuses WorkspaceExplorerScreen's existing UnifiedDiffView/SplitDiffView (now internal) rather than duplicating diff rendering.

Test plan

  • ./gradlew :app:compileGithubDebugKotlin / :app:compileFdroidDebugKotlin — both flavors compile
  • ./gradlew :app:testGithubDebugUnitTest — full suite green, 1105/1105 tests passing, including new/updated coverage for ClaudeWorkspaceFiles (rootfs + device storage browsing), WorkspaceExplorerViewModel (absolute-path navigation), WorkspaceFolders (synthetic root names), ChatViewModel (openPatchDiff/dismissPatchDiff), and backend diffCapable wiring
  • Manual on-device check: browse a Claude Code workspace up past its root into /root, open a file outside the original root, confirm it loads; trigger a turn that edits a file and confirm the diff dialog on a git workspace, and the "diff unavailable" state on an Antigravity/non-git session — not done in this environment (no simulator/emulator available), flagging for manual verification

🤖 Generated with Claude Code

yuga-hashimoto and others added 2 commits September 19, 2026 08:45
…iles in chat

Closes #330.

- Free the file explorer from the single fixed workspace root: it now
  navigates anywhere in the sandbox rootfs and device storage, reusing the
  same containment logic the workspace folder picker already trusted
  (WorkspaceFolders.hostDirectory), fixing Claude Code and Antigravity to
  match what OpenCode already allowed.
- Wire the chat's "file changes" card to the diff-capable sessionDiff/vcsDiff
  APIs that already existed but were unused: the card is now clickable and
  opens a diff dialog, gated by a new RuntimeCapabilities.diffCapable flag
  so Antigravity and non-git workspaces show a file-list-only view instead
  of a hard error, consistent across OpenCode (local/remote), Claude Code,
  and Antigravity.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds the missing diff_unavailable translation to every locale
(check-translations, lint MissingTranslation) and removes a trailing
blank line in WorkspaceExplorerViewModel.kt flagged by spotlessKotlinCheck.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@yuga-hashimoto
yuga-hashimoto merged commit c996f6a into main Sep 19, 2026
5 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.

Feature: File access parity: browse/read the whole Linux filesystem, and list changed files after each turn

1 participant