Add Ctrl+J to toggle edit diffs independently of tool output - #1388
Open
snimu wants to merge 5 commits into
Open
Add Ctrl+J to toggle edit diffs independently of tool output#1388snimu wants to merge 5 commits into
snimu wants to merge 5 commits into
Conversation
…tly of tool output
…d hint the summary line
Collapsed built-in edits showed the hint twice: on the edit header and on the summary line. The header hint now renders only when the diff is expanded (where no summary line exists); collapsed rows keep the single hint on the summary line.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 13ab4c2. Configure here.
… renders Gating the header hint on expansion assumed the collapsed summary line always carries the cue, but that summary only mounts once a successful result with a countable diff lands. During the preview-only window and on error rows the diff was expandable with no visible hint. The header now keeps the hint whenever the summary line is absent (mirroring its mount condition) and yields it once the summary renders, so exactly one hint is visible in every state.
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.

What this does
Adds
Ctrl+Jto show or hide edit diffs on their own, independent ofCtrl+O(tool output).When the agent has made a few file edits in between many long tool calls, you can press
Ctrl+Jto see every edit's full diff — while all the noisy tool output stays collapsed.Ctrl+Jis now the only switch for diffs:Ctrl+Ostill expands code and command output, but no longer shows or hides diffs. The two switches don't affect each other.Why
Expanding tool output was the only way to see a diff in full. With long-running work that means wading through hundreds of lines of command output just to check a handful of edits.
How it works
path +N −M) with a dim(Ctrl+J to expand)hint next to it. WithCtrl+Jon, the full diff renders in place of that summary — code and command output stay behindCtrl+O.Ctrl+Otools,Ctrl+Pagent messages,Ctrl+Tthinking) and is remappable like every other keybinding.Changes
Ctrl+Jhint, following the existing hint style and only on the most recent tool, like other hints.Lines changed (vs main): source +77/−11, tests +111/−9, docs and changelog +2/−0.
Checks
npm run checkclean; all touched test files pass (~260 tests across the areas).Ctrl+Jshows just the diffs, off hides them,Ctrl+Oexpands code/output without touching diffs. Also verifiedCtrl+Jis received distinctly from Enter in tmux; terminals that can't send it can remap the binding.Note
Add Ctrl+J to toggle edit diffs independently of tool output expansion
app.edits.expandkeybinding (ctrl+j) that toggles edit diff visibility separately from the general tool output expansion (ctrl+o).editDiffsExpandedstate toToolExecutionComponent,IPythonCellComponent, andInteractiveMode, decoupling diff display from the generalexpandedstate.FileChangeSummaryComponentwith actrl+jhint; when expanded, full diffs render instead.editDiffsExpandedrather thanexpanded, so collapsing tool output no longer hides diffs.Macroscope summarized 77ea530.
Note
Low Risk
Interactive UI and keybinding behavior only; no auth, persistence, or file-mutation logic changes beyond how diffs are displayed.
Overview
Adds
app.edits.expand(Ctrl+J) as a dedicated toggle for edit diff visibility, matching the pattern used for tool output (Ctrl+O), agent messages, and thinking blocks.Ctrl+Ono longer shows or hides diffs — built-inedittools and IPython edit cells now drive diff rendering fromeditDiffsExpandedstate inInteractiveMode, propagated viasetEditDiffsExpandedon tool and conversation components. Collapsed edits still show the╰─ path +N -Msummary; full diffs appear only when this toggle is on, whileCtrl+Ocontinues to control general tool/code expansion.UI polish: the expand hint moves to
app.edits.expandon the file-change summary line (header only before a settled result or on errors), with keybinding registration, shortcuts/help text, docs, and tests updated for both render paths.Reviewed by Cursor Bugbot for commit 77ea530. Bugbot is set up for automated code reviews on this repo. Configure here.