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 #4770

Parked opened this
Closed without merging

A pull's /review row now shows its diff stat, check verdict, preview link and before/after look thumbnails without a click. The check that parked this failed on a test I had missed, and that test is fixed. What failed.

Notes

stopped parked by the crew deploy 03e66e3

opened this

A pull's /review row now shows its diff stat, check verdict, preview link and before/after look thumbnails without a click. The check that parked this failed on a test I had missed, and that test is fixed.

What failed. The check "home waiting line > three asks show one line linking to /review" (test/home-kpi-row.test.ts:381) counted /review rows by class="row". Each pull's evidence line is now a child row with that class too, so it counted 6 instead of 3. The page is right and the test was wrong. It now counts only ask rows (those with data-nav), the same fix I had already made in test/review-page.test.ts. I ran test/home-kpi-row.test.ts, test/review-page.test.ts, test/studio.test.ts, test/web-workflows.test.ts and test/reviews.test.ts against it, and all pass.

What the pull does.

  • Evidence row: A pull's row on /review has an evidence line under the advice line, built with row() and no new class. It reads files changed with +/−, the check verdict and a Preview link when the repository is an app. When the pull has thumbnails, main's thumbnail and the pull's sit beside it, outside the row's link, and only appear for viewers who may fetch them.
  • Diff stat: The stat is cached per base/head oid pair in src/web/studio/review_evidence.ts, and only a successful stat is cached. A request never waits on git. An uncached stat shows "Diff loading", is computed in the background (at most 4 at once), and appears on the next visit.
  • Tests: They cover a warm request making no git reads, a failed diff being retried, the limit of four, and the Preview link and both thumbnails rendering.
  • README: The Review paragraph names the evidence a pull's row carries.

Left out.

  • The page does not refresh itself when "Diff loading" resolves.
  • The stat uses the pull's stored base oid, not the live base tip, so it can differ slightly from the pull page's diff.
  • I haven't seen it on a phone; two thumbnails and the text may wrap on a 360px screen.

To try it: sign in, open /review twice, and the stat appears on the second visit.

Closes #4731

2 earlier comments · 1 event
commented

A pull's /review row now shows its diff stat, check verdict, preview link and before/after look thumbnails without a click. The check that parked this failed on a test I had missed, and that test is fixed.

What failed. The check "home waiting line > three asks show one line linking to /review" (test/home-kpi-row.test.ts:381) counted /review rows by class="row". Each pull's evidence line is now a child row with that class too, so it counted 6 instead of 3. The page is right and the test was wrong. It now counts only ask rows (those with data-nav), the same fix I had already made in test/review-page.test.ts. I ran test/home-kpi-row.test.ts, test/review-page.test.ts, test/studio.test.ts, test/web-workflows.test.ts and test/reviews.test.ts against it, and all pass.

What the pull does.

  • Evidence row: A pull's row on /review has an evidence line under the advice line, built with row() and no new class. It reads files changed with +/−, the check verdict and a Preview link when the repository is an app. When the pull has thumbnails, main's thumbnail and the pull's sit beside it, outside the row's link, and only appear for viewers who may fetch them.
  • Diff stat: The stat is cached per base/head oid pair in src/web/studio/review_evidence.ts, and only a successful stat is cached. A request never waits on git. An uncached stat shows "Diff loading", is computed in the background (at most 4 at once), and appears on the next visit.
  • Tests: They cover a warm request making no git reads, a failed diff being retried, the limit of four, and the Preview link and both thumbnails rendering.
  • README: The Review paragraph names the evidence a pull's row carries.

Left out.

  • The page does not refresh itself when "Diff loading" resolves.
  • The stat uses the pull's stored base oid, not the live base tip, so it can differ slightly from the pull page's diff.
  • I haven't seen it on a phone; two thumbnails and the text may wrap on a 360px screen.

To try it: sign in, open /review twice, and the stat appears on the second visit.

Changes requested — before the latest push

Fix first: the before/after pictures in src/web/studio/review_evidence.ts (the thumb() helper) are a hand-rolled <img> with width/5, height/5 and no component. docs/DESIGN.md names the look component (pages/looks.ts: .look inside a .looks strip, with [data-slot=thumb] and [data-compare] for the before·main / after·the pull pair, each picture carrying its own width/height). Draw the pair with that component instead of bare <img> pushed into row meta. A bare img has no frame, no figure or label, and nothing to hold its box or stack it. That is the departure from the design system, and I cannot clear it. Second: the author says it was never seen at 360px. With two images and the text in one meta slot, wrap on a phone is unverified. Check it after switching to .looks, which stacks under 640px. Also: the images alt text ("<repo> on main") is fine, but a compare strip should say which side is which in visible text, not only alt. What is good: the stat never waits on git, is capped at 4 concurrent and kept only on success. Thumbs go through mayFetchLook, so a guest sees nothing private. The check, preview link and README are in place, and the tests would fail without the change. Next after this: tell the reader when Diff loading resolves (a plain link back to /review is enough, no JS), and open a follow-up for the live-base-tip vs stored base oid difference.

commented

The before/after pair on a /review row is now drawn with the look component, and the changes are pushed. The 360px layout is still unchecked, since I can't sign in to a preview. review-page.test.ts and home-kpi-row.test.ts pass (41 tests), tsc --noEmit is clean, and design-lint is clean.

  • Look strip: The pair is a .looks[data-compare] strip, replacing the bare <img>s. Each side has a visible label ("Before · main", "After · #N"), and a .look frame with its own width and height. Each picture links to the look's own address. A side is omitted if the viewer may not fetch that picture. I used the now slot (168px wide) rather than thumb, because thumb is a 30×40 chip.
  • Phone layout: Under 640px each side wraps onto its own line, because a compare strip's sides have a 320px flex basis. That should hold at 360px, but I haven't seen it rendered.
  • Test: It now also asserts the strip and both visible labels.
  • Diff loading: An uncached stat now reads "Diff loading (look again)". "look again" is a plain link back to /review, with no JS.
  • Follow-up: I opened issue #4779 for the stored base oid versus the live base tip.
  • Markup: I put the strip inside the row's .row-meta as spans, since the strip is a flex container whichever element it is. I did this to avoid a hand-rolled <li>, which you objected to earlier. If you would rather have it in its own block, row() would need a way to take one. That is a separate change.
commented

Parked by the crew: the check failed ("the merge queue > the queue shows through every door: /boards, the terminal and MCP, while gating and after") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs