Skip to content

feat(review): highlight the code view and keep it readable in any pane width - #820

Merged
astyfx merged 2 commits into
mainfrom
feat/review-syntax
Oct 25, 2026
Merged

astyfx merged 2 commits into
mainfrom
feat/review-syntax

Conversation

@astyfx

@astyfx astyfx commented Oct 24, 2026

Copy link
Copy Markdown
Member

Summary

Review's code view showed plain text, rendered every unchanged line of a file, and could not be scrolled past the first screen once the pane was narrower than the stacked breakpoint. This makes it read like the chat's file diffs and keeps it usable at any width.

Changes

Review code view (src/components/review/*)

  • Syntax highlighting with the shared highlighter; it starts loading while the scope's files are read, and a later file paints in color on its first render.
  • Unchanged runs collapse to three lines of context behind Expand.
  • File header: path (directory truncates first), change kind, +N −M, "Renamed from …"; it stays pinned while the diff scrolls, and the comment action never shrinks.
  • Switching files starts the diff at its top.
  • At or below the three-region stacked breakpoint (980px) the layout scrolls instead of clipping. Before this, layoutHost's overflow: hidden left everything past the first screen unreachable; this was the case since feat(review): show the task's run over Review and open side questions there #815.

ADS DiffViewer (host-owned copy, recorded in PROVENANCE.md)

  • diffLines sets the common head and tail aside before the LCS table. A one-line edit to a 10,000-line file takes about 2 ms instead of 804 ms and ~860 MB, with identical output. A changed middle above MAX_LCS_CELLS renders as removed then added.
  • The line-number gutter is sized by the longest line number and is never narrower than the original 2rem: 4- and 5-digit numbers keep an 8px gap instead of about 3px or overlapping.
  • After Expand, focus moves to the first revealed line instead of the document body.

The chat's file diffs share the DiffViewer and highlighter changes.

Verification

  • bun run build:pages: passed
  • oxlint, bun run typecheck, check:i18n, check:design-system, check:style-channel, check:max-lines-ratchet, check:doc-paths, codebase-structure: all exit 0
  • Unit: 75 pass across 7 files, including new diff engine tests (large one-line edit, cell cap fallback, randomized round-trip of both sides and line numbers) and a gutter width test
  • E2E: review-code-view (new), review-while-running, review-entry-points: 13 passed. The three new tests fail when their fixes are reverted (narrow scroll, focus after Expand, unclipped comment label).
  • Rendered checks in the dev preview: dark at 1280/893/420px and light at 1280px. Header pinned flush at all widths, last line reachable when stacked, gutter 32/38.9/46.1px for 3/4/5 digits.

Not verified: the keyboard focus ring drawn after Expand (focus placement is covered by e2e), and the packaged Electron app.

🤖 Generated with Claude Code

astyfx and others added 2 commits October 25, 2026 02:22
- diffLines sets the common head and tail aside before the LCS table, so a
  one-line edit to a 10,000-line file takes about 2 ms instead of 800 ms and
  ~860 MB; a changed middle above MAX_LCS_CELLS renders as removed then added.
- The line-number gutter is sized by the longest line number (never narrower
  than 2rem), so four- and five-digit numbers no longer run into each other.
- After Expand, focus moves to the first revealed line instead of the body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e width

- The diff is syntax highlighted with the shared highlighter, collapses
  unchanged runs to three lines of context, and has a per-file name.
- The file header shows the path, change kind, line counts and rename, stays
  pinned while the diff scrolls, and never squeezes its comment action.
- Switching files starts the diff at its top; the highlighter loads while the
  scope is read.
- Below the stacked breakpoint the layout scrolls instead of clipping the
  diff after the first screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@astyfx
astyfx requested a review from a team as a code owner October 24, 2026 17:24
@astyfx
astyfx requested review from JongSikLim and paul-seo73 and removed request for a team October 24, 2026 17:24
@upwind-code-us

upwind-code-us Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Upwind Upwind IaC Scan - ✅ Passed

0 newly introduced misconfigurations · 0 resolved · 0 total in this PR vs main

View full analysis in Upwind Console →

Scan completed in 3s

Scan history (1 scan)
Commit Scanned at New Resolved Net
68ad75e < 2026-10-24 17:24 UTC 0 0 0

Last scanned: 68ad75e · 2026-10-24 17:24 UTC

@heath-s heath-s left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@astyfx
astyfx merged commit 0309f4d into main Oct 25, 2026
6 checks passed
@astyfx
astyfx deleted the feat/review-syntax branch October 25, 2026 01:22
@astyfx astyfx mentioned this pull request Oct 25, 2026
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.

2 participants