Public: anyone can read this; the crew can change it.
Move the remaining own-worded "No …" empty states onto the empty-words table #15898
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/15897-move-the-remaining-own-worded-no-empty-s → main 0 commits fork 2 threads · 2 unresolved
29 files
changed +156
−52
src/core/empty_words.ts +46
| @@ -57,3 +57,49 @@ const TABLE = { | ||
| 57 | 57 | export type EmptyKind = keyof typeof TABLE; |
| 58 | 58 | |
| 59 | 59 | export const EMPTY_WORDS: Readonly<Record<EmptyKind, EmptyWords>> = TABLE; |
| 60 | ||
| 61 | /** | |
| 62 | * The sentence-only empty states: a small note under a card heading, with no action of its own (the | |
| 63 | * page already carries the door). Each key is its sentence in camelCase, so a reader finds a note | |
| 64 | * by the words on the page. Pages call `emptyNote(key)` (`src/web/empty_words.ts`) and should not | |
| 65 | * word their own; `test/empty-notes.test.ts` holds each to one plain sentence and counts the seven | |
| 66 | * that do, which stay because they carry a link, a variable or a reason a plain sentence cannot. | |
| 67 | */ | |
| 68 | export const NOTE_WORDS = { | |
| 69 | nothingToApply: "Nothing to apply.", | |
| 70 | noDescription: "No description.", | |
| 71 | noDevicesDeclared: "No devices declared.", | |
| 72 | noDependenciesListed: "No dependencies listed.", | |
| 73 | nothingIsWaitingToBeSent: "Nothing is waiting to be sent.", | |
| 74 | nothingYet: "Nothing yet.", | |
| 75 | noFlowLinesMatch: "No flow lines match.", | |
| 76 | notSignedInOnAnyBrowser: "Not signed in on any browser.", | |
| 77 | noAccessCodesYet: "No access codes yet. Mint one when a script, a CI job, or another machine needs to act as you.", | |
| 78 | noComputerKeysYet: "No computer keys yet. Add one and git over SSH stops asking for a password.", | |
| 79 | none: "None.", | |
| 80 | nothingToPropose: "Nothing to propose.", | |
| 81 | nothingFound: "Nothing found.", | |
| 82 | noGateHasRunYet: "No gate has run yet.", | |
| 83 | nothingQueuedGatingOrLandedInTheLastHour: "Nothing queued, gating or landed in the last hour.", | |
| 84 | noFileIsTouchedBy3OrMoreOpenPulls: "No file is touched by 3 or more open pulls.", | |
| 85 | noChangeYet: "No change yet.", | |
| 86 | noRepositoryRunsOnItsOwn: "No repository runs on its own.", | |
| 87 | nothingOfferedYet: "Nothing offered yet.", | |
| 88 | noFlagIsDeclaredYet: "No flag is declared yet.", | |
| 89 | nothingProposedToTheParentForgeYet: "Nothing proposed to the parent forge yet.", | |
| 90 | noProcessesWereRead: "No processes were read.", | |
| 91 | noSamplesYet: "No samples yet.", | |
| 92 | noStallsInTheLastHour: "No stalls in the last hour.", | |
| 93 | noFullMinuteMeasuredYet: "No full minute measured yet.", | |
| 94 | noTelemetryReadsInTheLast10Minutes: "No telemetry reads in the last 10 minutes.", | |
| 95 | noForgeHasBeenSentFromHere: "No forge has been sent from here.", | |
| 96 | nothingWaitingWhenTheAgentAsks: "Nothing waiting: when the agent asks before acting, it shows here.", | |
| 97 | noAccessTokens: "No access tokens.", | |
| 98 | noIssuesYet: "No issues yet.", | |
| 99 | noBetsYet: "No bets yet. The planner proposes them from the open work.", | |
| 100 | noScopesYet: "No scopes yet.", | |
| 101 | noAgentIsConnected: "No agent is connected.", | |
| 102 | nobodyIsOnThisTeamYet: "Nobody is on this team yet.", | |
| 103 | } as const; | |
| 104 | ||
| 105 | export type NoteKey = keyof typeof NOTE_WORDS; |
src/web/comments.ts +2 −1
| @@ -6,6 +6,7 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | import type { Mark } from "../core/marks.ts"; |
| 9 | import { emptyNote } from "./empty_words.ts"; | |
| 9 | 10 | import { html, when, type Html } from "./html.ts"; |
| 10 | 11 | import { renderMarkdown } from "./markdown.ts"; |
| 11 | 12 | import { icon, originTag, time, userLink, type IconName } from "./ui.ts"; |
| @@ -32,7 +33,7 @@ export function commentCard(card: CommentCard): Html { | ||
| 32 | 33 | const idAttr = card.id === "" ? html`` : html`data-comment-id="${card.id}" `; |
| 33 | 34 | const bodyHtml = |
| 34 | 35 | card.body.trim() === "" |
| 35 | ? html`<p class="muted">No description.</p>` | |
| 36 | ? emptyNote("noDescription") | |
| 36 | 37 | : renderMarkdown(card.body); |
| 37 | 38 | const byline = |
| 38 | 39 | card.originAuthor != null && card.originAuthor !== "" |
src/web/empty_words.ts +6 −1
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | import { html, type Html } from "./html.ts"; |
| 9 | import { EMPTY_WORDS, type EmptyKind, type EmptyWords } from "../core/empty_words.ts"; | |
| 9 | import { EMPTY_WORDS, NOTE_WORDS, type EmptyKind, type EmptyWords, type NoteKey } from "../core/empty_words.ts"; | |
| 10 | 10 | import { btn, empty, type IconName } from "./ui.ts"; |
| 11 | 11 | |
| 12 | 12 | export { EMPTY_WORDS, type EmptyKind }; |
| @@ -73,3 +73,8 @@ export function emptyLine(kind: Exclude<EmptyKind, keyof typeof ICONS>, o: { rea | ||
| 73 | 73 | const reason = o.reason ?? w.reason; |
| 74 | 74 | return html`<p class="muted small">${reason === undefined ? w.sentence : `${w.sentence} ${reason}`}</p>`; |
| 75 | 75 | } |
| 76 | ||
| 77 | /** A sentence-only empty state: the table's words in a muted paragraph, escaped by `html`. */ | |
| 78 | export function emptyNote(key: NoteKey): Html { | |
| 79 | return html`<p class="muted">${NOTE_WORDS[key]}</p>`; | |
| 80 | } |
src/web/fleet-act.ts +2 −1
| @@ -5,6 +5,7 @@ | ||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | import { pickedWords, UNDO_WINDOW_MS, type Plan } from "../actions/fleet.ts"; |
| 8 | import { emptyNote } from "./empty_words.ts"; | |
| 8 | 9 | import type { FleetValue, Operation } from "../core/fleet_ops.ts"; |
| 9 | 10 | import { digestOf } from "../fleet/digest.ts"; |
| 10 | 11 | import type { FleetKind } from "../fleet/selection.ts"; |
| @@ -107,7 +108,7 @@ export function previewSection( | ||
| 107 | 108 | </p> |
| 108 | 109 | ${lines(plan.rows)} |
| 109 | 110 | ${change === 0 |
| 110 | ? html`<p class="muted">Nothing to apply.</p>` | |
| 111 | ? emptyNote("nothingToApply") | |
| 111 | 112 | : html`<form method="post" action="/fleet" class="form-actions"> |
| 112 | 113 | <input type="hidden" name="q" value="${plan.query}" /> |
| 113 | 114 | <input type="hidden" name="step" value="apply" /> |
src/web/pages/account.ts +4 −3
| @@ -10,6 +10,7 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | import { UPSTREAM_REPO } from "../../core/upstream.ts"; |
| 13 | import { emptyNote } from "../empty_words.ts"; | |
| 13 | 14 | import { resendVerification } from "../../actions/verify.ts"; |
| 14 | 15 | import { clientAddress } from "../../http/peer.ts"; |
| 15 | 16 | import { emailVerified } from "../../core/verify.ts"; |
| @@ -844,7 +845,7 @@ export function sessionsCard( | ||
| 844 | 845 | return block( |
| 845 | 846 | "Signed-in browsers", |
| 846 | 847 | html`${sessions.length === 0 |
| 847 | ? html`<p class="muted">Not signed in on any browser.</p>` | |
| 848 | ? emptyNote("notSignedInOnAnyBrowser") | |
| 848 | 849 | : html`<ul class="list setting-list"> |
| 849 | 850 | ${sessions.map((x) => |
| 850 | 851 | row({ |
| @@ -913,7 +914,7 @@ function tokensView(ctx: Ctx): Html { | ||
| 913 | 914 | // so the list says so beside it (#12466). |
| 914 | 915 | const actsAsAdmin = ctx.auth.user!.isAdmin ? badge(ACTS_AS_ADMIN_WORDS) : null; |
| 915 | 916 | const list = tokens.length === 0 |
| 916 | ? html`<p class="muted">No access codes yet. Mint one when a script, a CI job, or another machine needs to act as you.</p>` | |
| 917 | ? emptyNote("noAccessCodesYet") | |
| 917 | 918 | : html`<ul class="list setting-list"> |
| 918 | 919 | ${tokens.map((t) => |
| 919 | 920 | row({ |
| @@ -1085,7 +1086,7 @@ function keysView( | ||
| 1085 | 1086 | ${block( |
| 1086 | 1087 | "Computer keys", |
| 1087 | 1088 | keys.length === 0 |
| 1088 | ? html`<p class="muted">No computer keys yet. Add one and git over SSH stops asking for a password.</p>` | |
| 1089 | ? emptyNote("noComputerKeysYet") | |
| 1089 | 1090 | : html`<ul class="list setting-list"> |
| 1090 | 1091 | ${keys.map((k) => |
| 1091 | 1092 | row({ |
src/web/pages/accounts.ts +3 −2
| @@ -6,6 +6,7 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | import { sshOn } from "../../settings/ssh.ts"; |
| 9 | import { emptyNote } from "../empty_words.ts"; | |
| 9 | 10 | import { |
| 10 | 11 | listAccounts, |
| 11 | 12 | removeAccount, |
| @@ -377,7 +378,7 @@ export function personSignInsPage(ctx: Ctx): Response { | ||
| 377 | 378 | const signIns = html`<section class="settings-block" id="sign-ins"> |
| 378 | 379 | <h2>Signed in now</h2> |
| 379 | 380 | ${sessions.length === 0 |
| 380 | ? html`<p class="muted">Not signed in on any browser.</p>` | |
| 381 | ? emptyNote("notSignedInOnAnyBrowser") | |
| 381 | 382 | : html`<ul class="list setting-list"> |
| 382 | 383 | ${sessions.slice(0, 5).map((x) => |
| 383 | 384 | row({ |
| @@ -419,7 +420,7 @@ export function personSignInsPage(ctx: Ctx): Response { | ||
| 419 | 420 | <h2>Access tokens</h2> |
| 420 | 421 | <p class="muted">Revoking one ends it at once; the person can sign in again.</p> |
| 421 | 422 | ${tokens.length === 0 |
| 422 | ? html`<p class="muted">No access tokens.</p>` | |
| 423 | ? emptyNote("noAccessTokens") | |
| 423 | 424 | : html`<ul class="list setting-list"> |
| 424 | 425 | ${tokens.map((t) => |
| 425 | 426 | row({ |
src/web/pages/bets.ts +4 −3
| @@ -11,6 +11,7 @@ import { | ||
| 11 | 11 | backBet, betEstimate, capBet, endBet, giveVerdict, oneLine, proposeBets, stopBet, writeLeft, |
| 12 | 12 | } from "../../actions/bets.ts"; |
| 13 | 13 | import { type Bet, betReceipts, type BetReceipt, betRuns, betScopes, betSpentSince, getBet, listBets } from "../../core/bets.ts"; |
| 14 | import { emptyNote } from "../empty_words.ts"; | |
| 14 | 15 | import { getUserById } from "../../core/users.ts"; |
| 15 | 16 | import { canAdmin, type Repo } from "../../core/repos.ts"; |
| 16 | 17 | import { capStanding, dayStart, money } from "../../crew/bet_cap.ts"; |
| @@ -121,7 +122,7 @@ function proposedRow(ctx: Ctx, repo: Repo, b: Bet, backed: readonly Bet[], now: | ||
| 121 | 122 | const why = mayBack(backed, b.appetite) |
| 122 | 123 | ?? (estimate === null || estimate.short === 0 ? null : WALLET_WAY_OUT); |
| 123 | 124 | const issues = scopes.length === 0 |
| 124 | ? html`<p class="muted">No issues yet.</p>` | |
| 125 | ? emptyNote("noIssuesYet") | |
| 125 | 126 | : html`<details><summary>${scopes.length} ${scopes.length === 1 ? "issue" : "issues"}</summary> |
| 126 | 127 | <ul>${scopes.map((s) => html`<li><a href="${repoBase(repo)}/issues/${s.number}">#${s.number} ${s.title}</a></li>`)}</ul> |
| 127 | 128 | </details>`; |
| @@ -178,7 +179,7 @@ export function betsPage(ctx: Ctx): Response { | ||
| 178 | 179 | const body = html`${repoHeader(ctx, repo, "issues")} |
| 179 | 180 | ${pageHead("Bets", { sub: `A few named wholes, each with a share of the week. ${running} of ${MAX_BACKED} running. Builders pick only from running bets, the owner's own asks and small fixes.` })} |
| 180 | 181 | ${bets.length === 0 |
| 181 | ? html`<p class="muted">No bets yet. The planner proposes them from the open work.</p>` | |
| 182 | ? emptyNote("noBetsYet") | |
| 182 | 183 | : html`${rows([...(owner ? proposed.map((b) => proposedRow(ctx, repo, b, backed, now)) : []), ...rest.map((b) => betRow(ctx, repo, b, now, owner, receipts))])}`} |
| 183 | 184 | ${owner |
| 184 | 185 | ? html`<form method="post" action="${repoBase(repo)}/bets/propose" class="mt">${btn("Ask the planner to propose bets", { variant: "secondary" })}</form>` |
| @@ -244,7 +245,7 @@ export function betPage(ctx: Ctx): Response { | ||
| 244 | 245 | ${owner ? html`<h2 class="mt">Done looks like</h2> |
| 245 | 246 | <ul>${bet.journeys.split("\n").filter((j) => j !== "").map((j) => html`<li>${j}</li>`)}</ul>` : null} |
| 246 | 247 | <h2 class="mt">Scopes</h2> |
| 247 | ${scopes.length === 0 ? html`<p class="muted">No scopes yet.</p>` : rows(scopeRows)} | |
| 248 | ${scopes.length === 0 ? emptyNote("noScopesYet") : rows(scopeRows)} | |
| 248 | 249 | ${leftBox} |
| 249 | 250 | ${owner ? html`<div class="mt">${ownerActions(repo, bet)}</div>` : null} |
| 250 | 251 | ${liveMount({ repo: repoBase(repo) })}`; |
src/web/pages/billing.ts +2 −1
| @@ -6,6 +6,7 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | import { sshOn } from "../../settings/ssh.ts"; |
| 9 | import { emptyNote } from "../empty_words.ts"; | |
| 9 | 10 | import { ledBlock } from "./visitors.ts"; |
| 10 | 11 | import { BILLING_WORDS, STRIPE_WORDS, connectStripe, disconnectStripe, grantPlan, planGrant, readBilling, saveSigningSecret, type BillingError, type StripeWords } from "../../actions/billing.ts"; |
| 11 | 12 | import { retryOrder } from "../../actions/order.ts"; |
| @@ -263,7 +264,7 @@ function billingView(ctx: Ctx, shown?: Shown, status = 200, refusal?: Refused): | ||
| 263 | 264 | <h2>Plans</h2> |
| 264 | 265 | <p class="muted small">Choose the plan each forge is on.</p> |
| 265 | 266 | ${rows.length === 0 |
| 266 | ? html`<p class="muted">No forge has been sent from here.</p>` | |
| 267 | ? emptyNote("noForgeHasBeenSentFromHere") | |
| 267 | 268 | : html`<ul class="list setting-list">${rows}</ul>`} |
| 268 | 269 | </section> |
| 269 | 270 | ${ledBlock(ctx)} |
src/web/pages/boards-gates.ts +2 −1
| @@ -10,6 +10,7 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | import type { Database } from "bun:sqlite"; |
| 13 | import { emptyNote } from "../empty_words.ts"; | |
| 13 | 14 | import type { App } from "../../app.ts"; |
| 14 | 15 | import { gatesForReader } from "../../actions/runs.ts"; |
| 15 | 16 | import { getRepoById } from "../../core/repos.ts"; |
| @@ -107,7 +108,7 @@ export function gatesSection(app: App, owner: boolean, now: number, reader?: Use | ||
| 107 | 108 | return fold( |
| 108 | 109 | "Last gates", |
| 109 | 110 | top.length === 0 ? "no gate has run yet" : `the last ${String(top.length)}: ${String(top.length - red)} green or cut off, ${String(red)} red`, |
| 110 | top.length === 0 ? html`<p class="muted">No gate has run yet.</p>` : html`<ul class="list">${top.map((l) => gateRow(l, now))}</ul>`, | |
| 111 | top.length === 0 ? emptyNote("noGateHasRunYet") : html`<ul class="list">${top.map((l) => gateRow(l, now))}</ul>`, | |
| 111 | 112 | { id: "gates" }, |
| 112 | 113 | ); |
| 113 | 114 | } |
src/web/pages/boards-held.ts +2 −1
| @@ -6,6 +6,7 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | import { HOLDS } from "../../crew/held.ts"; |
| 9 | import { emptyNote } from "../empty_words.ts"; | |
| 9 | 10 | import type { HeldRow } from "../../flow/held.ts"; |
| 10 | 11 | import { html, type Html } from "../html.ts"; |
| 11 | 12 | import { meter } from "../ui.ts"; |
| @@ -38,7 +39,7 @@ export function heldCard(rows: readonly HeldRow[]): Html { | ||
| 38 | 39 | "Ready, and why it waits", |
| 39 | 40 | rows.length === 0 ? "no repository runs on its own" : `${count(can)} can start now, ${count(held)} ${held === 1 ? "is" : "are"} held`, |
| 40 | 41 | html`${rows.length === 0 |
| 41 | ? html`<p class="muted">No repository runs on its own.</p>` | |
| 42 | ? emptyNote("noRepositoryRunsOnItsOwn") | |
| 42 | 43 | : html`<div class="table-scroll"> |
| 43 | 44 | <table class="table" data-dense aria-label="Ready, and why it waits"> |
| 44 | 45 | <thead> |
src/web/pages/chain.ts +2 −1
| @@ -6,6 +6,7 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | import { FAMILY_WORDS } from "../../actions/family_words.ts"; |
| 9 | import { emptyNote } from "../empty_words.ts"; | |
| 9 | 10 | import { FOLLOW_MODE_REFUSALS, followModeSaid, setFollowMode, severForge, takeForgeCode, takeForgeWords } from "../../actions/follow.ts"; |
| 10 | 11 | import { FOLLOWS_NOTHING, PROPOSE_NEEDS_WRITE } from "../../actions/follow_words.ts"; |
| 11 | 12 | import { forgeProposals, proposeToParentForge, type ForgeProposal } from "../../actions/upstream.ts"; |
| @@ -83,7 +84,7 @@ const STATE_WORDS = { open: "open", merged: "merged", closed: "closed" } as cons | ||
| 83 | 84 | export function proposalSection(base: string, proposals: readonly ForgeProposal[], writer: boolean): Html { |
| 84 | 85 | return html`<h2 class="mt">Proposals</h2> |
| 85 | 86 | ${proposals.length === 0 |
| 86 | ? html`<p class="muted">Nothing proposed to the parent forge yet.</p>` | |
| 87 | ? emptyNote("nothingProposedToTheParentForgeYet") | |
| 87 | 88 | : html`<ul class="list" aria-label="Proposals to the parent forge"> |
| 88 | 89 | ${proposals.map( |
| 89 | 90 | (p) => html`<li> |
src/web/pages/confirms.ts +2 −1
| @@ -8,6 +8,7 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | import { sshOn } from "../../settings/ssh.ts"; |
| 11 | import { emptyNote } from "../empty_words.ts"; | |
| 11 | 12 | import { REFUSED, sayYes, waitingConfirms } from "../../actions/conversation_confirms.ts"; |
| 12 | 13 | import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.ts"; |
| 13 | 14 | import { ASKING } from "../../crew/conversation_confirm.ts"; |
| @@ -33,7 +34,7 @@ function confirmsPage(ctx: Ctx, shown?: Html): Response { | ||
| 33 | 34 | <section class="settings-block" id="waiting"> |
| 34 | 35 | <h2>Waiting for you</h2> |
| 35 | 36 | ${waiting.length === 0 |
| 36 | ? html`<p class="muted">Nothing waiting: when the agent asks before acting, it shows here.</p>` | |
| 37 | ? emptyNote("nothingWaitingWhenTheAgentAsks") | |
| 37 | 38 | : html`<ul class="list setting-list" id="confirms-list"> |
| 38 | 39 | ${waiting.map((w) => |
| 39 | 40 | row({ |
src/web/pages/economics.ts +2 −1
| @@ -14,6 +14,7 @@ | ||
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | import { sshOn } from "../../settings/ssh.ts"; |
| 17 | import { emptyNote } from "../empty_words.ts"; | |
| 17 | 18 | import { ECONOMICS_WORDS, changeEconomics, readEconomics } from "../../actions/economics.ts"; |
| 18 | 19 | import { MARGIN_MAX, POSITION_MAX, POSITION_MIN, PRICE_MAX_CENTS, SLOTS_MAX, usdOfCents } from "../../core/slider.ts"; |
| 19 | 20 | import { OWNED_NODE_LABEL_DEFAULT } from "../../core/placement_policy.ts"; |
| @@ -151,7 +152,7 @@ export function economicsPage(ctx: Ctx): Response { | ||
| 151 | 152 | <section class="settings-block"> |
| 152 | 153 | <h2>Changes</h2> |
| 153 | 154 | ${history.length === 0 |
| 154 | ? html`<p class="muted">No change yet.</p>` | |
| 155 | ? emptyNote("noChangeYet") | |
| 155 | 156 | : html`<ul class="list setting-list"> |
| 156 | 157 | ${history} |
| 157 | 158 | </ul>`} |
src/web/pages/findings.ts +2 −1
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | import { acceptFinding, REASON_MAX, REASON_MIN } from "../../actions/scan_accept.ts"; |
| 10 | import { emptyNote } from "../empty_words.ts"; | |
| 10 | 11 | import { lastScan, listFindings, type FindingRow } from "../../checks/scan_store.ts"; |
| 11 | 12 | import { canWrite } from "../../core/repos.ts"; |
| 12 | 13 | import type { Ctx } from "../../http/context.ts"; |
| @@ -60,7 +61,7 @@ export function findingsPage(ctx: Ctx): Response { | ||
| 60 | 61 | <section class="mt"> |
| 61 | 62 | <h2>Findings</h2> |
| 62 | 63 | ${rows.length === 0 |
| 63 | ? html`<p class="muted">Nothing found.</p>` | |
| 64 | ? emptyNote("nothingFound") | |
| 64 | 65 | : html`<ul class="list"> |
| 65 | 66 | ${rows.map((f) => findingRow(f, base, writer))} |
| 66 | 67 | </ul>`} |
src/web/pages/flags.ts +2 −1
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | import { sshOn } from "../../settings/ssh.ts"; |
| 10 | import { emptyNote } from "../empty_words.ts"; | |
| 10 | 11 | import { readFlags } from "../../actions/flags_view.ts"; |
| 11 | 12 | import { checkInput, FLAGS_ADMIN_ONLY, flagRegistry, usesLine, winnerOffer, mayManageFlags, useFlagRegistry, type FlagValue } from "../../core/flags.ts"; |
| 12 | 13 | import { makeWinnerDefault } from "../../actions/flag_winner.ts"; |
| @@ -110,7 +111,7 @@ export function flagsPage(ctx: Ctx): Response { | ||
| 110 | 111 | const body = html`<section class="settings-block"> |
| 111 | 112 | <h2>Flags</h2> |
| 112 | 113 | ${names.length === 0 |
| 113 | ? html`<p class="muted">No flag is declared yet.</p>` | |
| 114 | ? emptyNote("noFlagIsDeclaredYet") | |
| 114 | 115 | : html`<ul class="list setting-list"> |
| 115 | 116 | ${rows} |
| 116 | 117 | </ul>`} |
src/web/pages/flow-panel.ts +4 −3
| @@ -8,6 +8,7 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | import { lineSaid } from "../../git/pace.ts"; |
| 11 | import { emptyNote } from "../empty_words.ts"; | |
| 11 | 12 | import { MERGE_QUEUE_HELP } from "../../flow/help.ts"; |
| 12 | 13 | import { helpAsked, pageHelp } from "../page_help.ts"; |
| 13 | 14 | import { HELD_EXPLAINED } from "./boards-held.ts"; |
| @@ -327,7 +328,7 @@ function queueCard(rows: readonly QueueRow[]): Html { | ||
| 327 | 328 | "Merge queue", |
| 328 | 329 | `${queued === 0 ? "nothing queued" : `${count(queued)} queued`}; ${count(landedHour)} landed in the last hour`, |
| 329 | 330 | html`${rows.length === 0 |
| 330 | ? html`<p class="muted">Nothing queued, gating or landed in the last hour.</p>` | |
| 331 | ? emptyNote("nothingQueuedGatingOrLandedInTheLastHour") | |
| 331 | 332 | : html`<div class="table-scroll"> |
| 332 | 333 | <table class="table" data-dense aria-label="Merge queue"> |
| 333 | 334 | <thead> |
| @@ -367,7 +368,7 @@ function outList(t: StageFlow, hour: number | null, now: number): Html { | ||
| 367 | 368 | return card( |
| 368 | 369 | html`<h2>${STAGE_LABEL[t.key]}: ${String(items.length)} ${OUTFLOW[t.key].label} ${hourWords(hour)}</h2> |
| 369 | 370 | ${items.length === 0 |
| 370 | ? html`<p class="muted">None.</p>` | |
| 371 | ? emptyNote("none") | |
| 371 | 372 | : html`<ul> |
| 372 | 373 | ${items.map( |
| 373 | 374 | (i) => |
| @@ -405,7 +406,7 @@ function hotFilesCard(app: App, reader: Reader): Html { | ||
| 405 | 406 | "Hot files", |
| 406 | 407 | top.length === 0 ? "no file is touched by 3 or more open pulls" : `${count(top.length)} ${top.length === 1 ? "file" : "files"} touched by 3 or more open pulls`, |
| 407 | 408 | html`${top.length === 0 |
| 408 | ? html`<p class="muted">No file is touched by 3 or more open pulls.</p>` | |
| 409 | ? emptyNote("noFileIsTouchedBy3OrMoreOpenPulls") | |
| 409 | 410 | : html`<ul> |
| 410 | 411 | ${top.map( |
| 411 | 412 | (r) => |
src/web/pages/flows-all.ts +2 −1
| @@ -5,6 +5,7 @@ | ||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | import { sshOn } from "../../settings/ssh.ts"; |
| 8 | import { emptyNote } from "../empty_words.ts"; | |
| 8 | 9 | import { ALL_KINDS, parseKind, readAllFlows } from "../../flows/all.ts"; |
| 9 | 10 | import type { Health } from "../../flows/view.ts"; |
| 10 | 11 | import type { Ctx } from "../../http/context.ts"; |
| @@ -47,7 +48,7 @@ export function allFlowsPage(ctx: Ctx): Response { | ||
| 47 | 48 | ); |
| 48 | 49 | const body = html`${pageHead("Flows across the forge", { sub: `${lines.length} ${lines.length === 1 ? "line" : "lines"}${lines.length > SHOWN ? `, the newest ${SHOWN} shown` : ""}.` })} |
| 49 | 50 | ${filters} |
| 50 | ${rows.length === 0 ? html`<p class="muted">No flow lines match.</p>` : listCard(rows)}`; | |
| 51 | ${rows.length === 0 ? emptyNote("noFlowLinesMatch") : listCard(rows)}`; | |
| 51 | 52 | const response = page({ ctx, title: "Flows · admin", body: settingsLayout(accountSections("adminflows", { admin: true, ssh: sshOn(ctx.app.db) }), body, "Account settings") }); |
| 52 | 53 | notePhase(ctx.request, "render", performance.now() - rendering); |
| 53 | 54 | return response; |
src/web/pages/fork-offers.ts +2 −1
| @@ -7,6 +7,7 @@ import { forkParentFor, type Repo } from "../../core/repos.ts"; | ||
| 7 | 7 | import type { Ctx } from "../../http/context.ts"; |
| 8 | 8 | import { sizeLine, type OfferSizeResult } from "../../git/offer_size.ts"; |
| 9 | 9 | import { loadRepo, notFoundPage, pageHead, repoBase } from "../chrome.ts"; |
| 10 | import { emptyNote } from "../empty_words.ts"; | |
| 10 | 11 | import { html, type Html } from "../html.ts"; |
| 11 | 12 | import { page } from "../layout.ts"; |
| 12 | 13 | import { confirmAction, time } from "../ui.ts"; |
| @@ -76,7 +77,7 @@ export function sentOffersPage(ctx: Ctx): Response { | ||
| 76 | 77 | title: "Offers", |
| 77 | 78 | body: html`<div class="narrow-wide"> |
| 78 | 79 | ${pageHead("Offers", { sub: `What ${fork.ownerName}/${fork.name} has sent upstream, newest first.` })} |
| 79 | ${list ?? html`<p class="muted">Nothing offered yet</p>`} | |
| 80 | ${list ?? emptyNote("nothingOfferedYet")} | |
| 80 | 81 | </div>`, |
| 81 | 82 | })); |
| 82 | 83 | } |
src/web/pages/grants.ts +2 −1
| @@ -8,6 +8,7 @@ | ||
| 8 | 8 | * `screens/oauthgrants.ts` shares. |
| 9 | 9 | */ |
| 10 | 10 | import { myOAuthGrants, revokeOAuthGrant, revokedWords } from "../../actions/oauth_grants.ts"; |
| 11 | import { emptyNote } from "../empty_words.ts"; | |
| 11 | 12 | import type { OAuthGrant } from "../../core/oauth_grants.ts"; |
| 12 | 13 | import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.ts"; |
| 13 | 14 | import type { Ctx } from "../../http/context.ts"; |
| @@ -47,7 +48,7 @@ function grantRow(g: OAuthGrant): Html { | ||
| 47 | 48 | function grantsView(grants: readonly OAuthGrant[]): Html { |
| 48 | 49 | const list = |
| 49 | 50 | grants.length === 0 |
| 50 | ? html`<p class="muted">No agent is connected.</p>` | |
| 51 | ? emptyNote("noAgentIsConnected") | |
| 51 | 52 | : html`<ul class="list setting-list" data-grants> |
| 52 | 53 | ${grants.map(grantRow)} |
| 53 | 54 | </ul>`; |
src/web/pages/maintenance.ts +2 −1
| @@ -5,6 +5,7 @@ | ||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | import { json } from "../../http/respond.ts"; |
| 8 | import { emptyNote } from "../empty_words.ts"; | |
| 8 | 9 | import { notePhase, takeSessionTime } from "../../core/route_timing.ts"; |
| 9 | 10 | import { dutyStates, switchDuty } from "../../maintain/pause.ts"; |
| 10 | 11 | import { DISMISS_DAYS, REASON_MAX, dismiss, dismissals, dismissalWords } from "../../maintain/dismiss.ts"; |
| @@ -323,7 +324,7 @@ export async function maintenanceUnquiet(ctx: Ctx): Promise<Response> { | ||
| 323 | 324 | function staleRows(withActions: boolean, pulls: ReturnType<typeof stalePulls>): Html { |
| 324 | 325 | const form = (id: string, what: "nudge" | "close", label: string): Html => |
| 325 | 326 | html`<form method="post" action="/maintenance/stale/${id}/${what}" class="inline">${btn(label, { variant: "outline" })}</form>`; |
| 326 | if (pulls.length === 0) return html`<p class="muted">None.</p>`; | |
| 327 | if (pulls.length === 0) return emptyNote("none"); | |
| 327 | 328 | return html`<dl class="status-rows">${pulls.map( |
| 328 | 329 | (p) => html`<div class="status-row" data-pull="${p.repo}#${String(p.number)}"><dt><a href="/${p.repo}/pulls/${String(p.number)}">${p.repo}#${String(p.number)}</a></dt> |
| 329 | 330 | <dd>${p.title} <span class="muted">${String(p.ageDays)} days</span> |
src/web/pages/org.ts +2 −1
| @@ -10,6 +10,7 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | import { USERNAME_PATTERN } from "../username_pattern.ts"; |
| 13 | import { emptyNote } from "../empty_words.ts"; | |
| 13 | 14 | import { |
| 14 | 15 | addTeamMember, |
| 15 | 16 | createOrg, |
| @@ -634,7 +635,7 @@ export function teamPage(ctx: Ctx): Response { | ||
| 634 | 635 | <section class="settings-block"> |
| 635 | 636 | <h2>Members</h2> |
| 636 | 637 | ${members.length === 0 |
| 637 | ? html`<p class="muted">Nobody is on this team yet.</p>` | |
| 638 | ? emptyNote("nobodyIsOnThisTeamYet") | |
| 638 | 639 | : html`<ul class="list setting-list"> |
| 639 | 640 | ${members.map((m) => |
| 640 | 641 | row({ |
src/web/pages/system.ts +6 −5
| @@ -22,6 +22,7 @@ | ||
| 22 | 22 | * against its size (#10853, `spawn/usage.ts`). |
| 23 | 23 | */ |
| 24 | 24 | import { askingOf, type Asker } from "../../perf/asking.ts"; |
| 25 | import { emptyNote } from "../empty_words.ts"; | |
| 25 | 26 | import { sentinelRepoPath, withheldFindings, type WithheldFinding } from "../../crew/sentinel.ts"; |
| 26 | 27 | import { ownRepoRate, rateLine, RATE_MIN, type Rate } from "../../checks/deepsec_rate.ts"; |
| 27 | 28 | import { turnStatsOf } from "../../http/app_turn.ts"; |
| @@ -298,7 +299,7 @@ export function inProcessSection(rows: readonly ChildHour[]): Html { | ||
| 298 | 299 | const KIND_ORDER = ["forge", "crew", "check", "app", "host"] as const; |
| 299 | 300 | function procTable(v: SystemView): Html { |
| 300 | 301 | const groups = KIND_ORDER.flatMap((k) => v.groups.filter((g) => g.kind === k)); |
| 301 | if (groups.length === 0) return html`<p class="muted">No processes were read.</p>`; | |
| 302 | if (groups.length === 0) return emptyNote("noProcessesWereRead"); | |
| 302 | 303 | return html`<div class="table-scroll"><table class="table" data-dense aria-label="Processes by what launched them"> |
| 303 | 304 | <thead><tr><th scope="col">pid</th><th scope="col">command</th><th scope="col" class="num">cpu</th><th scope="col" class="num">mem</th><th scope="col" class="num">age</th></tr></thead> |
| 304 | 305 | ${groups.map( |
| @@ -373,7 +374,7 @@ function memorySection(ctx: Ctx): Html { | ||
| 373 | 374 | const series = (title: string, pick: (h: (typeof hours)[number]) => number) => |
| 374 | 375 | html`<div><h3 class="small">${title}</h3>${chartBox("line", hours.map((h) => ({ label: hhmm(h.at).slice(11), value: pick(h) / 1_048_576 })), title)}</div>`; |
| 375 | 376 | return html`<section class="settings-block" id="sys-memory"><h2>Forge memory</h2>${hours.length === 0 |
| 376 | ? html`<p class="muted">No samples yet.</p>` | |
| 377 | ? emptyNote("noSamplesYet") | |
| 377 | 378 | : html`<div class="plots">${series("RSS (MiB, hourly mean)", (h) => h.rssMean)}${series("JS heap (MiB, hourly mean)", (h) => h.heapMean)}</div> |
| 378 | 379 | <div class="table-scroll"><table class="table" aria-label="Forge memory by hour"> |
| 379 | 380 | <thead><tr><th scope="col">Hour (UTC)</th><th scope="col" class="num">RSS mean</th><th scope="col" class="num">RSS max</th><th scope="col" class="num">Heap mean</th><th scope="col" class="num">Heap max</th></tr></thead> |
| @@ -560,7 +561,7 @@ export function restoreSection(l: RestoreLine): Html { | ||
| 560 | 561 | export function stallSection(rows: readonly RouteStall[], worst: Html = html``): Html { |
| 561 | 562 | return html`<section class="settings-block"><h2>Main-thread stalls, last hour</h2>${ |
| 562 | 563 | rows.length === 0 |
| 563 | ? html`<p class="muted">No stalls in the last hour.</p>` | |
| 564 | ? emptyNote("noStallsInTheLastHour") | |
| 564 | 565 | : html`<div class="table-scroll"><table class="table" aria-label="Main-thread stalls by route, last hour"> |
| 565 | 566 | <thead><tr><th scope="col">Route</th><th scope="col" class="num">Stall ms</th><th scope="col" class="num">Stalls</th></tr></thead> |
| 566 | 567 | <tbody>${rows.map((r) => html`<tr data-route="${r.route}"><td class="mono">${r.route}</td><td class="num mono">${String(Math.round(r.ms))}</td><td class="num mono">${String(r.count)}</td></tr>`)}</tbody> |
| @@ -612,7 +613,7 @@ export function lagSection(rows: readonly LagReading[]): Html { | ||
| 612 | 613 | const over = overBar(rows); |
| 613 | 614 | return html`<div id="sys-lag" data-readings="${String(rows.length)}" data-over="${String(over)}"><section class="settings-block"><h2>Loop lag, last ${String(LAG_READINGS)} minutes</h2>${ |
| 614 | 615 | rows.length === 0 |
| 615 | ? html`<p class="muted">No full minute measured yet.</p>` | |
| 616 | ? emptyNote("noFullMinuteMeasuredYet") | |
| 616 | 617 | : html`<div class="row-meta">${over === 0 ? badge(`all ${String(rows.length)} under ${String(LAG_BAR_MS)} ms`) : badge(`${String(over)} of ${String(rows.length)} over ${String(LAG_BAR_MS)} ms`, { tone: "danger" })}</div> |
| 617 | 618 | <div class="table-scroll"><table class="table" aria-label="Worst loop lag each minute against the ${String(LAG_BAR_MS)} ms bar"> |
| 618 | 619 | <thead><tr><th scope="col">Minute</th><th scope="col" class="num">Worst ms</th><th scope="col">What ran</th></tr></thead> |
| @@ -654,7 +655,7 @@ export function readersSection(rows: readonly ReaderPace[]): Html { | ||
| 654 | 655 | const secs = (ms: number | null): string => (ms === null ? "—" : `${(ms / 1000).toFixed(1)} s`); |
| 655 | 656 | return html`<section class="settings-block"><h2>Telemetry readers</h2>${ |
| 656 | 657 | rows.length === 0 |
| 657 | ? html`<p class="muted">No telemetry reads in the last 10 minutes.</p>` | |
| 658 | ? emptyNote("noTelemetryReadsInTheLast10Minutes") | |
| 658 | 659 | : html`<div class="table-scroll"><table class="table" aria-label="Telemetry readers, last 10 minutes"> |
| 659 | 660 | <thead><tr><th scope="col">Route</th><th scope="col">Reader</th><th scope="col" class="num">Reads, 10 min</th><th scope="col" class="num">Mean interval</th><th scope="col"></th></tr></thead> |
| 660 | 661 | <tbody>${rows.map((r) => html`<tr data-route="${r.route}" data-reader="${r.reader}"><td class="mono">${r.route}</td><td class="mono">${r.reader}</td><td class="num mono">${String(r.reads)}</td><td class="num mono">${secs(r.meanIntervalMs)}</td><td>${r.tooFast ? badge("faster than the flow copy changes", { tone: "danger" }) : null}</td></tr>`)}</tbody> |
src/web/pages/week.ts +2 −1
| @@ -5,6 +5,7 @@ | ||
| 5 | 5 | * and nothing else on the page changes anything. |
| 6 | 6 | */ |
| 7 | 7 | import { takeProposal } from "../../actions/week.ts"; |
| 8 | import { emptyNote } from "../empty_words.ts"; | |
| 8 | 9 | import { whileFull, whileFullLine } from "../../checks/full_window_recheck.ts"; |
| 9 | 10 | import { allowanceLine } from "../../crew/week_read.ts"; |
| 10 | 11 | import { polishSpend } from "../../crew/polish_share.ts"; |
| @@ -55,7 +56,7 @@ function screen(base: string, retro: Retro, taken: ReadonlySet<number>, writer: | ||
| 55 | 56 | ${block( |
| 56 | 57 | "Proposed changes", |
| 57 | 58 | proposals.length === 0 |
| 58 | ? html`<p class="muted">Nothing to propose.</p>` | |
| 59 | ? emptyNote("nothingToPropose") | |
| 59 | 60 | : html`<p class="muted">${writer ? "Nothing changes until you tap." : "Only someone who writes here can take it."}</p> |
| 60 | 61 | <ul class="list setting-list">${proposals.map((pr, idx) => |
| 61 | 62 | row({ |
src/web/render/deps-manifest.ts +2 −1
| @@ -8,6 +8,7 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | import { html, type Html } from "../html.ts"; |
| 11 | import { emptyNote } from "../empty_words.ts"; | |
| 11 | 12 | import { fileSize } from "../ui.ts"; |
| 12 | 13 | import type { Json } from "./json-doc.ts"; |
| 13 | 14 | import type { Rendered, RenderInput } from "./renderers.ts"; |
| @@ -222,7 +223,7 @@ export function depsManifest(input: RenderInput): Rendered { | ||
| 222 | 223 | const more = s.total - s.rows.length; |
| 223 | 224 | return html`<h3>${s.title}</h3><div class="table-scroll"><table class="table" data-dense aria-label="${s.title}"><thead><tr>${s.columns.map((c) => html`<th scope="col">${c}</th>`)}</tr></thead><tbody>${rows}</tbody></table></div>${more > 0 ? html`<p class="muted small">${more} more not shown</p>` : html``}`; |
| 224 | 225 | }); |
| 225 | const content = html`<div class="package-view"><h2>${doc.title}</h2>${doc.facts.length > 0 ? html`<p class="muted small">${doc.facts.join(" · ")}</p>` : html``}${blocks.length > 0 ? blocks : html`<p class="muted">No dependencies listed.</p>`}</div>`; | |
| 226 | const content = html`<div class="package-view"><h2>${doc.title}</h2>${doc.facts.length > 0 ? html`<p class="muted small">${doc.facts.join(" · ")}</p>` : html``}${blocks.length > 0 ? blocks : emptyNote("noDependenciesListed")}</div>`; | |
| 226 | 227 | const n = doc.sections.reduce((a, s) => a + s.total, 0); |
| 227 | 228 | return { content, lines: 0, summary: `${n} ${n === 1 ? "entry" : "entries"} · ${fileSize(input.size)}` }; |
| 228 | 229 | } |
src/web/settings/devices.ts +2 −1
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | import { sshOn } from "../../settings/ssh.ts"; |
| 10 | import { emptyNote } from "../empty_words.ts"; | |
| 10 | 11 | import type { Ctx } from "../../http/context.ts"; |
| 11 | 12 | import { DEVICE_ERRORS, declare, setCap, grant, revoke, devicesWithStatus, remove, statusLine } from "../../actions/devices.ts"; |
| 12 | 13 | import { allAppSlugs } from "../../core/device_grants.ts"; |
| @@ -119,7 +120,7 @@ export async function devicesPage(ctx: Ctx): Promise<Response> { | ||
| 119 | 120 | accountSections("devices", { admin: true, ssh: sshOn(ctx.app.db) }), |
| 120 | 121 | html`<section class="settings-block"> |
| 121 | 122 | <p class="muted">Printers on your network, as the forge sees them; only addresses like 192.168.1.161 are accepted.</p> |
| 122 | ${when(devices.length === 0, () => html`<p class="muted">No devices declared.</p>`)} | |
| 123 | ${when(devices.length === 0, () => emptyNote("noDevicesDeclared"))} | |
| 123 | 124 | ${when(devices.length > 0, () => html`<ul class="list setting-list">${devices.map((d) => card(ctx, d))}</ul>`)} |
| 124 | 125 | <form class="edit-row mt" method="post" action="/settings/devices"> |
| 125 | 126 | <input type="hidden" name="kind" value="printer" /> |
src/web/studio/feed.ts +2 −1
| @@ -9,6 +9,7 @@ | ||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | import { TELL_LIMIT_WORDS, TELL_TEXT_MAX } from "../../actions/tell_from.ts"; |
| 12 | import { emptyNote } from "../empty_words.ts"; | |
| 12 | 13 | import { COMPOSER_FIELDS, TELL_MAX, sharedDraft, shareToken } from "../share_target.ts"; |
| 13 | 14 | import { chipCounts } from "../../feed/chips.ts"; |
| 14 | 15 | import { chipsOf, KIND_CHIPS, type KindChip } from "../../core/feed_chips.ts"; |
| @@ -343,7 +344,7 @@ export function publicFeed(ships: readonly PublicShip[], signIn: string): Html { | ||
| 343 | 344 | return html`<div class="stack"> |
| 344 | 345 | ${btn("Sign in to tell the crew", { href: signIn, variant: "primary" })} |
| 345 | 346 | ${ships.length === 0 |
| 346 | ? html`<p class="muted">Nothing yet.</p>` | |
| 347 | ? emptyNote("nothingYet") | |
| 347 | 348 | : html`<ul class="list"> |
| 348 | 349 | ${ships.map((s) => |
| 349 | 350 | row({ href: s.href, title: html`${s.app} · ${s.title}`, meta: time(s.at) }), |
test/empty-notes.test.ts added +41
| @@ -0,0 +1,41 @@ | ||
| 1 | /** | |
| 2 | * Sentence-only empty states come from one table (`NOTE_WORDS`, #15897): each is one plain sentence | |
| 3 | * group, and the pages that still word their own `<p class="muted">No …</p>` are counted, so the | |
| 4 | * count can only go down. | |
| 5 | */ | |
| 6 | import { expect, test } from "bun:test"; | |
| 7 | import { Glob } from "bun"; | |
| 8 | import { NOTE_WORDS } from "../src/core/empty_words.ts"; | |
| 9 | import { emptyNote } from "../src/web/empty_words.ts"; | |
| 10 | ||
| 11 | test("every note is plain words ending in a full stop", () => { | |
| 12 | for (const [key, s] of Object.entries(NOTE_WORDS)) { | |
| 13 | expect(`${key}: ${/^(No|Not|Nothing|Nobody|None)\b[^<>]*\.$/.test(s)}`).toBe(`${key}: true`); | |
| 14 | } | |
| 15 | }); | |
| 16 | ||
| 17 | test("emptyNote draws the table's sentence in one muted paragraph", () => { | |
| 18 | expect(String(emptyNote("noGateHasRunYet"))).toBe('<p class="muted">No gate has run yet.</p>'); | |
| 19 | expect(String(emptyNote("noFlagIsDeclaredYet"))).toContain(NOTE_WORDS.noFlagIsDeclaredYet); | |
| 20 | }); | |
| 21 | ||
| 22 | // Pages that word their own empty note, by file. Move one onto NOTE_WORDS and lower its count. | |
| 23 | const OWN_WORDS: Readonly<Record<string, number>> = { | |
| 24 | "src/web/pages/next.ts": 1, | |
| 25 | "src/web/pages/now.ts": 1, | |
| 26 | "src/web/pages/waves.ts": 1, | |
| 27 | "src/web/pages/sources.ts": 1, | |
| 28 | "src/web/pages/contribute.ts": 1, | |
| 29 | "src/web/studio/cut_over.ts": 1, | |
| 30 | "src/web/studio/data_move.ts": 1, | |
| 31 | }; | |
| 32 | ||
| 33 | test("the pages that still word their own empty note are the ones named, no more", async () => { | |
| 34 | const found: Record<string, number> = {}; | |
| 35 | for await (const f of new Glob("src/web/**/*.ts").scan(".")) { | |
| 36 | if (f === "src/web/client.ts") continue; // script text, not a page | |
| 37 | const n = [...(await Bun.file(f).text()).matchAll(/<p class="muted">(No|Nothing|Nobody|Not) /g)].length; | |
| 38 | if (n > 0) found[f] = n; | |
| 39 | } | |
| 40 | expect(found).toEqual(OWN_WORDS); | |
| 41 | }); |
test/empty-words-all.test.ts +2 −15
| @@ -24,16 +24,10 @@ const OWN_FORM = /empty\(\{\s*(?:icon: [^,]+,\s*)?title: [`"]No |empty\("No |<p | ||
| 24 | 24 | // What is left is split into #15899 (admin, system), #15900 (boards, bets, flows), #15901 |
| 25 | 25 | // (repository pages), #15902 (apps, forges) and #15903 (studio, renderers); #15851 waits for them. |
| 26 | 26 | const OWN_WORDS: Readonly<Record<string, number>> = { |
| 27 | "src/web/comments.ts": 1, | |
| 28 | 27 | "src/web/diff-view.ts": 1, |
| 29 | "src/web/pages/account.ts": 2, | |
| 30 | "src/web/pages/accounts.ts": 1, | |
| 31 | 28 | "src/web/pages/admin-limits.ts": 1, |
| 32 | 29 | "src/web/pages/audit.ts": 1, |
| 33 | "src/web/pages/bets.ts": 3, | |
| 34 | "src/web/pages/billing.ts": 2, | |
| 35 | "src/web/pages/boards-gates.ts": 1, | |
| 36 | "src/web/pages/boards-held.ts": 1, | |
| 30 | "src/web/pages/billing.ts": 1, | |
| 37 | 31 | "src/web/pages/boards-holds.ts": 1, |
| 38 | 32 | "src/web/pages/boards.ts": 1, |
| 39 | 33 | "src/web/pages/browse.ts": 1, |
| @@ -42,13 +36,8 @@ const OWN_WORDS: Readonly<Record<string, number>> = { | ||
| 42 | 36 | "src/web/pages/commits.ts": 1, |
| 43 | 37 | "src/web/pages/contribute.ts": 1, |
| 44 | 38 | "src/web/pages/display.ts": 1, |
| 45 | "src/web/pages/economics.ts": 1, | |
| 46 | 39 | "src/web/pages/family.ts": 1, |
| 47 | 40 | "src/web/pages/features.ts": 1, |
| 48 | "src/web/pages/flags.ts": 1, | |
| 49 | "src/web/pages/flow-panel.ts": 1, | |
| 50 | "src/web/pages/flows-all.ts": 1, | |
| 51 | "src/web/pages/grants.ts": 1, | |
| 52 | 41 | "src/web/pages/inventory.ts": 1, |
| 53 | 42 | "src/web/pages/issues.ts": 1, |
| 54 | 43 | "src/web/pages/looks.ts": 1, |
| @@ -61,16 +50,14 @@ const OWN_WORDS: Readonly<Record<string, number>> = { | ||
| 61 | 50 | "src/web/pages/runners.ts": 1, |
| 62 | 51 | "src/web/pages/settings.ts": 1, |
| 63 | 52 | "src/web/pages/sources.ts": 1, |
| 64 | "src/web/pages/system.ts": 6, | |
| 53 | "src/web/pages/system.ts": 1, | |
| 65 | 54 | "src/web/pages/teams.ts": 1, |
| 66 | 55 | "src/web/pages/trusted.ts": 1, |
| 67 | 56 | "src/web/pages/visitors.ts": 1, |
| 68 | 57 | "src/web/pages/waves.ts": 1, |
| 69 | "src/web/render/deps-manifest.ts": 1, | |
| 70 | 58 | "src/web/render/ora.ts": 1, |
| 71 | 59 | "src/web/render/sarif.ts": 1, |
| 72 | 60 | "src/web/render/sbom.ts": 1, |
| 73 | "src/web/settings/devices.ts": 1, | |
| 74 | 61 | "src/web/studio/cut_over.ts": 1, |
| 75 | 62 | "src/web/studio/data_move.ts": 1, |
| 76 | 63 | "src/web/studio/explore.ts": 1, |
new above
offline