● ALL GATES GREEN · awaiting review

ainb · Warp-style Code Review diff

The basic G session diff is rebuilt into a cohesive review surface — file sidebar, per-file collapsible blocks in one scroll, Dracula syntax highlighting, word-level intra-line emphasis, line-number gutter with green/red change bars, expandable context, and hunk navigation.

9 commits 21 unit tests 1 real-repo tripwire 7 journeys frame-verified branch feat/diff
Code Review surface rendered

What shipped

Unified review surface

Left file sidebar + per-file collapsible diff blocks in one continuous scroll. Replaces the old Files/Diff tabs; Commits/Markdown stay.

Dracula syntax + word-diff

syntect (two-face grammars) colors the code; the exact changed substring glows brighter inside the muted row tint via similar inline diff.

Gutter, bars & tints

Right-aligned line numbers, a solid green/red left bar on changed lines, and muted green/red full-row backgrounds.

Collapse & expand

Per-file chevron collapse; z reveals hidden context (↕ expand N lines) pulled from the file content.

Hunk & file nav

n/N jump hunks with a Hunk x/y counter; [/] move between files.

Standalone CLI

ainb diff-review [path] opens the same surface for any repo — no session required.

Validation gates

Acceptance / unit  cargo test -p ainb --lib code_review
Real-repo tripwire  cargo test -p ainb --test tripwire_git_review · non-flaky ×3
Visual journeys  7 vhs recordings, each frame-read & asserted
Clippy  new code_review module is clippy-pedantic clean
$ cargo test -p ainb --lib code_review
running 21 tests
test components::code_review::parse::tests::word_emphasis_covers_only_changed_substring ... ok
test components::code_review::highlight::tests::merge_layers_emphasis_bg_over_fg ... ok
test components::code_review::render::tests::surface_renders_title_gutter_bar_and_tints ... ok
test components::code_review::render::tests::expand_context_reveals_lines_and_drops_hidden ... ok
test components::code_review::render::tests::renders_large_diff_within_budget ... ok
test result: ok. 21 passed; 0 failed

$ cargo test -p ainb --test tripwire_git_review
test code_review_surface_renders_real_diff_and_responds_to_keys ... ok
test result: ok. 1 passed; 0 failed  # real git repo → model → render → keys

User journeys · every frame read & verified

J1Open reviewpress the surface up
open
J4Expand contextz reveals hidden lines
expand
J3Collapse fileSpace hides the block
collapse
J5Hunk jumpn advances Hunk x/y
hunk
J6File navigation] moves the selection
filenav
J8ExitEsc returns to the shell
esc

J2 (syntax + word-emphasis) is visible across every frame — note LockedSource, and find_source rendering brighter than their row tint. J7 (Tab cycles Review→Commits→Markdown) is in-session only and is covered by the tripwire.

Commits · feat/diff

8a45246testcover Tab tab-traversal in the review tripwire
4e9bb29testadd Code Review tripwire over a real git repo
41105a5featadd 'ainb diff-review [path]' subcommand
3d4fec1perfcap highlighting on pathological lines + large-diff render test
68ca233featCode Review interactions — collapse, expand, hunk jump, file nav
fec790dfeatrender unified Code Review surface as the default G view
a6a285dfeatDracula syntax-highlight bridge with word-emphasis merge
7683539featstructured Code Review diff model + git/similar parser
96c8b1fchoreadd tmux-verify TUI proof-loop skill

How to use