Repository navigation
feat(tui): add /diff, change review inside the workspace pane - #423
Merged
Merged
Conversation
Forge was the only one of the four agent CLIs benchmarked with no way to
review a change: no /diff, no changed-file view, nothing but scrollback and
`git diff` in the terminal panel.
Codex, Claude Code and OpenCode all answer this with a full-screen modal,
which costs you sight of the conversation that produced the change. Forge
already has three panes, so /diff is a mode of the workspace pane instead:
the explorer becomes the changed-file list, the patch renders where a file
would, and the transcript keeps streaming beside it.
Mostly assembly. git_review.rs already had combined_diff, hunk parsing and
binary detection and was wired to nothing; conversation.rs already rendered
numbered patches for the agent's inline edit cards; GitStatusCache already
had revision-keyed async diff loading with a comment saying it was "for a
future diff view".
/diff working tree: `git diff HEAD` plus untracked files as
synthetic add patches
/diff turn what the last assistant turn wrote, from the transcript's
own diff cards
/d alias
Keys: j/k and Ctrl+d/Ctrl+u and g/G scroll, ] and [ move by hunk, n and p
move by file, o opens the file at the line under the cursor, d switches
source, ? shows the table, Esc closes. The pane carries its own hint row
(hints::DIFF), degrading to keys-only when narrow.
`o` is the payoff for not being modal: jump from a hunk into the editable
file at the right line with the conversation still on screen. None of the
three competitors can do that.
Enter is deliberately not a synonym for `o`. Enter already means "show me
this file's patch" on the explorer side of this mode; giving it a second,
opposite meaning on the patch side would make one key do two things.
Two behaviours copied deliberately, two rejected. Copied: OpenCode's `?`
shortcut table, and a source selector. Rejected: Claude Code's silent no-op
on a clean tree — ours renders "No changes in the working tree" and stays
open — and its session-dependent notion of "changed", which hides an
untracked file unless the same session created it.
Every state renders something: loading, empty, git failure, not-a-repo, and
binary files. Silence was the failure mode to avoid.
EditorSession::set_cursor is no longer #[cfg(test)] — `o` needs it in a
release build.
Verified in a real PTY at 120x35 and 80x24: layout, keys, all empty/error
states, and `o` landing on new-file line 46 of 63 from hunk @@ -38,7 +46,11.
Claude-Session: https://claude.ai/code/session_018ihDDc3ahfrxu5AYL9moXs
mohitranka
force-pushed
the
feat/diff-view
branch
from
August 22, 2026 19:26
21b601f to
3be0782
Compare
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Forge was the only one of the four agent CLIs benchmarked with no way to
review a change: no /diff, no changed-file view, nothing but scrollback and
`git diff` in the terminal panel.
Codex, Claude Code and OpenCode all answer this with a full-screen modal,
which costs you sight of the conversation that produced the change. Forge
already has three panes, so /diff is a mode of the workspace pane instead:
the explorer becomes the changed-file list, the patch renders where a file
would, and the transcript keeps streaming beside it.
Mostly assembly. git_review.rs already had combined_diff, hunk parsing and
binary detection and was wired to nothing; conversation.rs already rendered
numbered patches for the agent's inline edit cards; GitStatusCache already
had revision-keyed async diff loading with a comment saying it was "for a
future diff view".
/diff working tree: `git diff HEAD` plus untracked files as
synthetic add patches
/diff turn what the last assistant turn wrote, from the transcript's
own diff cards
/d alias
Keys: j/k and Ctrl+d/Ctrl+u and g/G scroll, ] and [ move by hunk, n and p
move by file, o opens the file at the line under the cursor, d switches
source, ? shows the table, Esc closes. The pane carries its own hint row
(hints::DIFF), degrading to keys-only when narrow.
`o` is the payoff for not being modal: jump from a hunk into the editable
file at the right line with the conversation still on screen. None of the
three competitors can do that.
Enter is deliberately not a synonym for `o`. Enter already means "show me
this file's patch" on the explorer side of this mode; giving it a second,
opposite meaning on the patch side would make one key do two things.
Two behaviours copied deliberately, two rejected. Copied: OpenCode's `?`
shortcut table, and a source selector. Rejected: Claude Code's silent no-op
on a clean tree — ours renders "No changes in the working tree" and stays
open — and its session-dependent notion of "changed", which hides an
untracked file unless the same session created it.
Every state renders something: loading, empty, git failure, not-a-repo, and
binary files. Silence was the failure mode to avoid.
EditorSession::set_cursor is no longer #[cfg(test)] — `o` needs it in a
release build.
Verified in a real PTY at 120x35 and 80x24: layout, keys, all empty/error
states, and `o` landing on new-file line 46 of 63 from hunk @@ -38,7 +46,11.
Claude-Session: https://claude.ai/code/session_018ihDDc3ahfrxu5AYL9moXs
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Forge was the only one of the four agent CLIs benchmarked with no way to
review a change: no /diff, no changed-file view, nothing but scrollback and
`git diff` in the terminal panel.
Codex, Claude Code and OpenCode all answer this with a full-screen modal,
which costs you sight of the conversation that produced the change. Forge
already has three panes, so /diff is a mode of the workspace pane instead:
the explorer becomes the changed-file list, the patch renders where a file
would, and the transcript keeps streaming beside it.
Mostly assembly. git_review.rs already had combined_diff, hunk parsing and
binary detection and was wired to nothing; conversation.rs already rendered
numbered patches for the agent's inline edit cards; GitStatusCache already
had revision-keyed async diff loading with a comment saying it was "for a
future diff view".
/diff working tree: `git diff HEAD` plus untracked files as
synthetic add patches
/diff turn what the last assistant turn wrote, from the transcript's
own diff cards
/d alias
Keys: j/k and Ctrl+d/Ctrl+u and g/G scroll, ] and [ move by hunk, n and p
move by file, o opens the file at the line under the cursor, d switches
source, ? shows the table, Esc closes. The pane carries its own hint row
(hints::DIFF), degrading to keys-only when narrow.
`o` is the payoff for not being modal: jump from a hunk into the editable
file at the right line with the conversation still on screen. None of the
three competitors can do that.
Enter is deliberately not a synonym for `o`. Enter already means "show me
this file's patch" on the explorer side of this mode; giving it a second,
opposite meaning on the patch side would make one key do two things.
Two behaviours copied deliberately, two rejected. Copied: OpenCode's `?`
shortcut table, and a source selector. Rejected: Claude Code's silent no-op
on a clean tree — ours renders "No changes in the working tree" and stays
open — and its session-dependent notion of "changed", which hides an
untracked file unless the same session created it.
Every state renders something: loading, empty, git failure, not-a-repo, and
binary files. Silence was the failure mode to avoid.
EditorSession::set_cursor is no longer #[cfg(test)] — `o` needs it in a
release build.
Verified in a real PTY at 120x35 and 80x24: layout, keys, all empty/error
states, and `o` landing on new-file line 46 of 63 from hunk @@ -38,7 +46,11.
Claude-Session: https://claude.ai/code/session_018ihDDc3ahfrxu5AYL9moXs
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.
Why
Forge was the only one of four agent CLIs benchmarked (Codex, Claude Code, OpenCode) with no way to review a change — no
/diff, no changed-file view, nothing but scrollback andgit diffin the terminal panel. It was the single largest gap against all three.The design position
All three competitors answer this with a full-screen modal, which costs you sight of the conversation that produced the change. Forge already has three panes, so
/diffis a mode of the workspace pane instead:Mostly assembly
git_review.rs—combined_diff, hunk parsing, binary detection (wired to nothing)conversation.rs::render_numbered_diffGitStatusCacherevision-keyed async diff loading (its comment already said "for a future diff view")hints.rsgrammar + width degradationCommands
/diff— working tree:git diff HEADplus untracked files as synthetic add patches/diff turn— what the last assistant turn wrote, from the transcript's own diff cards/d— aliasKeys
j/k,Ctrl+d/Ctrl+u,g/Gscroll ·]/[hunk ·n/pfile ·oopen at cursor line ·dsource ·?table ·Escclose.The pane carries its own hint row, degrading to keys-only when narrow (
] [ n p o ? Esc).ois the payoff for not being modal: jump from a hunk into the editable file at the right line, conversation still on screen. None of the three competitors can do this.Enteris deliberately not a synonym foro— it already means "show me this file's patch" on the explorer side of this mode, and giving it a second, opposite meaning on the patch side would make one key do two things in one mode.Two behaviours copied, two rejected
Copied: OpenCode's
?shortcut table, and a source selector.Rejected: Claude Code's silent no-op on a clean tree (ours renders "No changes in the working tree" and stays open), and its session-dependent notion of "changed" — it hides an untracked file unless the same session created it. There's a test named for exactly that.
Notes
EditorSession::set_cursoris no longer#[cfg(test)];oneeds it in a release build.Verification
cargo fmt --all -- --checkclean ·cargo clippy --all-targetsclean ·cargo test --workspace45/45 binaries, 0 failures · 40 diff-specific tests.Driven in a real PTY at 120x35 and 80x24: layout, every key, all empty/error states, and
olanding on new-file line 46 of 63 from hunk@@ -38,7 +46,11 @@.Design doc:
docs/diff-view-design.md(local-only, untracked).https://claude.ai/code/session_018ihDDc3ahfrxu5AYL9moXs