Repository navigation
Files view with editor and line comments in the right panel - #230
Merged
Merged
Conversation
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.
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
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
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.SessionServicemethods (list_project_dir,read_project_file,write_project_file,list_project_files), backed byfs_explorer::browse. Paths may not leave the project root, symlinks included.Line comments
<comment on="message">with a<quote>. A message holding a pending comment's quote gets a border and a badge that reopens the comment.DraftAttachment::LineComments).<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.Other UI changes
Testing
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.cargo test,cargo clippy --all-targets --all-features -- -D warningsandcargo fmt --checkpass.