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

A card with no picture says why, and never shows a question mark #16794

Merged opened this

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

Merged

A card with no picture now fills the picture's own box with the app's name and, when the forge has a reason, one line saying why. It never draws an image or a question mark. I haven't run the full suite.

Notes

opened this

A card with no picture now fills the picture's own box with the app's name and, when the forge has a reason, one line saying why. It never draws an image or a question mark. I haven't run the full suite. The six test files I ran pass, tsc --noEmit is clean, and design-lint and gate --explain report nothing outstanding.

What changed

  • Reasons: src/looks/why.ts turns what the forge knows into one line. The four lines are "taking a picture", "not serving", "failed under load; retrying at HH:MM UTC" and "pictures are the writers' on this private app". With no reason there is no line and the card shows the name alone.
  • Retry time: the looks service now notes the backoff's next try in src/looks/retries.ts when a look fails, and clears it on success or give-up. It lives in process memory and is gone on restart.
  • Home tile: src/actions/front.ts gives each front entry a why, and tile() in src/web/studio/home.ts uses noPicture when there is no picture.
  • App head: lookNow in src/web/pages/looks.ts shows the same card where it used to render nothing.
  • Card: noPicture in src/web/look_none.ts renders it with the name and reason escaped. .look-none has the thumb's 8:5 box, so nothing shifts when a picture arrives. The new classes are named in docs/design/areas/look-none.md.
  • Tests: test/look-none.test.ts covers each reason, "no reason, no line", the retry being read until due, and escaping of both the name and the reason.

Decisions and limits

  • Reused: NOT_SERVING from the looks service, the existing .look frame, and lookNow's fetch rule.
  • Looks page: lookCard on the pull page already says why a picture is missing, so I left it. lookNow is the app card in looks.ts.
  • Home tile coverage: a home tile without a picture only appears when it is the first pinned entry, so a placeholder there is rare.
  • No terminal side: the commit says No door:, because a picture slot has no terminal form.
  • UTC: the retry time is shown in UTC, so every viewer sees the same time.
  • Dupe hints: gate suggested retries.ts might duplicate remember and relayWait. They are different things, and the hint is advisory.

Try it: open / on the preview. A first tile whose app has no picture shows its name and the reason in the picture's box. bun test test/look-none.test.ts runs the new tests.

Closes #16257

17 earlier comments
commented

A card with no picture now fills the picture's own box with the app's name and, when the forge has a reason, one line saying why. It never draws an image or a question mark. I haven't run the full suite. The six test files I ran pass, tsc --noEmit is clean, and design-lint and gate --explain report nothing outstanding.

What changed

  • Reasons: src/looks/why.ts turns what the forge knows into one line. The four lines are "taking a picture", "not serving", "failed under load; retrying at HH:MM UTC" and "pictures are the writers' on this private app". With no reason there is no line and the card shows the name alone.
  • Retry time: the looks service now notes the backoff's next try in src/looks/retries.ts when a look fails, and clears it on success or give-up. It lives in process memory and is gone on restart.
  • Home tile: src/actions/front.ts gives each front entry a why, and tile() in src/web/studio/home.ts uses noPicture when there is no picture.
  • App head: lookNow in src/web/pages/looks.ts shows the same card where it used to render nothing.
  • Card: noPicture in src/web/look_none.ts renders it with the name and reason escaped. .look-none has the thumb's 8:5 box, so nothing shifts when a picture arrives. The new classes are named in docs/design/areas/look-none.md.
  • Tests: test/look-none.test.ts covers each reason, "no reason, no line", the retry being read until due, and escaping of both the name and the reason.

Decisions and limits

  • Reused: NOT_SERVING from the looks service, the existing .look frame, and lookNow's fetch rule.
  • Looks page: lookCard on the pull page already says why a picture is missing, so I left it. lookNow is the app card in looks.ts.
  • Home tile coverage: a home tile without a picture only appears when it is the first pinned entry, so a placeholder there is rare.
  • No terminal side: the commit says No door:, because a picture slot has no terminal form.
  • UTC: the retry time is shown in UTC, so every viewer sees the same time.
  • Dupe hints: gate suggested retries.ts might duplicate remember and relayWait. They are different things, and the hint is advisory.

Try it: open / on the preview. A first tile whose app has no picture shows its name and the reason in the picture's box. bun test test/look-none.test.ts runs the new tests.

commented

No defect found, and I pushed nothing. No recorded check of the head failed. The run was cut or is being re-run, and the forge will check the head again by itself. If that check fails on a named test, send me its assertion and I'll fix it.

commented

I merged main into the branch and pushed it. I haven't seen the forge's check on the merged head yet.

The conflict was not in the files you listed. The merge only conflicted in src/looks/service.ts. That was the ./backoff.ts import: main added realClock, and my branch added the ./retries.ts import. I kept both, so the import line now has realClock and the clearRetry, noteRetry import is still there. None of the other files you listed conflicted.

  • Type check: tsc --noEmit is clean.
  • Look and retry tests: I ran only the tests with "look" or "retr" in their names. 287 passed, 14 were skipped and 1 failed. The failure is looks.test.ts "a real capture through the grant door, with /usr/bin/chromium". It needs a real Chromium, which the sandbox doesn't have.
  • Not run: I didn't run the full suite or the tests for the other merged areas, so the forge's check covers those.
  • Gate output: gate.ts --fix printed some "one implementation?" similarity notes about src/looks/retries.ts. I changed nothing for them.
commented

<!-- look-pages 19eda7e0f45e --> Look pages for 19eda7e, from the gate:

  • look pages (named): this pull changes src/web/look_none.ts, src/web/pages/looks.ts, src/web/studio/home.ts; a commit names /
commented

A card with no picture now says why, in the picture's box, on the home and looks pages. This push fixes the check that failed three times: "no process-wide state that requests write to".

What changed

  • Cause of the failure: src/looks/retries.ts kept the backoff's next-try times in a module-level Map.
  • The fix: those times are now held per App in a WeakMap<App, Map>, the same pattern appsRuntime uses. noteRetry, clearRetry and retryAt take the app, and the callers in src/looks/service.ts, src/web/pages/looks.ts and src/actions/front.ts pass it.
  • Reasons shown: "taking a picture", "not serving", "failed under load; retrying at HH:MM UTC", and "pictures are the writers' on this private app". The text comes from src/looks/why.ts.
  • No reason: the card shows the app's name on a calm ground, with no <img> and no question mark. The card keeps the picture's size, so nothing shifts when a picture arrives.
  • Tests: test/look-none.test.ts covers each reason, the escaping of name and reason, and the retry held per app.

What I left out

  • Retry times are lost on restart. The next failure notes them again.
  • Times are shown in UTC, so every viewer sees the same page.

Checks

  • bun x tsc --noEmit and bun scripts/design-lint.ts pass. In scripts/gate.ts --explain every rule is ok, and the look-pages rule is met by an existing commit line.
  • The look tests pass except test/looks.test.ts "a real capture through the grant door, with /usr/bin/chromium". It could not take a capture in this sandbox, so I did not run it here.
  • I did not run the full suite; the forge runs it on push.

Try it

  • Open / and /looks for an app with no picture.
  • Check that the reason line shows, and that the card is the same size once a picture lands.
[
  {"go": "/", "look": "an app card with no picture", "expect": "one reason line or the app's name on a calm ground; no broken image, no question mark"},
  {"go": "/looks", "look": "the same app", "expect": "the same reason, in the picture's box, with no layout shift"}
]
commented

<!-- look-pages e95c7246b9d1 --> Look pages for e95c724, from the gate:

  • look pages (named): this pull changes src/web/look_none.ts, src/web/pages/looks.ts, src/web/studio/home.ts; a commit names /
commented

This is an informational note from the gate, not a failure, and I changed nothing in response to it. The gate classifies the pull as named: a commit already says Looks: /, and / is a page in app.looks. So the forge pictures / for the changes to src/web/look_none.ts, src/web/pages/looks.ts and src/web/studio/home.ts. No push was needed, so I didn't re-run the tests or type check.

What the pull does

  • A card with no picture now says why, in words, and never shows a question mark. src/web/look_none.ts holds the reason text. It is rendered on the looks page (src/web/pages/looks.ts) and on the studio home (src/web/studio/home.ts).
  • The retry times for these cards are held per app. They are no longer in a module-level Map.

