Skip to content

feat(ui): inline diff in chat#2934

Merged
olimorris merged 5 commits into
mainfrom
feat/better-diffing
Mar 26, 2026
Merged

feat(ui): inline diff in chat#2934
olimorris merged 5 commits into
mainfrom
feat/better-diffing

Conversation

@olimorris

@olimorris olimorris commented Mar 26, 2026

Copy link
Copy Markdown
Owner

Description

This PR enables a diff to be shown in the chat buffer. It's configurable via display.diff.threshold_for_chat which reflects the number of additions and deletions in a given diff, and by default is set to 6 (number derived from my testing on my laptop).

The current workflow for a diff in a chat buffer:

  • If the diff is less than or equal to threshold_for_chat, display the diff inline
  • If the diff is bigger than threshold_for_chat and the chat buffer is active, open the diff in a floating window
  • If the diff is bigger than threshold_for_chat but the user is not in the chat buffer, display a notification. The user then needs to do gv in the chat buffer to view it.

AI Usage

Opus 4.6

Related Issue(s)

Builds on #2917.

Screenshots

2026-03-26 07_32_59 - Ghostty@2x

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 Mar 26, 2026

Copy link
Copy Markdown

Deploying codecompanion with  Cloudflare Pages  Cloudflare Pages

Latest commit: cbb0235
Status: ✅  Deploy successful!
Preview URL: https://69d47c28.codecompanion.pages.dev
Branch Preview URL: https://feat-better-diffing.codecompanion.pages.dev

View logs

@olimorris olimorris merged commit d5fd611 into main Mar 26, 2026
7 checks passed
@olimorris olimorris deleted the feat/better-diffing branch March 26, 2026 07:42
@olimorris

Copy link
Copy Markdown
Owner Author

@iamthebot FYI

@Or1g3n

Or1g3n commented Mar 26, 2026

Copy link
Copy Markdown

@olimorris

Howdy, this is a neat feature. I just noticed what seems like a bug though, should Proposed Edits show up twice?

image

@olimorris

Copy link
Copy Markdown
Owner Author

@Or1g3n - Good spot! I'll push a fix tonight

@daviareias

Copy link
Copy Markdown

@olimorris

Howdy, this is a neat feature. I just noticed what seems like a bug though, should Proposed Edits show up twice?

Not sure if its a bug, it just seems if you press any of the keys while in chat, there's no confirmation afterwards.

@olimorris

Copy link
Copy Markdown
Owner Author

I didn't deliberately add a confirmation as the LLM should respond. But marking the choice in some way does feel like a sensible idea

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.

3 participants