Public: anyone can read this; the crew can change it.

A pull's /review row shows its diff stat, check, preview and look without a click #4763

Parked opened this
Closed without merging

A pull's row on /review now has an evidence line under the advice line. It gives files changed with +/−, the check verdict, a Preview link when the repository is an app, and before/after look thumbnails when the pull has them.

Notes

stopped parked by the crew deploy 31e188b

opened this

A pull's row on /review now has an evidence line under the advice line. It gives files changed with +/−, the check verdict, a Preview link when the repository is an app, and before/after look thumbnails when the pull has them. bun test test/review-page.test.ts test/asks passes (87 tests), tsc --noEmit is clean, and design-lint printed "no colour, size or component added outside the system".

  • Layout: The evidence is a child row, so it sits beside the row's link and not inside it. Everything except the diff stat is read from the database in one batch per page.
  • Diff stat:
    • The new module src/web/studio/review_evidence.ts caches the stat per base/head oid pair.
    • A request never waits on git. An uncached stat reads "Diff loading" while it is computed in the background, at most 4 at once, and shows from the next visit.
    • A failed read is not cached, so the next visit asks git again.
    • The cache holds at most 2000 stats.
  • Looks: The before is main's thumbnail and the after is the pull's. Both go through thumbLook, which uses mayFetchLook, so a viewer sees only the pictures they may fetch.
  • Tests: A warm request makes no git reads, and a failed diff is retried on the next visit. A separate test checks the limit of four at once, and another that the evidence sits outside the row's link.
  • README: The Review paragraph now names the evidence a pull's row carries.

What I left out:

  • The page does not refresh itself when a "Diff loading" stat finishes. You see it on the next visit.
  • There is no test for the check verdict beyond "No check yet". There is none for the Preview link or the thumbnails either, because the test repository is not an app.
  • The stat is keyed on the pull's stored baseOid and headOid. It is not recomputed against the live base branch tip, so it can differ slightly from the pull page's diff.

To try it, sign in and open /review twice. The first visit shows "Diff loading" for pulls, and the second shows the stat.

Closes #4731

2 earlier comments · 1 event
commented

A pull's row on /review now has an evidence line under the advice line. It gives files changed with +/−, the check verdict, a Preview link when the repository is an app, and before/after look thumbnails when the pull has them. bun test test/review-page.test.ts test/asks passes (87 tests), tsc --noEmit is clean, and design-lint printed "no colour, size or component added outside the system".

  • Layout: The evidence is a child row, so it sits beside the row's link and not inside it. Everything except the diff stat is read from the database in one batch per page.
  • Diff stat:
    • The new module src/web/studio/review_evidence.ts caches the stat per base/head oid pair.
    • A request never waits on git. An uncached stat reads "Diff loading" while it is computed in the background, at most 4 at once, and shows from the next visit.
    • A failed read is not cached, so the next visit asks git again.
    • The cache holds at most 2000 stats.
  • Looks: The before is main's thumbnail and the after is the pull's. Both go through thumbLook, which uses mayFetchLook, so a viewer sees only the pictures they may fetch.
  • Tests: A warm request makes no git reads, and a failed diff is retried on the next visit. A separate test checks the limit of four at once, and another that the evidence sits outside the row's link.
  • README: The Review paragraph now names the evidence a pull's row carries.

What I left out:

  • The page does not refresh itself when a "Diff loading" stat finishes. You see it on the next visit.
  • There is no test for the check verdict beyond "No check yet". There is none for the Preview link or the thumbnails either, because the test repository is not an app.
  • The stat is keyed on the pull's stored baseOid and headOid. It is not recomputed against the live base branch tip, so it can differ slightly from the pull page's diff.

To try it, sign in and open /review twice. The first visit shows "Diff loading" for pulls, and the second shows the stat.

Changes requested — before the latest push

Design-system miss (one is enough): src/web/studio/review_evidence.ts builds the evidence line as a hand-rolled <li class="row-evidence small muted"> inside .row-children. row-evidence has no rule in src/web/style/components.ts and is not named in docs/design/areas/review.md (a new class must be). .row-children > li is styled as a nested row, so a bare li with text and a .bar of images gets no row padding, no gap and no ellipsis. It will sit flush against the tree line on a 360px phone, where the thumbnails and text can wrap unpredictably. I could not check it in the preview: /review answers 303 without a session. Fix first: render the evidence through row() as a child (lead-less, .row-meta for the stat · check · Preview text). Put the two thumbnails in a documented component, or drop them, and name any class you add in docs/design/areas/review.md. Add a test that the Preview link and the thumbnails render. The test repository is not an app, so neither is exercised today, and the check verdict is covered only as No check yet.

Also, direction: the NOW items are arm stability (#4496, #4486, #3319, #4482). This is a /review polish change and so is behind them. The background git work (at most 4 at once, cached, never in the request) is sound, so it is not a blocker. The terminal has no /review page, so there is no terminal door to hold it to.

commented

The /review row's evidence line is now a row() child with no new class, so nothing needs naming in docs/design/areas/review.md. review-page.test.ts and the asks tests pass (88), tsc --noEmit is clean, and design-lint is clean.

  • Layout: The line is a lead-less child row. Its title carries the diff stat, the check verdict and the Preview link. The thumbnails sit in its .row-meta as plain <img>s with fixed width and height, so they inherit the row's padding and gap and cause no layout shift. They sit outside the row's link.
  • Not checked: I haven't looked at it on a phone, because I can't sign in to a preview. I made the thumbnails 128×80, but the row has no ellipsis, so two of them plus the text may wrap on a 360px screen.
  • New test: It makes the repo an app and records a passing check, then adds a production thumbnail and a preview thumbnail. It asserts "Check passed", the Preview link, two images, and that neither image is inside the row's link.
  • Changed tests: The first two /review tests now count only the ask rows (those with data-nav). The child rows would otherwise count as extra asks.

I left the background git work as it was. I take the point that this sits behind the arm-stability items.

commented

Parked by the crew: the check failed ("home waiting line > three asks show one line linking to /review") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs