Repository navigation
#416 Add read-only File Browser opened from Session Chat - #651
Merged
Merged
Conversation
Browse the session's project as a tree with server find, and view files
with line numbers and TextMate highlighting, Markdown preview, image
preview, 1 MiB truncation, and binary/empty/error states. Opens from the
Session Chat overflow menu ("Browse files") and a Files tile in the
Commands sheet. Tablets get a Files split pane with tabbed viewer.
Supports v1 (/file, /file/content, /find/file) and v2 (/api/fs/list,
/api/fs/read, /api/fs/find). Adds OpenCodeCodeFile and OpenCodeTreeRow
design-system components with gallery entries on both platforms.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
OPE-78 File Browser
Browse and inspect project files from the mobile app against the connected opencode server. Shell scope:
Remaining:
Notes: |
Collaborator
Author
|
@cursor review |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 3ce0f922-a088-447f-a1fc-3e14ea9e3133) |
ivanfenenko
marked this pull request as ready for review
October 11, 2026 20:45
ivanfenenko
temporarily deployed
to
android-release
October 11, 2026 20:47 — with
GitHub Actions
Inactive
ivanfenenko
commented
Oct 11, 2026
ivanfenenko
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review of the File Browser. I left 10 inline comments, ordered by severity:
- Possible crashes or memory pressure: a 206 UTF-8 split makes text files show as Binary (Android), there is no line-length cap on Android, and iOS image previews are decoded at full resolution.
- Cancellation and highlighting:
Task.detacheddrops cancellation on iOS, Android ignores the TextMate outcome, and iOS chunking breaks multi-line grammar state. - Cross-platform drift and smaller issues: the language tables differ (
.m), files over 16 MiB on v1 are labeled "Binary", the tab strip is feature-local UI, and iOS reads the body byte by byte.
- Split SessionChatView body into small modifier steps so the merged chain type-checks in time on CI. - Android: keep UTF-8 boundaries on 206/truncated reads, cap display lines at 5,000 chars, fall back to semantic highlighting when the TextMate outcome is not attachable. - iOS: downsample image previews to 4096 px, drop Task.detached so cancellation reaches reads, highlight the whole file in one pass with fallback, read bodies in chunks instead of byte by byte. - Both: "Too large to preview" state, OpenCodeFileTabs design-system component above the viewer header, OpenCodeFilterTabs for the Markdown toggle, trailing "ignored" tag, and one shared extension-to-language table (shared/file-languages) tested on both platforms. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ivanfenenko
temporarily deployed
to
android-release
October 11, 2026 21:34 — with
GitHub Actions
Inactive
This branch was previously deployed
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
/files). No Home entry.DirectoryListingPolicyis unchanged.filessplit-pane screen. Opening it collapses the Home sidebar, puts the tree on the left, and shows a tabbed viewer on the right.GET /file,/file/content,/find/file, withdirectoryfixed to the worktree.GET /api/fs/list,/api/fs/read/<encoded path>,/api/fs/find. Reads are streamed and capped, and non-image reads sendRange: bytes=0-1048575. A NUL byte or invalid UTF-8 means the file is treated as binary.OpenCodeCodeFileandOpenCodeTreeRowcomponents on both platforms, each with a Component Gallery entry.Checks
./gradlew --offline :app:assembleDebugpasses.:app:testDebugUnitTestpasses (1934 tests, 0 failures, 1 skipped). A focused rerun of the file-browser, slash-catalog and split-pane tests also passes (78 tests).ktlintMainSourceSetCheckandktlintTestSourceSetCheck: no violations in new files. Both tasks still fail on violations that were already in untouched files.xcodebuild buildpasses.opencode serve(1.18.35, v1):Issue
Risks / Follow-ups
icons/manifest.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Note
Medium Risk
Large new surface area (remote file I/O, v1/v2 protocol branching, and streaming/size limits) but read-only with extensive unit tests; v2 behavior is not fully validated on device per PR notes.
Overview
Adds a read-only project File Browser rooted at the session worktree, reachable from Session Chat via overflow Browse files and the
/filescommand tile (alongside Terminal).Navigation & layout: New
FileBrowserroute hostsFilesScreen. On phones the tree pushes a file viewer; on wide layouts it uses a newFilessplit pane (tree + tabbed viewer) that collapses the Home sidebar like Changes/Terminals.Data layer: Extends
FilesystemApiand addsProjectFilesRepositorywith v1 (/file,/file/content,/find/file) and v2 (/api/fs/list,/api/fs/read,/api/fs/find) paths, streaming reads, byte caps, and decoding into text/image/binary preview models (1 MiB text truncation, image size limits).UI: Lazy expandable tree with server find, hidden-file toggle, and a viewer with syntax highlighting (TextMate or semantic fallback), Markdown preview/source, wrap/copy path, and analytics. New design-system pieces
OpenCodeCodeFileandOpenCodeTreeRowplus gallery entries on Android (and matching gallery/DTO hooks on iOS in this diff).Reviewed by Cursor Bugbot for commit 060f508. Bugbot is set up for automated code reviews on this repo. Configure here.