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

On a client's first screen each app row says "Working on: …" or "Last change: …, 3 days ago" #4056

Merged opened this

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

Merged

Each app row on a client's first screen now has a second plain sentence under the agents line: "Working on: <title>", or "Last change: <title>, <time ago>". I haven't confirmed the preview booted, because I couldn't look at it from here.

shipped production is serving it deploy 2da791d

opened this

Each app row on a client's first screen now has a second plain sentence under the agents line: "Working on: <title>", or "Last change: <title>, <time ago>". I haven't confirmed the preview booted, because I couldn't look at it from here.

  • What shows: a quiet app gets no extra line. Running work wins over a recent change. Time uses ago from src/feed/rank.ts. The text goes through the html template, so it is escaped.
  • Titles: whitespace is collapsed, and anything over 80 characters is cut at a word boundary with "…". The new helpers cutTitle and doingLine are in src/web/studio/client_home.ts. The row itself uses the existing clientDoings read.
  • Timing: the read has its own doing phase in Server-Timing, and apps is unchanged.
  • Tests: test/client-home.test.ts has new cases for the quiet, working and landed rows, escaping, the 80-character cut and the doing phase. The whole file passes (17 tests), including the developer-word list test.
  • Not checked: bun x tsc --noEmit could not run here (bun can't write its temp dir, and there are no node_modules), so there is no type check from me.
  • Preview: I haven't fetched the preview's / or a client home yet, so please check both return 200 once the deploy finishes. This is where #3353 and #4005 failed.
  • Left out: titles are free text, so a title that itself contains a developer word will show as written.

Closes #4008

commented

Each app row on a client's first screen now has a second plain sentence under the agents line: "Working on: <title>", or "Last change: <title>, <time ago>". I haven't confirmed the preview booted, because I couldn't look at it from here.

  • What shows: a quiet app gets no extra line. Running work wins over a recent change. Time uses ago from src/feed/rank.ts. The text goes through the html template, so it is escaped.
  • Titles: whitespace is collapsed, and anything over 80 characters is cut at a word boundary with "…". The new helpers cutTitle and doingLine are in src/web/studio/client_home.ts. The row itself uses the existing clientDoings read.
  • Timing: the read has its own doing phase in Server-Timing, and apps is unchanged.
  • Tests: test/client-home.test.ts has new cases for the quiet, working and landed rows, escaping, the 80-character cut and the doing phase. The whole file passes (17 tests), including the developer-word list test.
  • Not checked: bun x tsc --noEmit could not run here (bun can't write its temp dir, and there are no node_modules), so there is no type check from me.
  • Preview: I haven't fetched the preview's / or a client home yet, so please check both return 200 once the deploy finishes. This is where #3353 and #4005 failed.
  • Left out: titles are free text, so a title that itself contains a developer word will show as written.
Changes requested — before the latest push

The page half works: the preview answers 200, the new line is a muted span inside the existing row, the text is escaped, and a quiet app gets nothing extra. The terminal half is missing, so this is a change request.

  1. Fix first: both doors. src/tui/screens/dashboard.ts (~line 188-194) builds the terminal's client first screen as ${a.repo.name}: ${agentsLine(...)} and never reads clientDoings. A client in the terminal will not see "Working on: …" or "Last change: …". README.md:340-341 says the terminal's first screen opens with the same lines from the same query, which this change makes untrue. Fix: call clientDoings(f.db, ids, new Date()) there, append doingLine(...) to each line when it is not empty, and add a test in the dashboard/tui client-home tests. Put cutTitle and doingLine in a module that is not under src/web if the terminal is to import them cleanly.
  1. Docs: add a sentence to the README client-home section (near line 340) saying each app row shows what its agents are on or the last change landed in the past 7 days.
  1. Smaller: the ClientDoing kind is "landed", and doingLine treats anything not "working" as a last change. That is fine today, but a switch over the kind would make the compiler catch a third kind. The author also says the type check was not run; please run bun x tsc --noEmit before the next push.
commented

I've addressed all three points and pushed to the same branch. bun x tsc --noEmit is clean, and test/client-home.test.ts passes with 18 tests.

  • Terminal: the client first screen in src/tui/screens/dashboard.ts now reads clientDoings and appends the doing line to each app's line. A quiet app's line is unchanged. A new test in test/client-home.test.ts checks that the terminal shows "Working on: Add rye bread".
  • Helpers moved: cutTitle and doingLine now live in src/core/client-apps.ts, so the terminal doesn't import them from src/web. The test imports them from there too.
  • Compiler check: doingLine uses a switch over the ClientDoing kind, so a third kind now fails the type check.
  • README: the client-home section now says each app row shows "Working on: …" or the last change landed in the past 7 days, and that a quiet app says nothing more. The terminal sentence now says "queries" in the plural, since the screen reads two.

I did not re-fetch the preview after this push, so the earlier 200 is from the first push.

Approved

Approved. The preview answers 200 on /. Text is escaped through html, the read is its own Server-Timing phase, both doors (page and terminal) show the line, the README is updated, and the tests cover quiet, working, landed, escaping, cut and terminal. Two things I would do next: (1) the row's spans (about, agents, doing) have no CSS and sit inline, so on a 360px phone they run together as one paragraph; give .client-app a stacked layout using existing tokens, and keep .muted for the doing line. (2) In the terminal, agents line plus an 80-character title can exceed the screen width; wrap or put the doing line on its own row.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs