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

Home says the week's percent left and when it runs out at this pace #9061

Merged opened this

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

Merged

Home now shows the owner a short crew line, for example "30% of the week left, runs out Thu 14:00 UTC at this pace". It sits in the admin figures block, above the existing long week sentence. I didn't open the page in a browser or the preview. The new test, the other home and crew-week tests I ran, `tsc`, `gate.ts` and `design-lint.ts` all pass. I didn't run the full suite; the forge runs it on th…

shipped production is serving it deploy b4c82c4

opened this

Home now shows the owner a short crew line, for example "30% of the week left, runs out Thu 14:00 UTC at this pace". It sits in the admin figures block, above the existing long week sentence. I didn't open the page in a browser or the preview. The new test, the other home and crew-week tests I ran, tsc, gate.ts and design-lint.ts all pass. I didn't run the full suite; the forge runs it on the push.

  • The numbers: the percent left is the provider meter's free share. The run-out time is the pacer's own runsOutAt, taken for the repository the crew works most, the same one the long sentence describes. The new code is crewPace in src/crew/week_read.ts and crewLine in src/web/studio/week_line.ts, wired into src/web/studio/home.ts.
  • When the burn won't empty the week: the line reads "N% of the week left, lasts to the reset at this pace". I added this because the issue only gave the runs-out wording.
  • Unmeasured week: the line is left out, and the existing long sentence still says the pace is unknown.
  • Who sees it: "owner" means a site admin, which is the viewer the home figures block already uses. Everyone else gets nothing from crewLine, and a non-admin never gets that block anyway.
  • Escaping and layout: the output goes through the html template, so it is escaped. It is server-rendered in the first paint of the existing block.
  • Test: the new test in test/week-wiring.test.ts checks the owner's line for both wordings and checks that a non-admin and a signed-out viewer get an empty string.
  • Times in UTC: the run-out time is shown in UTC, not the viewer's local time, because the server has no timezone for them. The label says so.
  • Not done: I didn't change the long week sentence, and I didn't add the line to the terminal dashboard.

Closes #8961

commented

Home now shows the owner a short crew line, for example "30% of the week left, runs out Thu 14:00 UTC at this pace". It sits in the admin figures block, above the existing long week sentence. I didn't open the page in a browser or the preview. The new test, the other home and crew-week tests I ran, tsc, gate.ts and design-lint.ts all pass. I didn't run the full suite; the forge runs it on the push.

  • The numbers: the percent left is the provider meter's free share. The run-out time is the pacer's own runsOutAt, taken for the repository the crew works most, the same one the long sentence describes. The new code is crewPace in src/crew/week_read.ts and crewLine in src/web/studio/week_line.ts, wired into src/web/studio/home.ts.
  • When the burn won't empty the week: the line reads "N% of the week left, lasts to the reset at this pace". I added this because the issue only gave the runs-out wording.
  • Unmeasured week: the line is left out, and the existing long sentence still says the pace is unknown.
  • Who sees it: "owner" means a site admin, which is the viewer the home figures block already uses. Everyone else gets nothing from crewLine, and a non-admin never gets that block anyway.
  • Escaping and layout: the output goes through the html template, so it is escaped. It is server-rendered in the first paint of the existing block.
  • Test: the new test in test/week-wiring.test.ts checks the owner's line for both wordings and checks that a non-admin and a signed-out viewer get an empty string.
  • Times in UTC: the run-out time is shown in UTC, not the viewer's local time, because the server has no timezone for them. The label says so.
  • Not done: I didn't change the long week sentence, and I didn't add the line to the terminal dashboard.
commented

The preview deploy didn't fail, and I'm not changing or pushing anything for it. The log you sent ends with ready and done, and the app was serving at https://lab--9061--forge-trevato-apps.open-platform.sh.

"No tests declared, none run" is an observation about the preview step, not an error. forge.json has no top-level test command, which is how it already is on main. The tests run in the forge's check, which uses check.fast, check.run and check.verify in forge.json. Before I pushed, bun test test/week-wiring.test.ts passed, along with the home and crew-week suites I ran, tsc --noEmit, gate.ts and design-lint.ts.

If the preview step is meant to fail on that message, tell me what it expects and I'll look again. If the forge's check has failed on this push, send me its log and I'll fix that.

commented

Home's crew line now shows the percent of the week left and when it runs out at the current pace, for the owner. The code is the same as in the failed push.

The check failed only because no commit message had a Try: line. I added an empty commit that has one, since amending would have meant a force push. bun scripts/gate.ts now passes locally and the push went through. I didn't re-run tsc or the tests, because nothing in the code changed.

To try it: open / on the preview signed in as the owner and read the crew line under the header.

The forge's check will run again on this push.

🤖 Generated with Claude Code

Changes requested — before the latest push

Server-rendered, escaped and admin-only, and the test covers both wordings plus the non-owner cases. Two changes needed in one round:

  1. Both doors: the terminal dashboard does not show the crew line (the pull says so). What an owner reads on Home must be on the matching screen in src/tui/ too, from the same crewLineWords/crewPace, and gated the same way (admin only).
  2. No docs/features/<name>.md how-to for the line (what the percent and run-out time mean, UTC, the lasts-to-the-reset wording). Do not put it in README.

Smaller: the line duplicates the long week sentence directly beneath it on the same page, which is two statements of one fact. Say in the pull why both stay, or fold the short form into the sentence. A test for the unmeasured week (crewLine returns empty while crewPace is null) is also missing. The preview was not opened by the builder.

commented

Home's crew line now appears in the terminal dashboard as well, for admins only. The gate.ts script, tsc, and week-wiring, tui-dashboard-alarms and readme-cap tests all pass. I did not open the preview.

What changed

  • Terminal dashboard: weekLines in src/tui/screens/dashboard.ts now prints the crew line above the week sentence. It sits in the existing admin-only figures block, so non-admins never see it. A new test checks that the admin's terminal shows the same words as the web and that a non-admin's doesn't.
  • One source for the words: crewLineWords moved into src/crew/week_read.ts, so the web and the terminal call the same function. week_line.ts imports it from there.
  • One repository pick: weekWords and crewPace now share a busiest helper, so they can't choose different repositories.
  • Unmeasured week: a test now checks that crewLineWords returns null and crewLine renders nothing when no measure exists.
  • How-to: docs/features/crew-line.md explains the percent, the UTC run-out time, the "lasts to the reset" wording and when the line is absent. I didn't touch the README.

Why the line and the long sentence both stay

  • Different jobs: the line is the glanceable number, and the sentence is the reason (pace verdict, slots, efficiency, and whether a concurrency cap is holding the crew back).
  • Can't disagree: both read the same repository.
  • Not folded in: the sentence already starts with "Behind pace: N% of the week left", so folding the run-out time into it would make the longest line on Home longer. I left it.

To try it: open / on the preview signed in as the owner and read the crew line under the header. The same line is on the SSH dashboard.

🤖 Generated with Claude Code

Changes requested — before the latest push

The behaviour is sound: server-rendered, escaped, admin-only, same words on web and terminal, how-to in docs/features, README untouched. I fetched the preview home with my token and found no crew-pace element, so I could not see the line there. That is expected for a non-admin or an unmetered week, but nothing in the pull shows it rendered. Changes needed in one round:

  1. Remove the new export on weekLines in src/tui/screens/dashboard.ts. Nothing imports it, and the test goes through the whole terminal, so it is a dead export.
  2. Direction: the owner put pipeline work (#6534, #6611, #5276, #3316 and the rest) ahead of any feature, and this is a Home feature. Say in the pull description why it lands ahead of that work, for example that it closes an already-open issue and is small. Otherwise leave it for the pipeline items.
  3. The new line and the sentence under it both start with 'N% of the week left' (the builder's own note says the sentence begins 'Behind pace: N% of the week left'). Home therefore states the same percent twice on adjacent lines. Either drop the percent from the long sentence when the crew line is shown, or fold the run-out time into it. Adding a line is the weaker choice.
  4. The crew line is small break while the sentence is small muted break. State the reason for the difference, or use the same muted style and keep one accent per page, as docs/DESIGN.md asks.
commented

For the owner, Home and the terminal dashboard now show one short line, "30% of the week left, runs out Thu 14:00 UTC at this pace" (or "…, lasts to the reset at this pace"). It is built from the pacer's own numbers (crewPace → crewLineWords in src/crew/week_read.ts). Directly under it, the pace sentence no longer repeats the percent or the run-out time, so Home says each figure once.

What to look at:

  • One fact, said once. weekDecision (src/crew/week.ts) builds the sentence two ways from one builder: sentence in full, and besideCrewLine without the free percent or "running out about …". weekBlock puts the crew line and the shorter sentence together. The terminal prints weekBlock, and Home's homeWeek (src/web/studio/week_line.ts) renders the same words.

- Anyone who isn't an admin, and any week that hasn't been measured yet, gets the full sentence with no line. - The Spend tab has no crew line, so it keeps the full sentence.

  • One style. Both lines are small muted break and read as one block, so the page adds no second accent. #crew-pace stays on the line.
  • One pick. weekWords and crewPace share busiest, the helper that chooses the repository the crew works most, so the line and the sentence always describe the same repository.
  • Both doors are admin-only. On the web, homeWeek checks isAdmin and sits in the admin-only kpis region. In the terminal, the line is in the admin-only figures block. The dead weekLines export is gone; the dashboard calls weekBlock directly.
  • Tests in test/week-wiring.test.ts:

- both wordings; - the percent appears exactly once on Home and in the terminal; - non-admins and anonymous viewers get no line; - an unmeasured week has no line on either door.

  • How-to: docs/features/crew-line.md. The README is untouched.

Why this lands ahead of the pipeline items: it closes #8961, an issue already open and split from #8873 (the crew pacing on the forge's own token). It is small, touches no pipeline code, and is now complete on both doors. Leaving it half-done would cost more review rounds than finishing it.

I did not see the line rendered on the preview. My token's home has no #crew-pace, which is what a non-admin or an unmetered week should get. The rendered form is covered by the tests above.

To try it: sign in to the preview as the owner while an account is metered and open /. The line sits under the figures, with the shorter sentence beneath it. The same two lines are on the SSH dashboard.

bun scripts/gate.ts, bun scripts/design-lint.ts, bun x tsc --noEmit and the week, crew-week, home-living, tui-dashboard-alarms and readme-cap tests pass.

🤖 Generated with Claude Code

Approved

All earlier asks are met. (1) Both doors: the terminal dashboard now prints weekBlock, the same crewLineWords as Home, inside the admin-only figures block, and a test covers admin and non-admin. (2) docs/features/crew-line.md exists, and the README is untouched. (3) The duplicate is gone: the sentence under the line drops the percent and run-out time (besideCrewLine), and a test asserts the percent appears once on the web and in the terminal. (4) The unmeasured-week test exists for both doors. The markup stays inside the existing small muted break style, with no new accent or component. Two things I would do next, both non-blocking: (a) homeWeek and weekBlock each call busiest through crewLineWords and weekWords, so the repository scan and the weekEfficiency read run twice per Home render. Compute the pace once and pass it in. (b) Show the preview owner the rendered line once an account is metered, since the builder only saw it in tests.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs