Skip to content

Files view with editor and line comments in the right panel - #230

Merged
stippi merged 6 commits into
mainfrom
feat/file-review-panel
Oct 8, 2026
Merged

stippi merged 6 commits into
mainfrom
feat/file-review-panel

Conversation

@daniel-kurzynski

@daniel-kurzynski daniel-kurzynski commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds a Files view to the right panel and lets the user comment on lines of files and diffs, and on passages of chat messages. The comments go to the agent with the next message. The plan, including the decisions taken while building, is in docs/files-panel-plan.md.

Files view

  • The session's project as a lazy tree. It loads folders when they are opened, hides gitignored entries unless switched on, and has a fuzzy name filter. The tree pane can be resized or hidden.
  • The selected file opens in the code editor from gpui-component, with highlighting, line numbers and search. Edits save on their own about a second after typing stops, when another file is opened, and at once on Cmd/Ctrl-S. If the file changed on disk under unsaved edits, nothing is saved until the user picks Reload or Overwrite.
  • A watcher keeps the tree and the open file current. The open file, expanded folders and the gitignore toggle are remembered per session.
  • File access goes through new SessionService methods (list_project_dir, read_project_file, write_project_file, list_project_files), backed by fs_explorer::browse. Paths may not leave the project root, symlinks included.

Line comments

  • Lines selected in the editor or in the Review diffs, and text selected in a chat message, can be commented. A small pill (copy, comment) appears at the end of the selection, and the comment card floats next to it. Cmd/Ctrl-Shift-M also works in the Files and Review views.
  • A comment on a chat message carries the selected passage as a quote and reaches the model as <comment on="message"> with a <quote>. A message holding a pending comment's quote gets a border and a badge that reopens the comment.
  • Commented lines are marked: tinted in the editor, where the tint follows edits, and with a bar in the Review diff. Diff rows now take presses through a hitbox, so the pill above them keeps its clicks.
  • The composer shows all comments as one chip: a preview for one comment, a count for several. The chip lists the comments, jumps to them (in the panel or in the transcript) and removes them. Comments persist with the draft (DraftAttachment::LineComments).
  • On send, the comments become one <line-comments> text block. Each comment carries its project-relative path, line range, the selected lines (long selections keep their ends) and the text. The transcript shows the block folded.
  • After a load or save, a comment is found again by its excerpt, and its lines are updated when the code moved.

Other UI changes

  • File paths in tool cards (file-edit card headers, read/search result headers) open the file in the Files view, at the shown line where there is one.
  • The Review | Files | Browser switch moves into the title bar and replaces the panel toggle. A click opens the panel on that view or switches to it; clicking the shown view closes the panel.

Testing

  • Unit tests: browsing, writing and watching in fs_explorer; the service methods; rendering, parsing and re-anchoring of line comments, including comments on messages; the fuzzy filter; line selection; mapping diff rows to line numbers; the comment chip label.
  • Review view test: a selection shows the pill, and its comment button opens the card for the selected rows.
  • Main screen tests: comments from the panel and from the transcript reach the draft, survive session switches and go with the next message; open-file requests show the file; the title bar switch opens, switches and closes the panel.
  • cargo test, cargo clippy --all-targets --all-features -- -D warnings and cargo fmt --check pass.

The right panel gets a Files view: the session's project as a lazy tree
(gitignore-aware, fuzzy filter, live updates) next to the selected file in
the code editor, which saves on its own shortly after typing stops.

Lines selected in the editor or in the Review diffs can be commented. The
comments collect in the composer as one chip, persist with the draft and
go to the model as a <line-comments> block with path, lines, excerpt and
text; the transcript shows them folded.
File paths in tool cards open the file in the right panel's Files view,
at the shown line for read and search results. Requests reach the panel
over an app-wide bus the main screen listens to.

Adds main screen tests for line comments in the draft and for opening
files.
The Review | Files | Browser switch moves from the panel's header into the
title bar and replaces the panel toggle button. A click opens the panel on
that view or switches to it; clicking the shown view closes the panel.
Selected text in a chat message can be commented: releasing the mouse
shows a small pill (copy, comment) at the selection's end, and the comment
card floats there. The comment quotes the passage and reaches the model as
<comment on="message"> with a <quote>. Messages holding a pending comment's
quote get a border and a badge that reopens it.

The Files editor and the Review diffs use the same pill and floating card
in place of the header buttons and the docked comment box. Diff rows take
presses through a hitbox, so the pill above them keeps its clicks.
@stippi
stippi merged commit e4d1f3a into main Oct 8, 2026
5 checks passed
@stippi
stippi deleted the feat/file-review-panel branch October 8, 2026 14:50
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.

2 participants