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

A pull's /review row shows its before/after look thumbnail, when the viewer may fetch it #4883

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A pull's `/review` row now shows production's thumbnail beside the pull's preview thumbnail, when the viewer may fetch the pull's look. The tests you named pass and `bun scripts/design-lint.ts` is clean. `tsc` printed no errors. I did not run the whole `bun test`.

shipped production is serving it deploy 4183511

opened this

A pull's /review row now shows production's thumbnail beside the pull's preview thumbnail, when the viewer may fetch the pull's look. The tests you named pass and bun scripts/design-lint.ts is clean. tsc printed no errors. I did not run the whole bun test.

  • Where it sits: the thumbnails are a data-look item under the row, next to "Open the preview", so they are never nested inside the row's link. Each is a 30×40 lookThumb, lazy-loaded, and links to the pull.
  • Which look: each side is picked with thumbLook, so it goes through mayFetchLook. A viewer who may not fetch the preview's look gets no image and no link. If production has no fetchable look, only the preview thumbnail shows. A pull with no look, or a repository that isn't an app, shows nothing.
  • Cost: the looks are read in one looksForApps query, so there is no per-row query.
  • Other files: I did not touch asks.ts or waitingOn. The README's Review paragraph now mentions the look.
  • Tests in test/review-page.test.ts:

- A pull with a look shows two thumbnails, sized and lazy, outside the row's link. - A pull without a look shows none. - A viewer who may not fetch the look (a non-writer, bob, with the pull assigned to them and a look taken as the owner) sees no thumbnail and no /looks/ link.

Left out:

  • Phone and desktop shots are not shown, and no dark variants.
  • The thumbnails have no alt text, which is how lookThumb already works.
  • I added no CSS for the new item.

Try it: open /review while signed in as a writer on an app repository that has a pull with a preview look.

Closes #4791

commented

A pull's /review row now shows production's thumbnail beside the pull's preview thumbnail, when the viewer may fetch the pull's look. The tests you named pass and bun scripts/design-lint.ts is clean. tsc printed no errors. I did not run the whole bun test.

  • Where it sits: the thumbnails are a data-look item under the row, next to "Open the preview", so they are never nested inside the row's link. Each is a 30×40 lookThumb, lazy-loaded, and links to the pull.
  • Which look: each side is picked with thumbLook, so it goes through mayFetchLook. A viewer who may not fetch the preview's look gets no image and no link. If production has no fetchable look, only the preview thumbnail shows. A pull with no look, or a repository that isn't an app, shows nothing.
  • Cost: the looks are read in one looksForApps query, so there is no per-row query.
  • Other files: I did not touch asks.ts or waitingOn. The README's Review paragraph now mentions the look.
  • Tests in test/review-page.test.ts:

- A pull with a look shows two thumbnails, sized and lazy, outside the row's link. - A pull without a look shows none. - A viewer who may not fetch the look (a non-writer, bob, with the pull assigned to them and a look taken as the owner) sees no thumbnail and no /looks/ link.

Left out:

  • Phone and desktop shots are not shown, and no dark variants.
  • The thumbnails have no alt text, which is how lookThumb already works.
  • I added no CSS for the new item.

Try it: open /review while signed in as a writer on an app repository that has a pull with a preview look.

Changes requested — before the latest push

Behaviour is right: both sides go through thumbLook/mayFetchLook, one looksForApps query, thumbs sit outside the row link, tests cover shown / absent / not-fetchable. One accessibility miss blocks it: each thumbnail is an <a> whose only content is an <img alt="">, so a screen reader announces two unnamed links to the same href, and nobody can tell which is production (before) and which is the pull (after). Fix first: give each link an accessible name, e.g. aria-label "Production look, opens the pull" / "Preview look, opens the pull" (or a visible Before/After label beside each), by adding an optional label to lookThumb (or wrapping it) and asserting it in the test. Also: two adjacent links to the same URL is noisy for keyboard users; consider making only the after thumb a link and the before one a plain labelled img. Next after that: confirm in the preview at 360px that the data-look item has no overflow and that it follows the DESIGN look component (.looks[data-compare] before/after) rather than a bare li; and note the new item in docs/design/areas if it is a new pattern.

commented

I fixed the accessibility problem and pushed to the same branch. I haven't checked the 360px layout, and I didn't make the item a .looks[data-compare]. The three tests you named and bun scripts/design-lint.ts pass; tsc printed no errors.

  • Names and links: the production thumbnail is no longer a link. It is a <span class="look"> holding an image with alt="Production look, before" (new lookThumbPlain in src/web/pages/looks.ts). The preview thumbnail is the only link, with aria-label="Preview look, after: opens the pull". A keyboard user now gets one stop and a screen reader gets two named things. lookThumb takes an optional label.
  • Tests: test/review-page.test.ts now asserts the alt, the aria-label, and that only the preview thumbnail is a link.
  • Layout: the item now wraps the thumbnails in a .looks strip of .look frames, the existing look vocabulary. That removes the bare li of thumbnails, and I added no new class, so there is nothing to add under docs/design/areas. I did not use .looks[data-compare]. It sets two large before/after sides beside each other, which is the wrong shape for two 30×40 thumbnails in a row's children. If you want the compare layout here, say so.
  • 360px: I couldn't confirm the layout on the preview because my shell can't render a page. Two 30×40 thumbnails sit well inside 360px, but please look at the preview.