What to look at

  • The preview of /, in light and dark. Find a card with no picture and check that it gives a reason and has no ?.

What I left out

  • Nothing new in this round.
commented

Still red on current main: each page stays inside its first-view budget. Fix it and push.

commented

I fixed the failing first-view budget test and pushed. I didn't run the whole suite, only the tests that cover this change. The tests I ran pass, tsc and design-lint are clean, and the forge will run the full check on this push.

Cause. The no-picture card on a repository's front page added one text block and one word to that page. That put it at 19 blocks against a budget of 18, in test/attention.test.ts and test/attention-stamped.test.ts. That page passes at the merge base, which has 18 blocks.

Fix. noPicture now leaves the app name out when it is given an empty name. The repository page passes an empty name because the page already names the repository, so there the card holds only the reason. The studio tile still passes the name, so it is unchanged. I also made the card's wrapper and name spans, which didn't change the count by themselves.

The other two failures. "A review run past its budget is queued again once" and "the memory sampler logs what the jobs allocated" passed when I ran test/crew-review-budget.test.ts and test/job-alloc.test.ts. I didn't investigate them further. Your check log shows the two attention tests green on main, which supports the budget overrun being this pull's.

For review. I didn't raise the budget, because the budget file is only meant to go down. On a repository's page, a card with no picture and no known reason now renders an empty box. If you'd rather show a name or a fixed phrase there, the budget would need to go up by one block.

commented

<!-- look-pages 2297e4f5f015 --> Look pages for 2297e4f, from the gate:

  • look pages (named): this pull changes src/web/look_none.ts, src/web/pages/looks.ts, src/web/studio/home.ts; a commit names /
commented

I addressed the look-pages note by adding an empty commit whose line is Looks: /, and pushed it. / is already one of the app.looks pages in forge.json.

The gate's note said it already saw a commit naming /, so it may have been informational only. I didn't change any code, and I didn't re-run the tests or type check, because nothing but the commit message changed.

The gate also reports one comment over 100 columns, in src/actions/front.ts. I didn't touch that file in this pull, and the gate says the nightly rewrap handles it on main.

commented

<!-- look-pages e6ede5f6c763 --> Look pages for e6ede5f, from the gate:

  • look pages (named): this pull changes src/web/look_none.ts, src/web/pages/looks.ts, src/web/studio/home.ts; a commit names /
commented

A card with no picture now says why, in one line, and never draws a question mark. It does this on the home page's tiles and on a repository's "now" card, and now in the terminal too. The gate passes (0 fail), bun x tsc --noEmit is clean, and bun scripts/design-lint.ts is clean. These tests pass: look-none, tui-front, front, unused-exports and mcp-size. I ran those directly because scripts/fast.ts was too broad to name tests.

What changed

  • Reasons: src/looks/why.ts gives one line per case: "taking a picture", "not serving", "failed under load; retrying at HH:MM UTC", or "pictures are the writers' on this private app". With no reason, the card shows only the name.
  • Retry times: these are held per app in src/looks/retries.ts, not in a module-level Map.
  • Cards: noPicture in src/web/look_none.ts fills the picture's own 8:5 box, so nothing shifts when a picture arrives. It escapes the name and the reason and draws no image. On a repository's page it holds the reason alone, to stay inside the first-view budget.
  • Terminal door (new, from the feedback): GET /api/v1/front and MCP front_page rows now carry why, and the terminal front-page row leads its meta with it. The area doc docs/design/areas/look-none.md and the contract text are updated.
  • Feedback items:
    • Both doors: the terminal change above, with a test in test/tui-front.test.ts.
    • No as never: test/look-none.test.ts uses a real createApp instead of {} as App.
    • Issue number: the commit line names #16257.
    • Dead code: test/unused-exports.test.ts passes.
  • Look pages: the new commit has a Looks: / line, so the look rule's note stays satisfied.

What I left out

  • On the front page, only a first pin can show the no-picture card. Other apps without a picture wait for one, as before.
  • Retry times are not kept across a restart. The next failure notes them again.

To try it

  • Pin an app with no picture first on the front page. Its card and the terminal's "Front page" row both read "taking a picture", or whichever reason applies.
commented

<!-- look-pages 23558f821446 --> Look pages for 23558f8, from the gate:

  • look pages (named): this pull changes src/web/look_none.ts, src/web/pages/looks.ts, src/web/studio/home.ts; a commit names /
commented

A card with no picture now always shows something true: the reason when the forge has one, otherwise the app's name. It never shows an empty box, an image or a question mark. The gate passes (0 fail), tsc is clean, and the look-none, tui-front, front and unused-exports tests pass. I did not look at the preview, so the dark-theme check below is from the CSS, not from a screenshot.

What changed

  • Blank slot fixed: the repository page's card (lookNow) now passes the app's name, so with no reason it shows the name and not an empty .look-none box. The whitespace-only line is gone. I did not change the block count and did not need to.
  • "Taking a picture" removed: the forge cannot tell whether a capture is queued or running. After the backoff gives up, or after a restart loses the retry time, an up app with no error would still have said it, which is false. whyNoPicture now returns only what it knows: "not serving", "failed under load; retrying at HH:MM UTC", or "pictures are the writers' on this private app". The terminal row follows the same data.
  • Tests that render the cards (in test/front.test.ts):
    • A pinned app with no picture renders a named card with no <img> and no reason. After a failed look is recorded, that card says "not serving".
    • lookNow for a private app shows the writers' line to a stranger. For an open app with no reason it shows the name alone.
    • The terminal front-page test now uses a recorded failed look and expects "not serving".
    • Cast in the lookNow test: it builds its context with as unknown as Ctx, the same cast test/sealed-preview.test.ts uses. The earlier as never is gone from my tests.
  • Calm ground: .look-none has no background of its own, but it carries the .look class. .look sets background: var(--muted), which the theme variable switches for light and dark.

What I left out

  • There is no "a picture is on its way" line. Adding one needs a real queued or running signal from the looks service.
  • Only a first pin can show the no-picture card on the home page. Other apps without a picture still wait for one, as before.
commented

<!-- look-pages 05803a795c0a --> Look pages for 05803a7, from the gate:

  • look pages (named): this pull changes src/web/look_none.ts, src/web/pages/looks.ts, src/web/studio/home.ts; a commit names /
commented

Nothing in the feedback needed a code change. The gate holds this branch to every rule it listed, and each is already met, so I pushed nothing new.

  • Look pages: the note is satisfied. Commit e6ede5f6c carries Looks: /, and so do the two later commits.
  • Both doors: the terminal's front screen (src/tui/screens/front.ts) shows the same reason as the page, and src/actions/front.ts and the /api/v1/front contract carry it. test/tui-front.test.ts covers that.
  • as never: the tests added on this branch contain none.
  • Issue number: each commit subject names (#16257), except the Looks: / commit, whose body names it.
  • Dead exports: test/unused-exports.test.ts and test/hollow.test.ts pass.
  • Also run: bun scripts/gate.ts --fix (no rewrap to commit), bun x tsc --noEmit (clean), and test/front.test.ts, test/look-none.test.ts and test/tui-front.test.ts (32 pass).

What the pull does: a card with no picture says why and never shows a question mark. When no reason is known, it holds the app's name and does not claim a picture is being taken. The web page and the terminal front page show the same reason.

Not run: the full suite. The change reaches too many test files to name, so the forge's check runs it.

To try it: open / on the preview, https://lab--16794--forge-trevato-apps.open-platform.sh. Find a card with no picture; it shows the reason or the app's name, never ?.

[
  {"go": "/", "look": "a card with no picture", "expect": "it shows the reason, or the app's name when there is none, and no question mark"},
  {"go": "/", "look": "any card whose picture is not yet taken", "expect": "no text claims a picture is being taken"}
]

🤖 Generated with Claude Code

commented

Left #16257 open: 1 unticked item remain (An app card on the home (src/web/studio/home.ts) and on the looks page (src/web/pages/looks.ts) with no picture shows the one-line reason the forge has: "taking a picture", "not serving", "failed under load; retrying at HH:MM" (from the backoff's next try), or "pictures are the writers' on this private app".).

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs