Repository navigation
cmux next chat: files open on the right beside the chat (labs chatViewer) - #22057
Conversation
…, restored on top of next-chat-ui for its own review Brings back the chat viewer commits that moved out of #21315: files and changes in one column beside the transcript, the header's files list, a file's view, active header buttons, the x, one panel beside the chat with thread details floating over it, and the composer centered under the transcript. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed, its shadow, a 28px title row and the x Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Found 77 test failures on Blacksmith runners: Failures
...and 67 more test failures. View all on Blacksmith
|
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Probably yours: CI failed on
Failures:
Matched log linesNot re-run automatically: Written by
|
…eturns focus, transcript changes closes thread details, a cut folder says so, file.list stays in the chat folder, a fifo fails fast (red) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s show instead of passing silently, focus returns to the opener, every changes entrypoint closes thread details, a truncated folder says so, file.list is bound to the chat's real folder with symlinks resolved, readPath opens nonblocking and needs a regular file (review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y files use the viewer column (red) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ipt), only files and linked files use the column beside the chat Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mn (check-layers), format agentGitHost Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
… tooltips marked like the folder popover Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
@greptile review |
[Medium impact] The changes affect file browsing and linked-file viewing within local chat sessions. Fix Quick Chat's hidden file viewer before merging. FindingsSummaryAdds a default-on chat viewer for Files and linked text files, backed by folder listing and checked file reads.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[File link] --> B{Viewer registered?}
B -->|No| C[Open through app]
B -->|Yes| D[Check path and user gesture]
D --> E{File content}
E -->|Text| F[Chat file viewer]
E -->|Detected binary| C
E -->|Folder| G[Finder]
Reviews (1) · Last reviewed commit: "format the merged viewer dock condition" · Reviewed by Greptile |
| if (!chatViewer) return undefined; | ||
| setPathViewer(viewFile); | ||
| return () => setPathViewer(undefined); | ||
| }, [chatViewer, viewFile]); |
There was a problem hiding this comment.
Quick Chat registers viewFile, but its early return renders only QuickSurface, never FileViewer. With chatViewer enabled by default, clicking a text-file link reads the file into hidden state instead of opening the app's file tab. Only register the viewer on surfaces that render it; keep link.openPath for Quick Chat.
| guard let read = try? handle.read(upToCount: Self.maximumBytes + 1) else { return nil } | ||
| let body = read ?? Data() |
There was a problem hiding this comment.
| bytes = max(size, body.count) | ||
| truncated = body.count > Self.maximumBytes | ||
| let kept = body.prefix(Self.maximumBytes) | ||
| text = kept.prefix(8192).contains(0) ? nil : String(decoding: kept, as: UTF8.self) |
There was a problem hiding this comment.
A NUL check alone does not identify all files that should open in a tab. A valid PDF with uncompressed, ASCII-only objects can contain no NUL bytes, so this code returns its PDF source as text and skips the existing PDF viewer. Check known image, PDF, and media types before treating the file as text, and add a PDF case to the fallback tests.
|
@greptile review |
1 similar comment
|
@greptile review |
… the files viewer joins the chat pr conflicts: localizable.xcstrings (kept every key from both sides), markdown.tsx (kept the render engine's revealed and received-render blocks, added feat-cmux-next's away blocks and cached fence check). dropped an unused chatLook memo dependency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stacked on #21315 (base
next-chat-ui), retarget tofeat-cmux-nextonce that lands. split out of #21315 so that pr stays the render engine and lawrence's #21760 fixes.files and files the chat links to open in one column on the right of the chat, inside the chat, instead of a new column or a tab over it. behind
agentPane.labs.chatViewer(debug settings, pages section), on by default. changes (the diff) opens exactly as on production today, with the switch on or off.Summary
the viewer
..goes up (never above the chat's folder), search across the folder, a file opens in the same column. listing is the session host'sgit.files.list(newfile.list), search itsgit.files.search, so untracked ignored files never show (a tracked file shows even if it matches.gitignore).link.readPath): same checks as opening a path link today (deny list,agentPane.links.outsideRoots, a user gesture), text only, capped at 1 MiB. a binary file still opens in the app's tab, a folder in finder.header and thread details
Testing
web (bun, one file each):
chat-viewer,chat-files-view,chat-viewer-one-panel,chat-header-changes,labs-precedence,live-render;bun run typecheck: 10 errors and 7 warnings, all in HMR consumers this pr does not touch (same on the base).swift (ci only):
AgentPaneReplyReadPathTests,AgentPaneFilesListTests,AgentPaneLabsTests.checked in the mock pane (
?mock) at 1683 and 1100 px wide; lucas dogfooded the earlier rounds in a tagged dev app.the red-then-green commits for these behaviors are on
next-chat-ui(7f9cc9c..c62dfbd, reverted there in ea7e91a and 189a6c5); this branch restores them in one commit. the layout and header styling commits are css only, with no failing test first: happy-dom does not lay out.2026-10-20, after merging
next-chat-ui(cmux next: chat ui parity pass (thoughts, header, thread details, side column, files) #21315 with the latestfeat-cmux-nextand cmux next chat: site icons for thread details sources (labs sourceIcons) #22058):file.listnow resolves the path and stays inside the chat folder (security pass finding, low, dev only):bun test test/dev-host-file-list.test.tsfailed 2 before018738a0dba(../and an escaping symlink listed outside names) and passes 4 after.bun test test/chat-viewer.test.tsxfailed 6 at8445c43366f, 32 pass after45c505cac78.Observed / Not run
prepush-gate.py(no new violations), xcstrings lint, the mock pane at 1683, 1100 and 760 px.scripts/web-lint.shreds are outside this pr's files: text focus rings in CmuxNextBrowser and Checklist, formatting in settings pages.Changelog
Added: files and linked files open in a column beside the agent chat, with the chat's folder, search and file view (labs, on by default).