feat(coding-agent): always-visible edit summary with inline Ctrl+J diff - #1392
Open
snimu wants to merge 11 commits into
Open
feat(coding-agent): always-visible edit summary with inline Ctrl+J diff#1392snimu wants to merge 11 commits into
snimu wants to merge 11 commits into
Conversation
…diff inline beneath it
…ry path formatting, trim dead exports
…s after a successful preview
The edit-diff hint was threaded through showExpandHint, the flag that restricts the ctrl+o hint to the latest tool row. Since the agent almost always runs more tools after an edit, edit rows stopped being "latest" immediately and the ctrl+j hint effectively never appeared. The ctrl+j hint now renders on every edit summary row, matching the always-visible thinking (ctrl+t) and agent-message (ctrl+p) hints. The latest-row gating still applies to the ctrl+o hint on the header line.
…/edit-diff-inline-rendering
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 f29dbb4. Configure here.
…/edit-diff-inline-rendering # Conflicts: # packages/coding-agent/src/core/tools/edit.ts # packages/coding-agent/test/tool-execution-component.test.ts
The hint renders on every tool row, but within a row only on the last file's summary line — the comment claimed every summary row.
…/edit-diff-inline-rendering # Conflicts: # packages/coding-agent/src/core/tools/edit.ts # packages/coding-agent/test/tool-execution-component.test.ts
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
Builds on #1388. The one-line edit summary (
╰─ path +N −M) is now always visible, andCtrl+Jshows or hides the full diff directly beneath it.Why
In #1388, pressing
Ctrl+Jswapped the summary line for the diff, which shifted the layout and made it harder to scan. Keeping the summary as a stable anchor — with the diff appearing indented under it — reads more like an expandable section: you always see which file changed and by how much, and the toggle just reveals the details.How it works
╰─ path +N −Msummary line in both states, with a dim(Ctrl+J to expand)/(Ctrl+J to collapse)hint on the most recent one.Ctrl+Jonly adds or removes the diff lines underneath — nothing else moves.╰─marker), the same way expanded agent messages indent their body under the summary line. Red/green highlighting is unchanged.Changes
Lines changed (vs #1388): source +127/−95, tests +183/−34, changelog +1.
Checks
npm run checkclean; all touched test suites pass (tool-execution-component 33, ipython-cell-diff 22, edit-summary 5, edit-tool-no-full-redraw 3, edit-tool-legacy-input 9).Ctrl+Jreveals indented diffs beneath them and flips the hint;Ctrl+Oexpands code/output without touching diffs; both toggles work together.Note
Show always-visible edit summary line with inline Ctrl+J diff toggle
╰─ <path> +N -Msummary line; pressing Ctrl+J toggles the diff body inline beneath it, indented to align with the summary text column.FileChangeSummaryComponentfromToolExecutionComponent; summary/diff rendering is now owned by each tool renderer (edit.ts,ipython-cell.ts).FileChangeSummaryComponentdirectly must migrate toformatFileChangeSummaryLineper file.Macroscope summarized f1e4270.
Note
Low Risk
Interactive TUI rendering and test coverage only; no changes to edit execution, file I/O, or daemon protocol.
Overview
Edit rows in the coding-agent TUI now keep a stable
╰─ <path> +N -Mline visible at all times; Ctrl+J only adds or removes indented diff lines underneath, instead of swapping the summary for the diff.Built-in
edittool renders the summary via a sharedformatFileChangeSummaryLinehelper and a newEditChangeSummaryComponent(width-aware truncation, wrapped diff rows aligned withFILE_CHANGE_DIFF_INDENT). The expand hint moves off the header onto each summary row. Failed runs no longer show predicted diffs—the header uses error styling and the summary block is omitted.IPython cells use the same summary formatting and indent rules; summary lines appear even when diffs are collapsed. The Ctrl+J hint shows on every tool row (not only the latest), once per cell on the last file’s summary line.
ToolExecutionComponentstops injecting a separateFileChangeSummaryComponentfor collapsed edits—each renderer owns the full summary-plus-diff block.Reviewed by Cursor Bugbot for commit f1e4270. Bugbot is set up for automated code reviews on this repo. Configure here.