Public: anyone can read this; the crew can change it.
First-time studio owner: a cloud bill, an app's deploy and its undo are hard to find #17640
Merged 23h 37m ago, live in production
scout/forge:scout/17637-first-time-studio-owner-a-cloud-bill-an → main 0 commits fork 1 thread · 1 unresolved
12 files
changed +44
−9
- docs/features/app-page-details.md
- docs/features/cloud.md
- docs/features/service-parked.md
- docs/features/service-restart.md
- src/tui/screens/deploys.ts
- src/web/onboarding_row.ts
- src/web/pages/cloud.ts
- src/web/studio/previews.ts
- test/cloud-page-shape.test.ts
- test/fresh-app.test.ts
- test/onboarding-doors.test.ts
- test/studio-labels.test.ts
docs/features/app-page-details.md +2 −2
| @@ -7,11 +7,11 @@ row: The app's page: detail on demand | ||
| 7 | 7 | A first ask opens a page of one column: the state, the box to tell the crew, and Now. The operator's |
| 8 | 8 | detail sits behind named disclosures, so the controls differ for a screen reader: |
| 9 | 9 | |
| 10 | - **Deploy and log** (under the name): the commit, terminal, build cache and log tail. It opens by | |
| 10 | - **Show deploy details** (under the name): the commit, terminal, build cache and log tail. It opens by | |
| 11 | 11 | itself when production errored or its last deploy failed. |
| 12 | 12 | - **Run log**: the crew's log tail inside a running Now row. |
| 13 | 13 | - **Operator detail** (first-ask page only): variants, drop, environment settings, archive. |
| 14 | 14 | |
| 15 | An app that has run keeps its rail, previews, crew and forks in view as before; only Deploy and log | |
| 15 | An app that has run keeps its rail, previews, crew and forks in view as before; only Show deploy details | |
| 16 | 16 | and Run log fold. A disclosure someone has opened stays open when a deploy event refreshes the head. |
| 17 | 17 | The terminal has no page layout, so it is unchanged. |
docs/features/cloud.md +4
| @@ -82,3 +82,7 @@ The ceiling counts only what the forge's own rows say it made. The `cloud-watch` | ||
| 82 | 82 | Not done: adopting an orphan into a pinned row (retire it in the provider's console, or acknowledge it), and a read of the provider's actual bill. |
| 83 | 83 | |
| 84 | 84 | The watch keeps when the standing problems began, so a standing orphan is one notification and one /health card, not one an hour. A forge-named thing made in the last two hours, or named for a live pinned row, is a deploy in flight and not an orphan. A create stays refused until the next hourly reading even after an orphan is retired in the provider's console; the refusal says so. |
| 85 | ||
| 86 | ## What the ceiling line counts | |
| 87 | ||
| 88 | Each account row reads `ceiling $X a month · $Y counted from this account's machines and databases · $Z left`. `$Y` is the forge's own count of what it pinned to the account, not the vendor's bill; Infrastructure shows the bill. |
docs/features/service-parked.md +1 −1
| @@ -9,7 +9,7 @@ This page is for app authors. A service declares TCP ports in `forge.json` (`app | ||
| 9 | 9 | ## What happens |
| 10 | 10 | |
| 11 | 11 | - **Stop.** Stopping the service parks it. Its ports are released at once, so another app may deploy with them. |
| 12 | - **Where you see it.** The app page shows, under "Deploy and log", and the terminal's Deploys screen shows under the production heading: `parked: port 25565 released for other apps; a redeploy takes it back, or says who holds it`. | |
| 12 | - **Where you see it.** The app page shows, under "Show deploy details", and the terminal's Deploys screen shows under the production heading: `parked: port 25565 released for other apps; a redeploy takes it back, or says who holds it`. | |
| 13 | 13 | - **Redeploy.** A redeploy takes the ports back. If another app now holds one, the deploy fails with `forge.json: port 25565 is already held by <app>; <yours> cannot declare it`, and your app stays parked. Stop that app, or change `app.ports`, then deploy again. |
| 14 | 14 | - **Clears.** The note goes when a deploy lands, or when the environment is removed. |
| 15 | 15 |
docs/features/service-restart.md +1 −1
| @@ -15,7 +15,7 @@ This page is for app authors. An app whose `forge.json` declares a `service` has | ||
| 15 | 15 | |
| 16 | 16 | ## Where you see it |
| 17 | 17 | |
| 18 | After a restart, the app page shows one line under "Deploy and log", and the terminal's Deploys screen shows the same line under the production heading: | |
| 18 | After a restart, the app page shows one line under "Show deploy details", and the terminal's Deploys screen shows the same line under the production heading: | |
| 19 | 19 | |
| 20 | 20 | - `service restarting in 4 s after exit code 2 (restart 3, pause doubles up to 60 s)` while it waits |
| 21 | 21 | - `service restarted 3 times after exit code 2` once it is running again |
src/tui/screens/deploys.ts +1 −1
| @@ -285,7 +285,7 @@ export function deploysScreen(f: Session, ctx: Ctx, repo: Repo): Screen { | ||
| 285 | 285 | pace = appPace(f.app, f.user, repo); |
| 286 | 286 | side = appSideLines(f.app, f.user, repo); |
| 287 | 287 | const standing = appOnboardingLine(f.app, repo, f.user); |
| 288 | onboarding = standing === undefined ? "" : `${standing.text}${standing.href === undefined ? "" : ` ${standing.href}`}`; | |
| 288 | onboarding = standing === undefined ? "" : `As it stands: ${standing.text}${standing.href === undefined ? "" : ` ${standing.href}`}`; | |
| 289 | 289 | egress = egressLines(f, repo); |
| 290 | 290 | pulls = appPullLines(f.app, f.user, repo); |
| 291 | 291 | previews = appPreviews(f.app, f.user, repo); |
src/web/onboarding_row.ts +3 −1
| @@ -10,8 +10,10 @@ import type { OnboardingLine } from "../apps/onboarding.ts"; | ||
| 10 | 10 | import { html, type Html } from "./html.ts"; |
| 11 | 11 | |
| 12 | 12 | export function onboardingRow(line: OnboardingLine): Html { |
| 13 | // A label first: the line is the state of the app as it already stands, never the result of | |
| 14 | // opening the disclosure it sits in (#17637). | |
| 13 | 15 | return html`<p class="muted" data-onboarding="${line.state}"> |
| 14 | ${line.text}${line.href === undefined || line.linkLabel === undefined | |
| 16 | As it stands: ${line.text}${line.href === undefined || line.linkLabel === undefined | |
| 15 | 17 | ? null |
| 16 | 18 | : html` <a href="${line.href}">${line.linkLabel}</a>`} |
| 17 | 19 | </p>`; |
src/web/pages/cloud.ts +1 −1
| @@ -81,7 +81,7 @@ function watchFacts(db: Database, a: CloudAccount): { label: string; value: stri | ||
| 81 | 81 | |
| 82 | 82 | function ceilingLine(db: Database, a: CloudAccount): string { |
| 83 | 83 | const s = spendOf(db, a.provider, a.name); |
| 84 | return `ceiling $${s.ceilingDollars} a month · the forge reckons ${dollars(s.monthlyCents)} now · ${s.leftCents >= 0 ? `${dollars(s.leftCents)} left` : `${dollars(-s.leftCents)} over`}`; | |
| 84 | return `ceiling $${s.ceilingDollars} a month · ${dollars(s.monthlyCents)} counted from this account's machines and databases · ${s.leftCents >= 0 ? `${dollars(s.leftCents)} left` : `${dollars(-s.leftCents)} over`}`; | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | function accountsCard(db: Database, accounts: CloudAccount[], reads: CloudRead[], uses: Map<string, VendorUse[]>): Html { |
src/web/studio/previews.ts +1 −1
| @@ -359,7 +359,7 @@ export function appPanels( | ||
| 359 | 359 | ${when(copy, (c) => html`${repo.description || url !== undefined ? "· " : ""}${testCopyLink(c)}`)} |
| 360 | 360 | </p>`)} |
| 361 | 361 | ${disclosure( |
| 362 | "Deploy and log", | |
| 362 | "Show deploy details", | |
| 363 | 363 | html`${onboarding === undefined |
| 364 | 364 | ? when(production, (env) => envFacts(base, env)) |
| 365 | 365 | : onboardingRow(onboarding)} |
test/cloud-page-shape.test.ts +7
| @@ -83,3 +83,10 @@ test("a Hetzner row has no project field and no explanation; a DigitalOcean row | ||
| 83 | 83 | expect(page.match(/Cloud project for the forges of/g)).toHaveLength(1); |
| 84 | 84 | expect(page).not.toContain("already belongs to one project"); |
| 85 | 85 | }); |
| 86 | ||
| 87 | test("the ceiling line says what its dollars count, in plain words", async () => { | |
| 88 | const page = await (await fetch(`${servers.url}/settings/cloud`, { headers: { cookie } })).text(); | |
| 89 | expect(page.replaceAll("'", "'")).toContain("counted from this account's machines and databases"); | |
| 90 | expect(page).not.toContain("the forge reckons"); | |
| 91 | expect(page).not.toContain("not its bill"); | |
| 92 | }); |
test/fresh-app.test.ts +1 −1
| @@ -146,7 +146,7 @@ test("the first-ask page folds the operator's detail into named disclosures", as | ||
| 146 | 146 | expect(outside).not.toContain(gone); |
| 147 | 147 | const names = summaries(page); |
| 148 | 148 | expect(names).toContain("Operator detail"); |
| 149 | expect(names).toContain("Deploy and log"); | |
| 149 | expect(names).toContain("Show deploy details"); | |
| 150 | 150 | expect(new Set(names).size).toBe(names.length); |
| 151 | 151 | expect(names).not.toContain("Details"); |
| 152 | 152 | const operator = blocks.find((b) => b.includes('id="app-details"'))!; |
test/onboarding-doors.test.ts +13
| @@ -220,3 +220,16 @@ test("the notifier judges a new app afresh on a pull event and tells its owner o | ||
| 220 | 220 | notifier.stop(); |
| 221 | 221 | } |
| 222 | 222 | }); |
| 223 | ||
| 224 | test("the app page's fold-out is named 'Show deploy details' and holds the 'As it stands:' line", async () => { | |
| 225 | const page = await (await get("/alice/open/app", true)).text(); | |
| 226 | const at = page.indexOf("Show deploy details"); | |
| 227 | expect(at).toBeGreaterThan(-1); | |
| 228 | expect(page).not.toContain("Deploy and log"); | |
| 229 | expect(page.slice(at)).toContain("As it stands: "); | |
| 230 | }); | |
| 231 | ||
| 232 | test("the terminal's deploys screen labels the line 'As it stands:'", async () => { | |
| 233 | const text = await frame(alice, repos.open!); | |
| 234 | expect(text).toContain("As it stands:"); | |
| 235 | }); |
test/studio-labels.test.ts added +9
| @@ -0,0 +1,9 @@ | ||
| 1 | import { expect, test } from "bun:test"; | |
| 2 | import { onboardingRow } from "../src/web/onboarding_row.ts"; | |
| 3 | ||
| 4 | // #17637: the line inside the fold-out is the app's standing, never the result of opening it. | |
| 5 | test("the onboarding row says it is the state as it stands", () => { | |
| 6 | const out = String(onboardingRow({ state: "making", text: "The crew is making it run (pull #3)." })); | |
| 7 | expect(out).toContain("As it stands:"); | |
| 8 | expect(out).toContain("The crew is making it run (pull #3)."); | |
| 9 | }); |
new above
offline
Principles 1 and 8: this sentence explains itself and points elsewhere in a parenthetical, on every account row. Say what the number is in plain words and move the 'not the bill' note out. Needs a test too.