Skip to content

feat(code_review): show changes in tab and splits - #3411

Open
olimorris wants to merge 14 commits into
mainfrom
feat/code-review
Open

olimorris wants to merge 14 commits into
mainfrom
feat/code-review

Conversation

@olimorris

@olimorris olimorris commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Description

The current code review feature in CodeCompanion felt too clunky to use. Using the quick fix to navigate to lines and not being able to see the diff wasn't particularly helpful. This PR introduces a new window and tab feature which allows the user to walk through every edit, accepting or rejecting them as they go.

Convenience helpers like being able to go into insert mode and navigate straight to that file and line, as well as being able to use undo against an accepted or rejected hunk, make this hugely improved from a UX perspective.

Supporting Documentation

AI Usage

Claude Code + Fable and Opus 5.5

Related Issue(s)

Screenshots

2026-09-26 14_36_03 - Ghostty

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I confirm that this PR has been majority created by me, and not AI (unless stated in the "AI Usage" section above)
  • I've run make all to ensure docs are generated, tests pass and StyLua has formatted the code
  • (optional) I've added test coverage for this fix/feature
  • (optional) I've updated the README and/or relevant docs pages

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Deploying codecompanion with  Cloudflare Pages  Cloudflare Pages

Latest commit: 33054c8
Status: ✅  Deploy successful!
Preview URL: https://308514f4.codecompanion.pages.dev
Branch Preview URL: https://feat-code-review.codecompanion.pages.dev

View logs

@olimorris
olimorris marked this pull request as ready for review September 26, 2026 13:39
@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Refactors code review UI from quickfix to a dedicated window.

The PR appears safe to merge; the remaining checklist-label clipping issue is non-blocking.

Findings

  1. P2 Single-hunk labels get clipped ▶
Fix with agent prompt
### Issue 1
lua/codecompanion/interactions/code_review/checklist.lua:328-332
For a single hunk inside a function, the checklist now uses the entire first changed line instead of the function name. If that line is long, its label extends past the fixed-width, non-wrapping checklist pane. The identifying text is then clipped, making the row harder to distinguish.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR replaces quickfix-based code review with a tab containing a file checklist and diff pane, adds accept, revert, undo, and branch-review controls, and updates the documentation. Since the previous review, the sent-comment marker was moved ahead of each checklist label.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Review baseline] --> B[Compare with worktree]
  B --> C[Checklist and diff pane]
  C --> D[Accept or revert hunks]
  C --> E[Write comments]
  E --> F[Send or share review]
  D --> G[Close completed round]
  F --> G
Loading

Reviews (8) · Last reviewed commit: "update checklist"

Comment thread lua/codecompanion/interactions/code_review/window.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/window.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/init.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/checklist.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/window.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/init.lua
Comment thread lua/codecompanion/interactions/code_review/baseline.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/window.lua
Comment thread lua/codecompanion/interactions/code_review/window.lua
Comment thread lua/codecompanion/interactions/code_review/checklist.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/window.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/init.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/init.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/window.lua Outdated
Comment thread lua/codecompanion/interactions/code_review/checklist.lua
Comment thread tests/interactions/code_review/test_checklist.lua
@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Comments Outside Diff

These findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.

  • P1 Previous shared review is lost lua/codecompanion/interactions/code_review/init.lua:173 ▶

    If a previous review has already been shared and saving the new baseline fails, store.submit() first replaces the existing review.md. The rollback restores the new comments to pending, but it cannot restore the earlier review. That review disappears from the stable path already given to the external agent.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread lua/codecompanion/diff/utils.lua Outdated
Comment on lines +328 to +332
local is_new = is_new_scope({ scope = scope, file_diff = file_diff, hunks = opts.group.hunks })
-- A single change reads best as the line itself; the scope only earns its place when it summarises more
if is_new or #opts.group.hunks > 1 then
label = (is_new and "new " or "in ") .. vim.treesitter.get_node_text(name, opts.source)
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Single-hunk labels get clipped

For a single hunk inside a function, the checklist now uses the entire first changed line instead of the function name. If that line is long, its label extends past the fixed-width, non-wrapping checklist pane. The identifying text is then clipped, making the row harder to distinguish.

Prompt To Fix With AI
This is a comment left during a code review.
Path: lua/codecompanion/interactions/code_review/checklist.lua
Line: 328-332

Comment:
**Single-hunk labels get clipped**

For a single hunk inside a function, the checklist now uses the entire first changed line instead of the function name. If that line is long, its label extends past the fixed-width, non-wrapping checklist pane. The identifying text is then clipped, making the row harder to distinguish.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

1 participant