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

Front-page thumbs are the app as a stranger sees it, reduced, not a corner taken in a tile-sized window #684

Merged opened this

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

Merged

**What was broken.** Every tile on the signed-out front page showed a blurry, clipped corner of its app: a thumb was taken in a 200×125 browser window. A browser does not lay a page out at that size (headless Chromium keeps a minimum window width), so the file was the top-left 200×125 pixels of a wider page, and the page then stretched it to a 246×154 tile (more on a phone, twice that on a high-de…

shipped production is serving it deploy 4183511

opened this

What was broken. Every tile on the signed-out front page showed a blurry, clipped corner of its app: a thumb was taken in a 200×125 browser window. A browser does not lay a page out at that size (headless Chromium keeps a minimum window width), so the file was the top-left 200×125 pixels of a wider page, and the page then stretched it to a 246×154 tile (more on a phone, twice that on a high-density screen). The image requests all answered 200; the pictures themselves were wrong. Nothing to do with today's sandbox, edge rules or service worker: the looks on the server have no errors, and the newest were taken minutes ago.

The thumb was also taken signed in as the owner (an admin), and it is the picture shown to strangers.

What changes.

  • A thumb is the desktop page (1280×800), taken whole and reduced to 640×400 with the forge's own box filter and PNG encoder: sharp in a tile at twice the pixels on phone and desktop, about 20 KB each.
  • The thumb is taken as a guest (a grant that names nobody): the tile a stranger sees is the app as a stranger sees it. Phone and desktop pictures stay the owner's view.
  • The front page shows a thumb or no picture at all; it no longer falls back to the owner's desktop picture.
  • A sweep every ten minutes (first one a minute after boot) pictures any running production whose head is missing a picture, including a thumb from before this change (200 px wide). A woken app says nothing on the bus, so without the sweep an app that only wakes would never be pictured again. A picture that failed at this head is left to the next deploy, so a broken app does not start a browser every ten minutes.
  • test/apps.test.ts: one fixture gains service: null; tsc --noEmit was red on main since #442.

Tests. test/looks.test.ts: the thumb is taken in desktop's window, as nobody, stored at 640×400; the sweep retakes a legacy thumb as a stranger, takes nothing for a complete set, and does not retry a failure at the same head. test/studio.test.ts: the front page tile is the 640×400 thumb; without a thumb, the owner's desktop picture never appears.

After release. Running apps get new thumbs within about ten minutes. Sleeping apps get theirs the next time a visit wakes them.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs