Skip to content

[design-doctor capture-replay replay] clone of sourcebot#2: [design-doctor test] sourcebot-1154: Commit diff viewer#23

Open
rohanneilkapoor wants to merge 14 commits into
bench/source-pr-base/design-doctor-feature-parity-expanded-20260610-152904Z/sourcebot-1154from
bench/design-doctor-capture-replay-20260617-140852/replay/sourcebot-pr2
Open

[design-doctor capture-replay replay] clone of sourcebot#2: [design-doctor test] sourcebot-1154: Commit diff viewer#23
rohanneilkapoor wants to merge 14 commits into
bench/source-pr-base/design-doctor-feature-parity-expanded-20260610-152904Z/sourcebot-1154from
bench/design-doctor-capture-replay-20260617-140852/replay/sourcebot-pr2

Conversation

@rohanneilkapoor

@rohanneilkapoor rohanneilkapoor commented Jun 17, 2026

Copy link
Copy Markdown

Design Doctor capture-replay A/B clone for #2.

Variant: replay (capture-replay ENABLED (CAPTURE_REPLAY_ENABLED=true)).

Reasoning-effort settings are held at branch defaults for both variants, so the only difference is the capture-replay flag.

This branch is pinned to the original PR head SHA so the code contents are equivalent.

Original PR body:

Softlight Overview

Current PR UI

Design Score: 2/5

Suggested fixes

  • Line up the files-changed summary with the commit header and file rows for a cleaner left edge.
  • Align the single-file diff's status row with the file path header above it.
  • Align the file preview banner's left edge with the file path header above it.

Redesign

The commit diff screens had a ragged left edge and a fiddly 'barcode' change meter; this pass lines everything up on one calm edge and swaps the meter for a single clean +/- count and proportion bar.

  • Every commit title, 'files changed' summary, and file row now shares one left edge, so each screen reads as a single calm column.
  • The busy grid of tiny squares is gone, replaced by a clean +/- count with one proportion bar.

Fresh clean test PR for hosted Design Doctor rerun testing.

Benchmark note: Commit diff viewer with full and focused views.

Do not merge. This PR exists so Design Doctor can be run against a clean pull request with no prior review artifacts.

brendan-kellam and others added 14 commits April 28, 2026 10:32
Adds a `commit` pathType to the browse routes
(`/browse/<repo>@<branch>/-/commit/<sha>[/<file>]`) that renders a
placeholder CommitDiffPanel. Refactors browse path helpers into a
discriminated `BrowseProps` union so commitSha is required only for
pathType: 'commit'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wires up @codemirror/merge (via react-codemirror-merge) inside
CommitDiffPanel with a static before/after demo. Adds a CodeDiff
component that owns its language extension + view ref so each pane
can reconfigure its language compartment independently.

Also gates the react-grab dev scripts behind DEBUG_ENABLE_REACT_GRAP
so they don't load on every dev page render.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the CodeMirror MergeView-based commit diff rendering with a DOM
based split-view that renders directly from git's hunks, inspired by
Chrome DevTools' DiffView. Per-file editor instances and the matching
getFileSource fetches are gone — a 50-file commit drops from ~100
network requests to 0, and per-row render cost from a full editor mount
to a synchronous Lezer highlight + grid emit.

- New `LightweightDiffViewer` builds a single 2-column subgrid with
  hunk headers spanning both sides; each cell uses `subgrid` so line
  numbers, markers, and content align across all rows.
- Pure helpers split out: `hunkParser` (body string → DiffLine[]),
  `splitPairing` (DiffLine[] → SplitRow[]).
- `presentableDiff` from @codemirror/merge supplies character-level
  intra-line diff highlighting on paired modifications.
- Lezer highlight code lifted from `lightweightCodeHighlighter` into
  `lib/codeHighlight` so both files share the helper.
- Drop `react-codemirror-merge` and `commitDiffEditor`. Long lines wrap
  via `whitespace-pre-wrap break-words` + `minmax(0, 1fr)` on the grid.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- File path header now sticks to the top of the scroll viewport while
  scrolling through that file's diff, using the negative-yOffset trick
  to compensate for the virtualizer's translateY positioning. Same
  pattern as searchResultsPanel/fileMatchContainer.
- Lightweight diff viewer's grid uses `minmax(<min>, max-content)` for
  line-number and marker columns so they don't collapse to zero width
  when one side of the diff is entirely blank (fully-added or
  fully-deleted files), keeping the right pane aligned across files.
- Drop the column gap between left and right panes and instead draw a
  `border-r` separator on the left cells for a cleaner divider.
- Hunk header gets an optional className so the first hunk renders with
  just `border-b` (the file header above already provides the top
  border), while subsequent hunks render with `border-y` between them.
- Drop the per-row footer padding in the virtualizer; rows now sit
  flush against each other.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- New `DiffStat` component renders GitHub-style additions/deletions
  counts with a 5-square indicator scaled log-ish to total change size.
  Added on the right of each file row header and on the right of the
  "N files changed" subheader for the commit total. Hidden when there
  are no line-level changes (pure renames).
- Each file row gets a `CopyIconButton` next to the path (copies
  newPath, falling back to oldPath) and a `CommitActionLink` that
  opens the file at the commit. Deleted files link to the old path
  at the parent commit so the user lands on the file's last existing
  state rather than a 404.
- `repoName`, `commitSha`, and `parentSha` are plumbed from the panel
  through `FileDiffList` to `FileDiffRow` to support the new link.
- `computeChangeCounts` is memoized per file in the row.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nchoring

History panel rows in both the bottom panel and the commits page are now
clickable — they navigate to the matching commit diff via router.push,
with closest('button, a') short-circuit so inner action buttons keep
their own behavior. Bottom-panel history rows also highlight via
bg-accent when their commit is the one currently being viewed.

Commit diff header now uses AuthorsAvatarGroup + getCommitAuthors +
formatAuthorsText, matching latestCommitInfo and historyRow — co-authors
parsed from the commit body show up correctly.

When the URL trailing path matches one of the commit's files, that file
is moved to the top of the FileDiffList rather than scrolled to. Avoids
estimateSize-based scroll inaccuracy and works regardless of which side
of a rename the URL points to.

Lightweight diff viewer short-circuits with "Diff too large to display"
for files containing lines over 1000 chars, matching the cutoff in
lightweightCodeHighlighter.

PathHeader's breadcrumb measurement reserved 175px for "copy button and
padding"; the actual reservation needed is ~40px. Reduced so breadcrumbs
no longer collapse prematurely on wide layouts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Lift `truncateSha` (was a private helper in getDiffToolComponent) to
  `lib/utils` so PathHeader can reuse it. The branch/ref display now
  renders a 40-char SHA as `abc1234`, preserving any `^` / `~N` suffix.
- Hide the `·` separator and the path's CopyIconButton when there's no
  path (repo root). Previously a dangling `·` and copy button rendered
  with nothing between them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a `path` query/tool parameter to restrict diff output to changes
touching a single file via git's `-- <pathspec>` separator. Refactors
the route handler to use the shared `getDiffRequestSchema`.

Fixes SOU-1154 (sourcebot-dev#1154)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Move single-file commit diffs from `/-/commit/<sha>/<path>` to
  `/-/blob/<path>?ref=<sha>&diff=true`, keeping the user's browsing
  revision in the URL. `/-/commit/<sha>` still renders the full
  multi-file diff.
- New `FocusedCommitDiffPanel` with status row (file status badge +
  authors + relative commit date + "View full commit" + DiffStat +
  exit-X) and path-filtered `getDiff` so only the single file's diff
  is fetched.
- New preview banner in `CodePreviewPanel` when `?ref=` is set, with a
  close button that strips the param.
- Make `PathHeader`'s revision clickable, linking to that ref's full
  commit view.
- New `HoverPrefetchLink` defers Next.js prefetching until hover; used
  in history rows to avoid firing many prefetches on render.
- Hide the bottom panel on `/-/commit/` views.
- Extract `getFileStatus` / `StatusBadge` to a shared `fileStatus.tsx`.
- Workaround Radix Tooltip + RSC re-render bug (drop `asChild` from
  `<TooltipTrigger>`, add `key={commitSha}`) so X / Browse-files
  buttons survive client navigation between commits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
parents={commitResponse.parents}
/>
</div>
<div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">

This comment was marked as outdated.

<AuthorsAvatarGroup authors={authors} />
<span
className="text-sm font-medium"
title={authors.map((a) => a.name).join(", ")}

This comment was marked as outdated.

parents={commitResponse.parents}
/>
</div>
<div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">

This comment was marked as outdated.

path,
pathType: 'blob',
})}
aria-label="Exit diff view"

This comment was marked as outdated.

path,
pathType: 'blob',
})}
aria-label="Close preview"

This comment was marked as outdated.

</span>
<span
className="text-sm text-muted-foreground"
title={absoluteDate}

This comment was marked as outdated.

<div className="flex flex-row items-center gap-2">
<DiffStat {...computeChangeCounts(file)} />
<Tooltip key={commitSha}>
<TooltipTrigger>

This comment was marked as outdated.

<CommitMessage subject={subject} body={commitResponse.body} />
</div>
<Tooltip key={commitSha}>
<TooltipTrigger>

This comment was marked as outdated.

</Link>
</span>
<Tooltip key={previewRef}>
<TooltipTrigger>

This comment was marked as outdated.

parents={commitResponse.parents}
/>
</div>
<div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">

This comment was marked as outdated.

<CommitMessage subject={subject} body={commitResponse.body} />
</div>
<Tooltip key={commitSha}>
<TooltipTrigger>

This comment was marked as outdated.

pathType: 'commit',
commitSha: parent,
})}
className="underline hover:text-foreground"

This comment was marked as outdated.

parents={commitResponse.parents}
/>
</div>
<div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">

This comment was marked as outdated.

)}
</div>
{hasBody && isBodyExpanded && (
<CommitBody body={body} className="rounded max-h-[40vh] overflow-y-auto" />

This comment was marked as outdated.

<CommitMessage subject={subject} body={commitResponse.body} />
</div>
<Tooltip key={commitSha}>
<TooltipTrigger>

This comment was marked as outdated.

parents={commitResponse.parents}
/>
</div>
<div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">

This comment was marked as outdated.

<Separator />
{previewRef && (
<div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">
<span className="text-sm">

This comment was marked as outdated.

@softlight

softlight Bot commented Jun 18, 2026

Copy link
Copy Markdown

Redesign

Full commit diff: one aligned edge and a clean change meter

Full commit diff

Before · After

  • The 'files changed' summary used to sit a few pixels right of the title and file rows; everything now lines up on one left edge.
  • The noisy grid of tiny squares is replaced by a single +/- count and one proportion bar per file.

Single-file diff: a calmer, easier-to-scan toolbar

Single-file diff

Before · After

  • The toolbar was a cramped, run-on line with two competing bold labels; it now breathes and leads with the file's status.
  • Change size, 'View full commit', and the close button are grouped together on the right.

Preview banner: the revision now reads as the key detail

Preview banner

Before · After

  • The banner was one flat line; the revision SHA now stands out while the label stays quiet.
  • A small preview icon and a subtle tint mark it clearly as a temporary preview state.

Expanded message: the description now sits in a tidy card

Expanded message

Before · After

  • The long commit description used to float as indented text; it now sits in a bordered, rounded card aligned under the title.

Commit history: aligned rows with a clear clickable highlight

Commit history

Before · After

  • Rows, date headers, and the toolbar now share the same left edge.
  • Hovering a row clearly highlights it as a link to that commit's diff.
Prompt to build with AI
This is a comment left during a design review.

Goal:
Apply the Designer's pass shown in the before/after references below. Preserve product behavior, routes, data meaning, and the local design system while matching the stronger composition, hierarchy, spacing, alignment, and visual balance.

Before/current PR screenshots:
- Full commit diff page current PR: https://drive.orianna.ai/937c451c41b9e331276cabecf66305f4.png
- Full commit diff page base reference: https://drive.orianna.ai/1c189b8e344a7046c29fcdd90dd6a83a.png
- Full commit diff with commit body expanded current PR: https://drive.orianna.ai/b87866d8b9fb5e8fc1475a190a8586ea.png
- Full commit diff with commit body expanded base reference: https://drive.orianna.ai/67f2004ecae31850e8a2a6b84057f02e.png
- Focused single-file commit diff current PR: https://drive.orianna.ai/4175e7c88152ad44e660f59ee1b89877.png
- Focused single-file commit diff base reference: https://drive.orianna.ai/9e27a62c6502e83a5791074841d84288.png
- File preview banner at revision current PR: https://drive.orianna.ai/c9759fe8f39df649a880ff5108a94c45.png
- File preview banner at revision base reference: https://drive.orianna.ai/76e3acf73a06bdb7c707c2a75a1e7788.png
- Commit history list with clickable rows current PR: https://drive.orianna.ai/d40d5e5e34ea8e1c3a7f6886a35f1cfc.png
- Commit history list with clickable rows base reference: https://drive.orianna.ai/bd673d2975a8abf581eac0ace1ffee08.png

After/Designer's pass screenshots:
- Full commit diff page prototype: https://drive.orianna.ai/22a917a6731a1cbb1dee09d93181ca4b.png
- Focused single-file commit diff prototype: https://drive.orianna.ai/7d39e2e43c64babdb06bfd0ab2b4068b.png
- File preview banner at revision prototype: https://drive.orianna.ai/0dc51090e48cc1ac764cfd5f4cc05710.png
- Full commit diff with commit body expanded prototype: https://drive.orianna.ai/8bcaeafa516af572db2e42e36a72cc9b.png
- Commit history list with clickable rows prototype: https://drive.orianna.ai/f4dd2e3ffde057132bb79a7f81e261dc.png

Context:
The commit diff views felt cramped and slightly off: the 'files changed' bar didn't line up with the commit title or file rows, a fiddly grid of tiny squares tried to show how much each file changed, and the single-file toolbar and preview banner ran their details together at one weight. This pass puts everything on a consistent, roomier left edge, swaps the squares for one clean +/- count and proportion bar, and gives the toolbars and banner a clear hierarchy so the important detail (the file, the revision, the change size) stands out at a glance.

What the Designer's pass changed:
- Full commit diff: the 'N files changed' bar used to sit a few pixels right of the title and file rows. Now the title, summary, and every file row line up on one edge, and each file's change size reads as a clean +/- count with a single proportion bar instead of a row of tiny squares.
- Single-file diff: the toolbar was a cramped, run-on line with two competing bold labels. It now breathes, leads with the file's status, keeps the author and date quiet, and groups the change size, 'View full commit', and close button together on the right.
- Preview banner: 'Previewing file at revision <sha>' was one flat line. The revision now stands out as the key detail, with a quiet label and a small preview icon on a subtle strip.
- Expanded commit message: the long description used to float as indented text. It now sits in a tidy bordered card aligned under the title.
- Commit history: rows, date headers, and the toolbar now share the same left edge, and hovering a row clearly highlights it as a link to that commit.

Use the before screenshots to understand the current surface and the after screenshots as the target direction. Make the smallest coherent set of source changes that gets the existing app to that visual result, then render and inspect the UI before stopping.
Developer output

Real app context

Target Base before PR PR before polish
Full commit diff page Base before PR PR before polish
Full commit diff with commit body expanded Base before PR PR before polish
Focused single-file commit diff Base before PR PR before polish
File preview banner at revision Base before PR PR before polish
Commit history list with clickable rows Base before PR PR before polish

Prototype details

Calm, aligned commit-diff surfaces

Matched before/after

Full commit diff page

Calm, aligned commit-diff surfaces - Full commit diff page

Focused single-file commit diff

Calm, aligned commit-diff surfaces - Focused single-file commit diff

File preview banner at revision

Calm, aligned commit-diff surfaces - File preview banner at revision

Full commit diff with commit body expanded

Calm, aligned commit-diff surfaces - Full commit diff with commit body expanded

Commit history list with clickable rows

Calm, aligned commit-diff surfaces - Commit history list with clickable rows

Prototype screenshot
Full commit diff page
Full commit diff page
Focused single-file commit diff
Focused single-file commit diff
File preview banner at revision
File preview banner at revision
Full commit diff with commit body expanded
Full commit diff with commit body expanded
Commit history list with clickable rows
Commit history list with clickable rows

Status: partial.

Changed files

  • packages/web/src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.tsx
  • packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/commitMessage.tsx
  • packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/diffStat.tsx
  • packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/fileDiffRow.tsx
  • packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/focusedCommitDiffPanel.tsx
  • packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/fullCommitDiffPanel.tsx
  • packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/lightweightDiffViewer.tsx
  • packages/web/src/app/(app)/browse/[...path]/components/commitHistoryPanel/commitRow.tsx
  • packages/web/src/app/(app)/browse/[...path]/components/commitHistoryPanel/commitsPanel.tsx
  • packages/web/src/app/(app)/browse/components/commitParts.tsx
Prototype diff excerpt
diff --git a/packages/web/src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.tsx b/packages/web/src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.tsx
index bad7e67c..8e522ec2 100644
--- a/packages/web/src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.tsx
+++ b/packages/web/src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.tsx
@@ -4,7 +4,7 @@ import { Button } from "@/components/ui/button";
 import { Separator } from "@/components/ui/separator";
 import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
 import { cn, getCodeHostInfoForRepo, isServiceError, truncateSha } from "@/lib/utils";
-import { X } from "lucide-react";
+import { Eye, X } from "lucide-react";
 import Image from "next/image";
 import Link from "next/link";
 import { getBrowsePath } from "../../../hooks/utils";
@@ -54,7 +54,7 @@ export const CodePreviewPanel = async ({ path, repoName, revisionName, previewRe
 
     return (
         <>
-            <div className="flex flex-row py-1 px-2 items-center justify-between">
+            <div className="flex flex-row px-4 py-2 items-center justify-between">
                 <PathHeader
                     path={path}
                     repo={{
@@ -85,9 +85,10 @@ export const CodePreviewPanel = async ({ path, repoName, revisionName, previewRe
             </div>
             <Separator />
             {previewRef && (
-                <div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">
-                    <span className="text-sm">
-                        Previewing file at revision{" "}
+                <div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b bg-muted/40 shrink-0">
+                    <span className="flex flex-row items-center gap-2 text-sm text-muted-foreground">
+                        <Eye className="h-4 w-4 flex-shrink-0" />
+                        Previewing file at revision
                         <Link
                             href={getBrowsePath({
                                 repoName,
diff --git a/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/commitMessage.tsx b/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/commitMessage.tsx
index 7d9a27d4..908c7b83 100644
--- a/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/commitMessage.tsx
+++ b/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/commitMessage.tsx
@@ -24,7 +24,10 @@ export const CommitMessage = ({ subject, body }: CommitMessageProps) => {
                 )}
             </div>
             {hasBody && isBodyExpanded && (
-                <CommitBody body={body} className="rounded max-h-[40vh] overflow-y-auto" />
+                <CommitBody
+                    body={body}
+                    className="mt-1 rounded-md border max-h-[40vh] overflow-y-auto"
+                />
             )}
         </>
     );
diff --git a/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/diffStat.tsx b/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/diffStat.tsx
index b30b6567..b2828ffd 100644
--- a/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/diffStat.tsx
+++ b/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/diffStat.tsx
@@ -1,7 +1,5 @@
 import { FileDiff } from "@/features/git";
 
-const TOTAL_SQUARES = 5;
-
 // Count `+`/`-` lines across all hunks in a file.
 export const computeChangeCounts = (file: FileDiff) => {
     let additions = 0;
@@ -30,28 +28,6 @@ export const computeTotalChangeCounts = (files: FileDiff[]) => {
     return { additions, deletions };
 };
 
-// Map a total change count to a number of filled squares (0–5) using a
-// log-ish scale so tiny diffs still show one square and huge diffs cap out.
-// Mirrors GitHub's diffstat indicator behavior.
-const filledSquaresForTotal = (total: number): number => {
-    if (total === 0) {
-        return 0;
-    }
-    if (total < 5) {
-        return 1;
-    }
-    if (total < 10) {
-        return 2;
-    }
-    if (total < 30) {
-        return 3;
-    }
-    if (total < 100) {
-        return 4;
-    }
-    return 5;
-};
-
 interface DiffStatProps {
     additions: number;
     deletions: number;
@@ -65,33 +41,33 @@ export const DiffStat = ({ additions, deletions }: DiffStatProps) => {
         return null;
     }
 
-    const filled = filledSquaresForTotal(total);
-    const greenCount = Math.round((filled * additions) / total);
-    const redCount = filled - greenCount;
-    const emptyCount = TOTAL_SQUARES - filled;
-
     return (
         <div
-            className="flex flex-row items-center gap-2 text-xs flex-shrink-0 font-mono"
+            className="flex flex-row items-center gap-2.5 text-xs flex-shrink-0 font-mono tabular-nums"
             title={`${additions} additions, ${deletions} deletions`}
         >
             {additions > 0 && (
-                <span className="text-green-700 dark:text-green-400">+{additions}</span>
+                <span className="text-green-600 dark:text-green-400">+{additions}</span>
             )}
             {deletions > 0 && (
-                <span className="text-red-700 dark:text-red-400">-{deletions}</span>
+                <span className="text-red-600 dark:text-red-400">-{deletions}</span>
             )}
-            <div className="flex flex-row gap-px">
-                {Array.from({ length: greenCount }).map((_, i) => (
-                    <span key={`g-${i}`} className="w-2 h-2 bg-green-500 dark:bg-green-400 rounded-[1px]" />
-                ))}
-                {Array.from({ length: redCount }).map((_, i) => (
-                    <span key={`r-${i}`} className="w-2 h-2 bg-red-500 dark:bg-red-400 rounded-[1px]" />
-                ))}
-                {Array.from({ length: emptyCount }).map((_, i) => (
-                    <span key={`e-${i}`} className="w-2 h-2 bg-border rounded-[1px]" />
-                ))}
-            </div>
+            {/* A single proportion bar: one calm pill split green/red by the
+                add:delete ratio, instead of a row of discrete squares. */}
+            <span className="flex h-1.5 w-10 overflow-hidden rounded-full bg-muted">
+                {additions > 0 && (
+                    <span
+                        className="bg-green-500 dark:bg-green-400"
+                        style={{ width: `${(additions / total) * 100}%` }}
+                    />
+                )}
+                {deletions > 0 && (
+                    <span
+                        className="bg-red-500 dark:bg-red-400"
+                        style={{ width: `${(deletions / total) * 100}%` }}
+                    />
+                )}
+            </span>
         </div>
     );
 };
diff --git a/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/fileDiffRow.tsx b/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/fileDiffRow.tsx
index d7c5c50e..5e84797a 100644
--- a/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/fileDiffRow.tsx
+++ b/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/fileDiffRow.tsx
@@ -58,7 +58,7 @@ export const FileDiffRow = ({ file, yOffset, repoName, commitSha, parentSha }: F
     return (
         <div className="flex flex-col">
             <div
-                className="flex flex-row items-center gap-2 py-2 px-3 border-b bg-muted sticky z-10"
+                className="flex flex-row items-center gap-2 py-2 px-4 border-b bg-muted sticky z-10"
                 style={{ top: `-${yOffset}px` }}
             >
                 <StatusBadge status={status} />
diff --git a/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/focusedCommitDiffPanel.tsx b/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/focusedCommitDiffPanel.tsx
index 308ab9f6..1408732e 100644
--- a/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/focusedCommitDiffPanel.tsx
+++ b/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/focusedCommitDiffPanel.tsx
@@ -101,7 +101,7 @@ export const FocusedCommitDiffPanel = async ({
 
     return (
         <div className="flex flex-col h-full">
-            <div className="flex flex-row py-1 px-2 items-center border-b shrink-0">
+            <div className="flex flex-row px-4 py-2 items-center border-b shrink-0">
                 <PathHeader
                     path={path}
                     pathType="blob"
@@ -116,27 +116,23 @@ export const FocusedCommitDiffPanel = async ({
             </div>
             {file ? (
                 <>
-                    <div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">
-                        <div className="flex flex-row items-center gap-2">
+                    <div className="flex flex-row items-center justify-between gap-3 px-4 py-2 border-b shrink-0">
+                        <div className="flex flex-row items-center gap-2 min-w-0">
                             <StatusBadge status={getFileStatus(file)} />
                             <h2 className="text-sm font-medium">
                                 {FILE_STATUS_LABELS[getFileStatus(file)]}
                             </h2>
-                            <span className="text-sm text-muted-foreground">by</span>
+                            <span className="text-muted-foreground">·</span>
                             <AuthorsAvatarGroup authors={authors} />
                             <span
-                                className="text-sm font-medium"
-                                title={authors.map((a) => a.name).join(", ")}
+                                className="text-sm text-muted-foreground truncate"
+                                title={`${authors.map((a) => a.name).join(", ")} · ${absoluteDate}`}
                             >
-                                {formatAuthorsText(authors)}
+                                {formatAuthorsText(authors)} committed {relativeDate}
                             </span>
-                            <span
-                                className="text-sm text-muted-foreground"
-                                title={absoluteDate}
-                            >
-                                {relativeDate}
-                            </span>
-                            <span className="text-muted-foreground">·</span>
+                        </div>
+                        <div className="flex flex-row items-center gap-3 flex-shrink-0">
+                            <DiffStat {...computeChangeCounts(file)} />
                             <Link
                                 href={getBrowsePath({
                                     repoName,
@@ -145,13 +141,10 @@ export const FocusedCommitDiffPanel = async ({
                                     pathType: 'commit',
                                     commitSha,
                                 })}
-                                className="text-sm text-link hover:underline"
+                                className="text-sm text-link hover:underline whitespace-nowrap"
                             >
                                 View full commit
                             </Link>
-                        </div>
-                        <div className="flex flex-row items-center gap-2">
-                            <DiffStat {...computeChangeCounts(file)} />
                             <Tooltip key={commitSha}>
                                 <TooltipTrigger>
                                     <Button
diff --git a/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/fullCommitDiffPanel.tsx b/packages/web/src/app/(app)/browse/[...path]/components/commitDiffPanel/fullCommitDiffPanel.

Remaining issues

  • On the preview surface, the left file-tree panel shows 'Error loading file tree.' This is environmental: the test repo only has a 'master' branch while the preview route uses '@main', so the tree/commits APIs 500. It matches the original before-capture and is outside the redesigned surface.
  • Large empty space below the focused/preview diff is a property of the tiny test file (calculator.py), not a layout flaw; a real repository fills it.
  • The designer's pass agent did not Read every required base/PR screenshot before reporting.

Cost

Claude Code reported cost: $55.0280

Claude Code session costs and timings
Session Cost Duration API time API turns Tool calls
classifier
80714a4c-8c33-40d2-a22d-99b893b73fca
$0.4366 6.4s 6.3s 0 1
StructuredOutput
plan
fcf9cc6d-af9f-4826-89c3-fceddcba14fc
$0.6249 1m 20s 1m 20s 0 4
Bash, StructuredOutput
capture: Full commit diff page (before)
2f35b45b-dee5-4786-8556-b588b2039470
$1.6436 3m 10s 2m 50s 0 28
Bash, Edit, Read, ToolSearch, Write, ...
capture: Full commit diff with commit body expanded (before)
6a5c8773-ce98-40bc-a79c-f2c6d7b7ede3
$1.9621 3m 48s 3m 29s 0 39
Bash, Edit, Read, ToolSearch, Write, ...
capture: Focused single-file commit diff (before)
d5f4a9f0-396b-4f49-9538-393f227be0b7
$1.4081 3m 12s 2m 55s 0 28
Bash, Edit, Read, ToolSearch, Write, ...
capture: File preview banner at revision (before)
9c96364b-8988-46cb-9ad0-da58f9d466f3
$1.3855 2m 51s 2m 34s 0 28
Bash, Edit, Read, ToolSearch, Write, ...
capture: Commit history list with clickable rows (before)
4a8ee774-98b6-4e22-9055-4afc5480b6c9
$1.5718 3m 15s 2m 54s 0 33
Bash, Edit, Read, ToolSearch, Write, ...
capture: all base screenshots (5 targets)
95dd77f0-d6b7-4bc5-8499-d31f4ddd5e84
$3.3949 7m 15s 6m 42s 0 57
Bash, Edit, Read, ToolSearch, Write, ...
capture: all base screenshots (5 targets)
131ee7b1-6fd4-413c-9abb-225dc9679064
$1.8105 2m 31s 2m 30s 0 6
Bash, Edit, Read
capture: all base screenshots (5 targets)
191da28c-5bdb-4430-a76a-f501f97809d8
$5.2792 9m 19s 8m 46s 0 46
Bash, Edit, Read, ToolSearch, Write, ...
coverage
0c3ec46d-a805-4a7e-8b0d-a411ffc9c51c
$0.8033 1m 07s 1m 07s 0 2
Bash, StructuredOutput
validate
57c18307-203d-49f2-809a-67e48edfa1cc
$0.8733 45.9s 45.8s 0 1
StructuredOutput
design audit
903c18a5-1ec8-41c3-8ad8-d6892cd3b1e4
$1.6708 4m 53s 4m 53s 0 5
Bash, StructuredOutput
spacing audit
15368212-f126-4ecf-962d-a4e116da4d07
$1.7037 4m 54s 4m 54s 0 7
Bash, Read, StructuredOutput
polish change grouping
5d5f3d1a-46f3-4f15-b97c-91b8a9fd37e7
$0.2298 11.2s 11.1s 0 1
StructuredOutput
apply polish
23c13ceb-6c62-44d2-a974-7dbbad8b955a
$0.8599 1m 52s 1m 38s 0 22
Bash, Edit, Read, Skill, Write, ...
capture: Full commit diff page (after)
e9c4c1a7-d16d-458f-afac-14286e5d139e
$3.9547 9m 12s 7m 40s 0 62
Bash, Edit, Read, ToolSearch, Write, ...
evidence cropper
4d94c682-6b69-4992-afd5-f935e31ea134
$0.5135 45.6s 43.7s 0 12
Bash, Read, StructuredOutput
apply polish
db793a1a-ddc4-41f7-a1c5-2f9e6b67d43d
$1.3099 2m 43s 2m 09s 0 28
Bash, Edit, Read, Skill, ToolSearch, ...
capture: Focused single-file commit diff (after)
4d6fe7af-ddb4-4b3f-9dd3-47b2cae427c7
$1.9615 4m 17s 3m 55s 0 31
Bash, Edit, Read, ToolSearch, Write, ...
evidence cropper
d05d7238-f0a4-4226-ab9e-348499a16840
$0.5120 49.2s 47.6s 0 11
Bash, Read, StructuredOutput
apply polish
f06c143b-0433-4bd1-852e-5dd65cfed1f9
$1.0310 2m 33s 1m 58s 0 26
Bash, Edit, Read, Skill, ToolSearch, ...
apply polish
da001022-2144-4ecf-9c4c-944bf94620df
$1.2181 2m 19s 2m 00s 0 27
Bash, Edit, Read, Skill, ToolSearch, ...
capture: File preview banner at revision (after)
07571d4d-9b3b-481a-b7fd-2d8a19286140
$1.5586 4m 41s 3m 28s 0 27
Bash, Edit, Read, Write, mcp__playwright__browser_evaluate, ...
evidence cropper
9e20d639-0397-4571-b448-99924fac1660
$0.4871 55.6s 52.1s 0 13
Bash, Read, StructuredOutput
designer explore
5c823cab-81d0-4af4-815a-404330f0345d
$16.8236 27m 26s 26m 27s 0 167
Bash, Edit, Read, Skill, Write, ...

parents={commitResponse.parents}
/>
</div>
<div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Before/after suggested changes

Files-changed summary sits indented from the rest of the commit view

On the commit view, the "files changed" summary line is nudged inward from the commit details above it and the file rows below it, so the left edge steps in and back out as you scan down. Aligning it makes the page feel cleaner and easier to read.

Prompt to fix with AI
This is a comment left during a design review.

Comment:
**Files-changed summary sits indented from the rest of the commit view**
On the commit view, the "files changed" summary line is nudged inward from the commit details above it and the file rows below it, so the left edge steps in and back out as you scan down. Aligning it makes the page feel cleaner and easier to read.

Issue:
The "{n} files changed" bar is rendered with className "flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0" (16px horizontal padding) at fullCommitDiffPanel.tsx:113, while the commit header block above uses p-3 (12px) and each file-diff row header below uses py-2 px-3 (12px).

Suggested fix:
Change the summary bar's px-4 to px-3 in fullCommitDiffPanel.tsx so its left edge aligns with the p-3 commit header above and the px-3 file-row headers below.

Screenshots:
- Before: https://drive.orianna.ai/35f7a07bcf7809d609c4799b8c25f73e.png
- After: https://drive.orianna.ai/dae43e7ff974a0b0b600241ad515fcfb.png
Use these screenshot URLs as visual evidence if your environment can open remote images.

How can I resolve this? Keep the fix scoped to the PR-touched UI and preserve existing design-system patterns.
Developer output
  • Crop source: goal crop locator
  • Before crop: x1=280, y1=95, x2=780, y2=265
  • After crop: x1=280, y1=95, x2=780, y2=265

Gridded crops

Before

Before gridded detail

After

After gridded detail

Full gridded screenshots

Before

Before full gridded screenshot

After

After full gridded screenshot

</div>
{file ? (
<>
<div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Before/after suggested changes

Single-file diff status row is indented from the file path above it

In the focused single-file diff, the row showing the change status, author, and commit link starts further in than the file path header directly above it, so the left edge steps inward. Aligning them makes the header feel more deliberate.

Prompt to fix with AI
This is a comment left during a design review.

Comment:
**Single-file diff status row is indented from the file path above it**
In the focused single-file diff, the row showing the change status, author, and commit link starts further in than the file path header directly above it, so the left edge steps inward. Aligning them makes the header feel more deliberate.

Issue:
The meta bar at focusedCommitDiffPanel.tsx:119 uses px-4 py-2 border-b (16px), while the PathHeader row directly above it uses py-1 px-2 (8px) and the diff content below has no left gutter padding.

Suggested fix:
Reduce the meta bar's px-4 toward the surrounding rows (px-3, or px-2 to match the path-header row) in focusedCommitDiffPanel.tsx so the stacked header bars share a left edge.

Screenshots:
- Before: https://drive.orianna.ai/ceb281c1e9407eb632572b3b1936333c.png
- After: https://drive.orianna.ai/f19cd6dbf1f80c2b08e28da73f831bba.png
Use these screenshot URLs as visual evidence if your environment can open remote images.

How can I resolve this? Keep the fix scoped to the PR-touched UI and preserve existing design-system patterns.
Developer output
  • Crop source: goal crop locator
  • Before crop: x1=0, y1=48, x2=760, y2=132
  • After crop: x1=0, y1=48, x2=760, y2=132

Gridded crops

Before

Before gridded detail

After

After gridded detail

Full gridded screenshots

Before

Before full gridded screenshot

After

After full gridded screenshot

</div>
<Separator />
{previewRef && (
<div className="flex flex-row items-center justify-between gap-2 px-4 py-2 border-b shrink-0">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Before/after suggested changes

Preview banner is indented from the file path above it

When previewing a file at an older revision, the preview banner starts further in than the file path header directly above it, so the left edge steps inward. Aligning the banner makes the preview feel tidier.

Prompt to fix with AI
This is a comment left during a design review.

Comment:
**Preview banner is indented from the file path above it**
When previewing a file at an older revision, the preview banner starts further in than the file path header directly above it, so the left edge steps inward. Aligning the banner makes the preview feel tidier.

Issue:
The preview banner at codePreviewPanel.tsx:88 uses px-4 py-2 border-b (16px), while the PathHeader row above it uses py-1 px-2 (8px) and the code content below starts at the left gutter.

Suggested fix:
Reduce the preview banner's px-4 toward the surrounding rows (px-2 to match the path-header row, or px-3 for the section-bar convention) in codePreviewPanel.tsx so the stacked rows share a left edge.

Screenshots:
- Before: https://drive.orianna.ai/32bf55bd9b4493ffad77bd597a489c53.png
- After: https://drive.orianna.ai/a714c0b225644509abd9fa531da54565.png
Use these screenshot URLs as visual evidence if your environment can open remote images.

How can I resolve this? Keep the fix scoped to the PR-touched UI and preserve existing design-system patterns.
Developer output
  • Crop source: goal crop locator
  • Before crop: x1=280, y1=48, x2=760, y2=135
  • After crop: x1=280, y1=48, x2=760, y2=135

Gridded crops

Before

Before gridded detail

After

After gridded detail

Full gridded screenshots

Before

Before full gridded screenshot

After

After full gridded screenshot

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