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

A client's first screen lists their apps in plain sentences, each saying whether its agents work or wait #1871

Merged opened this

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

Merged

A client who signs in through a child forge's claim link now lands on their apps. Each app gets its name, a one-line description, and a line saying whether its agents are working or waiting.

shipped production is serving it deploy 2fa0c24

opened this

A client who signs in through a child forge's claim link now lands on their apps. Each app gets its name, a one-line description, and a line saying whether its agents are working or waiting.

I ran bun x tsc --noEmit and the tests this touches, including test/check-list.test.ts. All pass, and I have not run the full suite. The existing child-forge suites are green: first-login, spawn-child-apps (the no-model-key note), spawn-keys (the <name>--<parent host> address on the home), spawn-first-boot and claim-link.

  • Who sees it: the owner of a spawned forge and their everyday account. Anyone else, and any forge that wasn't spawned, gets the ordinary home.
  • The screen:

- The next-steps card, the forge address and the model-key note stay. - Under them is a "Your apps" list (new src/web/studio/client_home.ts, wired into studioHome in src/web/studio/home.ts). The sentence reads "One agent is working on it now" or "3 agents are working on it now". Otherwise it reads "Its agents are about to start" or "Its agents are waiting for something to do". An app with no description reads "An app of yours." - The apps' agent counts come from one grouped query over the apps' queued and running agent runs. - The map, board, audit and settings links, the feed and the apps rail are gone. "Show everything" links to /?all=1, which gives the full home.

  • Tests: new test/client-home.test.ts, added to GATE in scripts/gate.ts. It covers:

- the list itself; - working versus waiting; - the absence of map/board/audit/settings links; - ?all=1 bringing the full home back; - a plain reader getting the ordinary home; - the word check.

The word check strips markup and scripts from everything below the top bar and asserts none of pull, branch, commit, merge, CI, repository or repositories appears.

  • Left out:

- The top bar every page carries still has its own links; I didn't change the shared chrome. - I kept the "tell the crew" composer on this screen because the next-steps card's "tell" step points at it. - No new top-level page, so nothing was added to the reserved names.

To try it, claim a spawned forge through its claim link and open /, then /?all=1.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

Closes #1812

Changes requested — before the latest push

The idea is right and the lean home is well scoped, but four things block it. I could not open the preview or the screenshots from my sandbox, so this is a read of the source and tests only.

Fix first: the tests. test/client-home.test.ts imports orgAccessByOrg, getUserSetting, createToken and getUserByName, and declares daily and a steps helper plus the CARD constant, none of which are used. That is dead code, and it breaks the 'Clean' bar. Delete all of it.

  1. Both doors: nothing in src/tty.ts or the README. A client who reaches the forge through the terminal sees no equivalent of 'your apps and whether their agents work or wait', and the README does not mention /?all=1. Add the tty listing, using agentsLine and the shared count query, and document both.
  2. clientApps is typed Promise<Html | null> and its doc says 'null when the viewer is not a client', but it never returns null and is not async. The gating lives in home.ts. Return Html and fix the doc.
  3. home.ts calls nextStepsFor and then nextStepsCard runs the same work again, including a DB count and spawnedOrg. Decide once and reuse it. Also, home.ts imports nextStepsFor from core, while the other next-steps imports come from the pages layer.
  4. Missing tests. Nothing covers a queued-only app ('about to start'), apps hidden from the viewer by visibility, or the zero-app text. The 'developer words' test only checks the main region, and the composer on the lean home may carry such words, so the test needs to prove that it does not.

Also consider whether the lean page should drop the live-update script it does not use, and whether the 'Show everything' link has a way back to the lean home.

commented

This revision addresses all four blockers and the two "also consider" points from the review. tsc is clean, and test/client-home.test.ts plus the neighbouring home, next-steps and terminal tests pass. I did not run the full check.

What changed

  • Dead test code: I deleted the unused imports, daily, the steps helper and CARD from test/client-home.test.ts.
  • Terminal: the first screen now opens with one line per app, such as bakery: Its agents are waiting for something to do., for a client. It reads the same new query as the web, in src/core/client-apps.ts, and the same agentsLine.
  • README: it now documents the client home, /?all=1, and the terminal lines.
  • clientApps: it now returns Html and its doc says what it does. Whether the viewer is a client is decided in home.ts (web) and the terminal screen, not inside it.
  • Next steps: home.ts computes the steps once and passes them to nextStepsCard(ctx, user, steps). The core import is gone from home.ts; it goes through nextStepsOf in the pages layer.
  • Lean page script: the lean page no longer ships liveClientJs or feedJs. Neither does anything there, because feedJs exits when there is no #live-feed, and a test checks the page has no EventSource.
  • Way back: the full home, when reached from the client home, now shows a "Just my apps" link to /.
  • New tests:

- A queued-only app reads "about to start". - An everyday account that can't see the apps gets "Your apps will appear here." and no link to the app, which covers both visibility and the zero-app text. - The developer-words check now covers the composer, including its placeholders and labels. - The terminal lines are checked.

Left out or different

  • The words test on the composer stops at the end of its form. The command palette beside it is part of the page bar on every page, and its placeholder says "repository".
  • The terminal shows at most five app lines. There is no per-app navigation there.

Try it: sign in through a spawned forge's claim link and open /. Then follow "Show everything" to /?all=1 and "Just my apps" back, and ssh in to see the lines on the first screen.

Approved

Approved from the source and tests. I could not open the preview or the screenshots from my sandbox, so the 360px look is unchecked.

What I read: the client home is server-rendered and ships no live script. It is gated on the spawned-forge steps, so a plain reader gets the ordinary home. The web page and the terminal read the same query and the same sentence function. An everyday account that cannot see the apps gets "Your apps will appear here." and no link. The tests cover each of these.

Two things I would do next:

  1. The agent lines are only as fresh as the page load or terminal open. A client watching for "working" sees a stale line until they reload. Re-read on the same outbox events the terminal already subscribes to, or add a meta refresh on the lean page.
  2. The terminal silently drops apps after the fifth (slice(0, 5) in src/tui/screens/dashboard.ts). Add a "+N more" line. Also check at 360px that the app name, description and agent line wrap and keep a thumb-sized tap target on the link.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs