File access parity: browse the whole sandbox, and show diffs on changed files in chat - #340
Merged
Merged
Conversation
…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>
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.
Summary
Closes #330.
Two review-related gaps OpenCode already handled that Claude Code and Antigravity did not:
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 ofClaudeWorkspaceFiles's old two-root-only resolution.sessionDiff/vcsDiffAPIs that already existed for git-based backends. The card is now clickable and opens a diff dialog. A newRuntimeCapabilities.diffCapableflag (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
ClaudeWorkspaceFilesnow delegates root resolution toWorkspaceFolders.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.WorkspaceExplorerViewModeltracks the browsed directory as an absolute sandbox path instead of a workspace-relative one;navigateUp/openreuseWorkspaceFolders.parentOf/normalize. Search and git status/diff stay scoped to the original workspace on purpose.AntigravityTargetgains non-git-repo stubvcsInfo/vcsStatus/vcsDiff/sessionDiff(mirroringClaudeCodeTarget's own fallback) and the sharedThrowable.isNonGitWorkspaceError()extension (extracted out ofWorkspaceExplorerViewModel).ChatViewModelgainsopenPatchDiff/dismissPatchDiffandPatchDiffState(Loading/Loaded/Unavailable);ChatPart.Patchnow carries the owning message id sosessionDiffcan be scoped to the turn.ChatDiffDialogcomposable reusesWorkspaceExplorerScreen's existingUnifiedDiffView/SplitDiffView(nowinternal) 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 forClaudeWorkspaceFiles(rootfs + device storage browsing),WorkspaceExplorerViewModel(absolute-path navigation),WorkspaceFolders(synthetic root names),ChatViewModel(openPatchDiff/dismissPatchDiff), and backenddiffCapablewiring/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