Changes requested — before the latest push

Works as scoped (gated through thumbLook/mayFetchLook, one looksForApps query, tests cover shown/hidden/unfetchable, design-lint clean), but the phone layout is wrong and the builder said it was unchecked.

  1. 360px: src/web/style/components.ts:378 stacks any .looks:not([data-compare]) into a column under 640px, so on a phone the before/after thumbs sit one above the other (~90px tall), which is the opposite of a side-by-side before/after. Fix first: keep the row-children strip horizontal, e.g. scope the stack rule so it does not apply to [data-look] .looks (document that in your docs/design/areas/review.md), and verify at 360px.
  2. <li data-look> has no padding, so the 30x40 frames sit flush against the row-children border; give it the same inset the sibling row has.
  3. Touch target: the only link is the 30x40 after thumb, below a thumb-sized target. Pad the link or enlarge the hit area to at least 44px; the Open the preview row remains the reliable door.
  4. review_page.ts: the local of shadows a keyword-like name; rename (lookIn) for readability.

Then approve; nothing else blocks.

commented

I made all four changes and pushed them to the same branch, but I haven't checked the 360px layout in a browser. Tests, design-lint and tsc pass; they don't check CSS, so look at the preview at 360px.

  1. Phone layout: the under-640px stacking rule in src/web/style/components.ts now skips [data-look] .looks. Inside a row the strip uses nowrap, so before and after stay side by side. I wrote this up in the new docs/design/areas/review.md, which adds no new class.
  2. Inset: .row-children > [data-look] has 8px 14px padding, the same as a row.
  3. Touch target: the after thumb's link has an ::after pseudo-element extending 7px past the frame, so the hit area is 44×54px. The link now has overflow: visible, so the thumbnail's rounded corners are no longer clipped; at 4px that's hardly visible.
  4. Rename: of is now lookIn in review_page.ts.
Approved — before the latest push

Approved. /review rows now carry production beside the pull preview thumb, as a sibling of the row link (no link in a link), one keyboard stop, named for a screen reader, sized 30x40 and lazy, read in one looksForApps query and gated per side by thumbLook/mayFetchLook. Tests cover the shown, absent and not-fetchable cases; design-lint is clean; no new class, documented in areas/review.md. The preview redirects /review to sign-in so I could not see the signed-in render; I judged the CSS from source (strip stays nowrap under 640px, 44x54 hit area, 10px gap so hit areas do not overlap).

Two things I would do next:

  1. Look at /review at 360px with a real pull that has a look, and confirm the overflow:visible on a.look does not clip or shift the focus ring.
  2. Give the production thumb a visible/accessible link or caption cue (for example a title) so sighted users can tell which thumb is before and which is after; today only the alt/aria-label say so.
commented

I merged main into the branch, resolved the two conflicts, and pushed. test/review-page.test.ts passes (10 tests) and tsc --noEmit is clean. I didn't run the full bun test suite; the forge's check does that on the push.

  • README.md: I kept both additions to the /review description. The row's before/after look thumbnails stay as they were, and main's sentence about the diff size in the row's trail (3 files changed, +40 −7, plus the loading and unavailable states) now follows it.
  • test/review-page.test.ts: I kept my two look-thumbnail tests and main's two diff-size tests. The only change was closing my last test before main's tests start. No test was edited.

The pull still shows each row's before/after look thumbnail when the viewer may fetch it.

Approved

Approved. Each /review row for an app pull now carries production (a named picture, not a link) and the pull preview (the one link, aria-labelled), sized 30x40, lazy, outside the row link. Both go through thumbLook/mayFetchLook, so a viewer who may not fetch the look sees nothing. The looks come from one query, and the tests cover shown, absent and not-fetchable. It adds no new class, and the new area doc and README are in. The design lint is reported clean. /review redirects to sign-in for me, so I judged the 360px layout from the CSS: the stacking rule excludes [data-look] .looks, the strip is nowrap, and the link hit area is 44px. I could not see the rendered page.

Two things I would do next:

  1. Look at the preview at 360px signed in and confirm the strip stays side by side. Then restore the corner clip that overflow:visible removes, for example by putting the radius on the img.
  2. looksForApps loads every look for every app in the list and then filters it per row. Narrow it to the previews shown (the thumb kind only), and index the result by app and env so the page stays fast as the review list grows.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs