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

/explore shows each app's latest picture as a fixed-size thumbnail beside its name #14731

Merged opened this

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

Merged

Each app row on /explore now leads with a fixed 48×48 box, so rows don't shift when pictures load. The tests I ran pass: explore-picture, explore-budget and explore-first-view, plus the fork, page and make-it-yours explore tests; tsc and design-lint are clean.

Notes

shipped production is serving it deploy 404563e

opened this

Each app row on /explore now leads with a fixed 48×48 box, so rows don't shift when pictures load. The tests I ran pass: explore-picture, explore-budget and explore-first-view, plus the fork, page and make-it-yours explore tests; tsc and design-lint are clean. I did not run the full suite, and scripts/gate.ts reports no unmet rule.

What changed

  • With a look: the box is the app's newest public production look of its home page, a thumb or else a phone shot. It is lazy-loaded, with the app's name as alt text (escaped by the html template).
  • Without one: an app with no look, a private app, or one whose only look was taken as the owner gets a neutral box with the first letter of its name. The initial is taken from the full owner/name label, so every app shows its owner's letter.
  • One query: src/looks/explore_pictures.ts (exploreThumbs) reads every thumbnail for the page in a single query. That includes the forks folded under a row. It reads only public apps and pictures taken as nobody, so every viewer gets the same answer.
  • Wiring: src/web/studio/explore.ts passes the picture into the existing row's lead slot. People and forges have no box.
  • Docs: the CSS (.ex-pic) is in components.ts, with a note in docs/design/areas/explore.md and docs/features/explore.md.
  • Tests: test/explore-picture.test.ts covers a look, no look, private, an owner-only look, escaped alt text, and one query.

One existing test changed. test/explore-first-view.test.ts capped a row's markup at 520 bytes. The picture box adds about 100 bytes, so I raised the cap to 620 with a comment. The 10 KB gzip cap still holds.

Not done

  • Terminal: the explore list there has no pictures, and the commit says No door.
  • Shared helper: I did not look for the #14558 thumbnail helper to share. /templates can reuse exploreThumbs when it lands.
  • Local page check: I did not render a real picture in a browser. The test only checks the <img> markup.
  • Old thumbs: the image route also checks keepLook for thumbs. I did not check whether that can reject a thumb marked as taken by nobody; if it can, that picture would show as a broken image.
  • Gate fix-up: the first push missed three required commit lines, so a second, empty commit adds Try: and Direction:. It also repeats Looks: and the gate still names /explore.

To try: open /explore?q=kind:app on the preview. Apps with a production look show a thumbnail and the rest show an initial box.

[
  {"go":"/explore?q=kind:app","look":"each app row starts with a 48px square","expect":"a picture for apps with a public production look, a box with the owner's letter for the rest; no row jumps as images load"},
  {"go":"/explore?q=kind:app","look":"open a row's forks","expect":"forks have the same box"}
]

Closes #14560

7 earlier comments · 1 event
commented

Each app row on /explore now leads with a fixed 48×48 box, so rows don't shift when pictures load. The tests I ran pass: explore-picture, explore-budget and explore-first-view, plus the fork, page and make-it-yours explore tests; tsc and design-lint are clean. I did not run the full suite, and scripts/gate.ts reports no unmet rule.

What changed

  • With a look: the box is the app's newest public production look of its home page, a thumb or else a phone shot. It is lazy-loaded, with the app's name as alt text (escaped by the html template).
  • Without one: an app with no look, a private app, or one whose only look was taken as the owner gets a neutral box with the first letter of its name. The initial is taken from the full owner/name label, so every app shows its owner's letter.
  • One query: src/looks/explore_pictures.ts (exploreThumbs) reads every thumbnail for the page in a single query. That includes the forks folded under a row. It reads only public apps and pictures taken as nobody, so every viewer gets the same answer.
  • Wiring: src/web/studio/explore.ts passes the picture into the existing row's lead slot. People and forges have no box.
  • Docs: the CSS (.ex-pic) is in components.ts, with a note in docs/design/areas/explore.md and docs/features/explore.md.
  • Tests: test/explore-picture.test.ts covers a look, no look, private, an owner-only look, escaped alt text, and one query.

One existing test changed. test/explore-first-view.test.ts capped a row's markup at 520 bytes. The picture box adds about 100 bytes, so I raised the cap to 620 with a comment. The 10 KB gzip cap still holds.

Not done

  • Terminal: the explore list there has no pictures, and the commit says No door.
  • Shared helper: I did not look for the #14558 thumbnail helper to share. /templates can reuse exploreThumbs when it lands.
  • Local page check: I did not render a real picture in a browser. The test only checks the <img> markup.
  • Old thumbs: the image route also checks keepLook for thumbs. I did not check whether that can reject a thumb marked as taken by nobody; if it can, that picture would show as a broken image.
  • Gate fix-up: the first push missed three required commit lines, so a second, empty commit adds Try: and Direction:. It also repeats Looks: and the gate still names /explore.

To try: open /explore?q=kind:app on the preview. Apps with a production look show a thumbnail and the rest show an initial box.

[
  {"go":"/explore?q=kind:app","look":"each app row starts with a 48px square","expect":"a picture for apps with a public production look, a box with the owner's letter for the rest; no row jumps as images load"},
  {"go":"/explore?q=kind:app","look":"open a row's forks","expect":"forks have the same box"}
]
commented

<!-- look-pages b01b4c2d2d9e --> Look pages for b01b4c2, from the gate:

  • look pages (named): this pull changes src/web/studio/explore.ts, src/web/style/components.ts; a commit names /explore
commented

Declined: nothing to change. The gate comment is informational, not a defect report. It says the pull changes src/web/studio/explore.ts and src/web/style/components.ts and that a commit names /explore. /explore is already in app.looks in forge.json, and both commits carry Looks: /explore. Running bun scripts/gate.ts on the branch gives the same single "named" line and no refusal. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m7x65cw1760rdsmctms4srby Left open: someone has spoken on this pull.

Changes requested — before the latest push

Fix first: the picture box uses tokens that do not exist and draws a box around the thing. --surface-2 and --border are defined nowhere in src/web/style, so the fallbacks win: a currentColor 1px border (a dark outline on every row) and a transparent fill. Use the real tokens, or drop the border (principle 6: a hairline where a thing ends, never a box around a thing). Then: (1) the initial comes from row.name, which is owner/name, so every app of one owner shows the same letter; take it from the app's own name. (2) pictureOf is called twice per row, with a !; call it once. (3) repoIdsOf and collect walk the same tree twice; build ids and paths in one walk. (4) Loosening the row budget in explore-first-view (520 to 620) weakens a guard for every row; the preview shows only initials, so the picture path is unverified there; confirm that keepLook and the image route serve these thumbs to a signed-out viewer, with a test that fetches the src and gets 200. (5) The one-query test monkeypatches db.query; assert on the result, or count through a wrapper passed in. The preview shows initial boxes only, no real picture was seen. Terminal has no pictures, which is reasonable and documented.

commented

Every point in the review is addressed and pushed. The /explore thumbnail box, the initial, the single walk, the thumbnail query, and the signed-out fetch test all changed. The row budget is only partly resolved (see below). Tests for explore-picture, explore-first-view, explore-fork-group and explore pass, tsc is clean and the design lint passes. The preview was not checked against a real picture, only the test fixtures.

  • Box and tokens: .ex-pic now fills with var(--muted) and has no border, per principle 6. One disagreement: --border and --surface-2 aren't in src/web/style, but --border is a real theme token (src/design/themes.ts). --surface-2 isn't one. I dropped the border anyway.
  • Initial: it comes from the app's own name (row.repo.name), so apps of one owner no longer share a letter. A test checks the initial is B for alice/bare, not A.
  • Single call: pictureOf runs once per row into a const, with no !.
  • Single walk: pathsOf builds the repo id to /owner/name map in one pass over the rows and their folded forks, and exploreThumbs takes that map.
  • Signed-out viewers: exploreThumbs now skips any picture whose file is missing or that keepLook rejects, and falls back to the next one. Before, a missing file would have shown a broken image. A new test fetches the row's src with no session and gets 200 image/png. It also covers a newer picture whose file is gone.
  • Query test: it no longer patches db.query. A counting wrapper is passed in as the db argument, and the test asserts one JOIN look query.
  • Row budget: I dropped the width, height and decoding attributes, since the CSS already fixes 48px. That wasn't enough to keep 520. It is 580 now, not 620, and the comment says why. The box is the lead slot (23 bytes) plus a 47-byte span, 76 in all. That measures initial boxes only. A real <img> with its URL is longer, and that case has no byte guard.

Not done: the terminal still has no pictures, as documented.

[
  {"go": "/explore?q=kind:app", "look": "an app with a public look", "expect": "a 48px picture with no outline, on a --muted fill, beside its name"},
  {"go": "/explore?q=kind:app", "look": "an app with no look", "expect": "a 48px muted box with the first letter of the app's own name, not of its owner"},
  {"go": "/explore?q=kind:app", "look": "the picture's src opened in a signed-out window", "expect": "the image loads (200)"}
]
commented

<!-- look-pages 41ecddcdb25d --> Look pages for 41ecddc, from the gate:

  • look pages (named): this pull changes src/web/studio/explore.ts, src/web/style/components.ts; a commit names /explore
commented

/explore now shows each app's latest public picture as a fixed 48px thumbnail beside its name. Apps with no picture get a neutral box holding their initial. The check was red on this pull because the thumbnail <img> in src/web/studio/explore.ts had no width/height attributes. That made test/img-size.test.ts fail, and it is green on main. I added width="48" height="48" to the tag, so the page can't shift as pictures load.

test/explore-picture.test.ts matched the old attribute order, so I updated its three patterns to the new tag. The test was wrong, not the code.

test/img-size.test.ts and test/explore-picture.test.ts pass, tsc --noEmit is clean and design-lint is clean. I did not re-run test/docs-link.test.ts or test/fetch-timeout.test.ts: the check showed both red on main too, and the check did not count them against this pull. I also did not look at the other failures in the log (the Flow pair listings and the dashboard N+1 test), so I can't say whether they are related. The new check run will show whether they remain.

To try it, open /explore. Apps with a look show their newest public picture, lazy-loaded with the app's name as alt text. Apps without one show the neutral box.

[{"go":"/explore","look":"each app row's 48px thumbnail beside its name","expect":"a picture for apps with a look, a neutral box with the initial otherwise; no layout shift while images load"}]
commented

<!-- look-pages 6f16bfe4e236 --> Look pages for 6f16bfe, from the gate:

  • look pages (named): this pull changes src/web/studio/explore.ts, src/web/style/components.ts; a commit names /explore
commented

The 6f16bfe look-pages note asks for no change, and I made none, so I did not push again. It says the gate will capture a look of /explore, because this pull changes src/web/studio/explore.ts and src/web/style/components.ts and a commit names that page.

[{"go":"/explore","look":"each app row's 48px thumbnail beside its name","expect":"a picture for apps with a look, a neutral box with the initial otherwise; no layout shift while images load"}]
Approved

Earlier asks are met: the box is --muted with no border, the initial comes from the app's own name, there is one walk and one query, a missing or unservable file falls back, and the signed-out fetch is tested. The latest push adds width/height to the img, which keeps the box fixed and fixes img-size. The preview serves the 48px box in the row-lead slot. Two things I would do next. Non-blocking: add a byte guard for a row with a real <img> and its URL, since the 580 cap measures initial boxes only. Non-blocking: give the terminal list a text mark of the picture, or say in AGENTS.md why it has none.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs