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

Design: the subscriptions page's headroom uses the design system, and headroom leaves §5d #3859

Parked opened this
Closed without merging

scout/forge:scout/3834-design-the-subscriptions-page-s-headroom → main 9 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
5 files changed +12 −18
docs/DESIGN.md +2 −2
@@ -393,8 +393,8 @@ gone, so this list only shrinks.
393393 - **`style/base.ts`** — the page shell (topbar, main, footer) and the layout and text utilities every page leans on: `.bar` `.bare` `.foot` `.grow` `.hide-lg` `.hide-sm` `.js-only` `.live-pill` `.mark` `.mb` `.mt` `.muted` `.narrow` `.narrow-wide` `.num` `.reduced` `.shell` `.shell-wide` `.skip` `.small` `.spacer` `.sr-only` `.stack` `.stack-tight` `.topbar` `.topbar-tools` `.truncate` `.wordmark`
394394 A `.field` directly inside a `.bar` drops its bottom margin and the bar aligns to the end, so a labelled input and its button share a baseline
395395 - **`style/components.ts`** — parts of the §5 components that the table does not spell out — the palette's list, the menu's items, a dialog's head and foot, comments, the theme picker — and a few small helpers beside them: `.cat` `.clone` `.clone-text` `.comment` `.comment-body` `.comment-form` `.dash` `.dialog-body` `.dialog-foot` `.dialog-head` `.empty-title` `.error-note` `.field-row` `.form-actions` `.hex` `.ico` `.ico-loader` `.list` `.live-status` `.menu-item` `.menu-panel` `.menu-sep` `.menu-title` `.palette-empty` `.palette-foot` `.palette-group` `.palette-heading` `.palette-input` `.palette-item` `.palette-list` `.passkey` `.passkey-lead` `.passkey-note` `.passkey-off` `.passkey-on` `.preview` `.sep` `.split` `.sprite` `.swatch` `.table-scroll` `.tell-here` `.theme-apply` `.theme-option` `.tick` `.timeline` `.tl-dot` `.toast-body` `.topbar-search`
396 - **`style/components.ts`, settings rows** — a list whose rows are settings (limits, capacity): the `<ul class="list setting-list">` lets title and meta wrap instead of ellipsizing, and a row's controls take their own line under 640px. `.row-fields` is the form in that row's trail (input, Save, Default): always visible, never hover-gated, wrapping under the text before it would clip. Use both for any page whose rows show a name, a current value, and a control to change it; use `.row-actions` only for secondary actions (delete, wake, pin, revoke). Flags, telemetry, cloud, people, crew roles and subscription headroom/budget use `.row-fields`. Classes: `.row-fields` `.setting-list`
397 - **`style/content.ts`, page furniture** — what frames a page's content: page and repo heads, the merge box, the front page and its tiles, explore, backups, boards, the fleet chart's series colours, lineage: `.act` `.app-shelf` `.app-tile` `.app-tile-body` `.app-tile-desc` `.app-tile-look` `.app-tile-name` `.backups-drill` `.backups-error` `.backups-now` `.backups-restore` `.bform` `.bgrid` `.big` `.bmanage` `.boards-result` `.bp-h2` `.bp-h3` `.bp-w2` `.bp-w3` `.break` `.bt-bar` `.bt-grid` `.bt-group` `.bt-hist` `.bt-name` `.bt-procs` `.bt-row` `.bt-val` `.chart` `.chart-box` `.commit-body` `.commit-head` `.domain-records` `.explore-filters` `.explore-line` `.explore-main` `.explore-name` `.explore-row` `.fg-s0` `.fg-s1` `.fg-s2` `.fg-s3` `.fg-s4` `.fg-s5` `.fg-s6` `.fg-s7` `.filters` `.flag-form` `.fork-bar` `.front-admin` `.front-controls` `.front-crew` `.front-featured` `.front-featured-body` `.front-featured-look` `.front-issues` `.front-live` `.front-more` `.front-pick` `.front-pin-any` `.front-weights` `.frozen` `.frozen-form` `.frozen-sentence` `.headroom` `.issue-head` `.issue-meta` `.merge-box` `.merge-form` `.merge-headline` `.merge-sub` `.mirror-form` `.number` `.origin-link` `.origin-mark` `.origin-name` `.origin-row` `.owner` `.page-head` `.path-head` `.policy-line` `.qf` `.repo-actions` `.repo-audience` `.repo-desc` `.repo-layout` `.repo-lineage` `.repo-title` `.search` `.slash` `.stage-detail` `.stage-dot` `.steps` `.sub` `.sys-pair` `.table-wrap` `.terminal-line` `.tok` `.tree-row` `.tree-total` `.wall-cells` `.where-sep`
396 - **`style/components.ts`, settings rows** — a list whose rows are settings (limits, capacity): the `<ul class="list setting-list">` lets title and meta wrap instead of ellipsizing, and a row's controls take their own line under 640px. `.row-fields` is the form in that row's trail (input, Save, Default): always visible, never hover-gated, wrapping under the text before it would clip. Use both for any page whose rows show a name, a current value, and a control to change it; use `.row-actions` only for secondary actions (delete, wake, pin, revoke). Flags, telemetry, cloud, people, crew roles and subscription headroom/budget use `.row-fields`. Classes: `.input-short` `.row-fields` `.setting-list`
397 - **`style/content.ts`, page furniture** — what frames a page's content: page and repo heads, the merge box, the front page and its tiles, explore, backups, boards, the fleet chart's series colours, lineage: `.act` `.app-shelf` `.app-tile` `.app-tile-body` `.app-tile-desc` `.app-tile-look` `.app-tile-name` `.backups-drill` `.backups-error` `.backups-now` `.backups-restore` `.bform` `.bgrid` `.big` `.bmanage` `.boards-result` `.bp-h2` `.bp-h3` `.bp-w2` `.bp-w3` `.break` `.bt-bar` `.bt-grid` `.bt-group` `.bt-hist` `.bt-name` `.bt-procs` `.bt-row` `.bt-val` `.chart` `.chart-box` `.commit-body` `.commit-head` `.domain-records` `.explore-filters` `.explore-line` `.explore-main` `.explore-name` `.explore-row` `.fg-s0` `.fg-s1` `.fg-s2` `.fg-s3` `.fg-s4` `.fg-s5` `.fg-s6` `.fg-s7` `.filters` `.flag-form` `.fork-bar` `.front-admin` `.front-controls` `.front-crew` `.front-featured` `.front-featured-body` `.front-featured-look` `.front-issues` `.front-live` `.front-more` `.front-pick` `.front-pin-any` `.front-weights` `.frozen` `.frozen-form` `.frozen-sentence` `.issue-head` `.issue-meta` `.merge-box` `.merge-form` `.merge-headline` `.merge-sub` `.mirror-form` `.number` `.origin-link` `.origin-mark` `.origin-name` `.origin-row` `.owner` `.page-head` `.path-head` `.policy-line` `.qf` `.repo-actions` `.repo-audience` `.repo-desc` `.repo-layout` `.repo-lineage` `.repo-title` `.search` `.slash` `.stage-detail` `.stage-dot` `.steps` `.sub` `.sys-pair` `.table-wrap` `.terminal-line` `.tok` `.tree-row` `.tree-total` `.wall-cells` `.where-sep`
398398 - **`style/content.ts`, code view** — the source view and the syntax-highlight token classes `highlight-html.ts` builds as `tok-${kind}`: `.blob-view` `.ln` `.tok-attribute` `.tok-comment` `.tok-constant` `.tok-decorator` `.tok-deleted` `.tok-emphasis` `.tok-function` `.tok-heading` `.tok-inserted` `.tok-keyword` `.tok-link` `.tok-meta` `.tok-number` `.tok-operator` `.tok-plain` `.tok-property` `.tok-punctuation` `.tok-regex` `.tok-string` `.tok-tag` `.tok-type` `.tok-variable`
399399 - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r`
400400 - **`style/content.ts`, diff viewer** — the diff table: its gutters, line kinds, file head and inline review comments: `.add` `.del` `.dh` `.diff` `.diff-body` `.diff-head` `.diff-note` `.diff-path` `.diff-stat` `.diff-stub` `.diff-summary` `.diff-table` `.dl` `.dl-review` `.dn` `.dn-comment` `.nonl` `.rc-hidden` `.rc-resolve` `.rc-resolved` `.wd`
src/web/pages/subscriptions.ts +8 −8
@@ -46,7 +46,6 @@ import {
4646 card,
4747 confirmAction,
4848 empty,
49 listCard,
5049 row,
5150 time,
5251 timeAgo,
@@ -173,8 +172,8 @@ export function subscriptionsPage(ctx: Ctx): Response {
173172 title: "The crew works on the forge's own token",
174173 note: "Add a subscription here and grant it to a repository or an organization; its runs spend that account instead. Two on one grant take turns, and one the provider rests hands over to the other.",
175174 })
176 : listCard(
177 pool.map((s) => {
175 : card(
176 html`<ul class="list setting-list">${pool.map((s) => {
178177 const rests = resting(s, now);
179178 const st = standingOf.get(s.id);
180179 const budget = budgets.get(s.id);
@@ -222,7 +221,7 @@ export function subscriptionsPage(ctx: Ctx): Response {
222221 st !== undefined,
223222 () =>
224223 html`<form
225 class="headroom row-fields"
224 class="row-fields"
226225 method="post"
227226 action="${POOL}/${s.id}/headroom"
228227 >
@@ -230,7 +229,7 @@ export function subscriptionsPage(ctx: Ctx): Response {
230229 >kept for people, %</label
231230 >
232231 <input
233 class="input"
232 class="input input-short"
234233 id="h-${s.id}"
235234 name="headroom"
236235 type="number"
@@ -246,7 +245,7 @@ export function subscriptionsPage(ctx: Ctx): Response {
246245 s.id !== PLATFORM,
247246 () =>
248247 html`<form
249 class="headroom row-fields"
248 class="row-fields"
250249 method="post"
251250 action="${POOL}/${s.id}/budget"
252251 >
@@ -254,7 +253,7 @@ export function subscriptionsPage(ctx: Ctx): Response {
254253 >budget, $</label
255254 >
256255 <input
257 class="input"
256 class="input input-short"
258257 id="b-${s.id}"
259258 name="budget"
260259 type="number"
@@ -286,7 +285,8 @@ export function subscriptionsPage(ctx: Ctx): Response {
286285 }),
287286 )}`,
288287 });
289 }),
288 })}</ul>`,
289 { pad: false },
290290 );
291291
292292 const add = card(
src/web/style/components.ts +1
@@ -447,6 +447,7 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); }
447447 they wrap under the text before they would clip, at any width. */
448448 .row-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
449449 .row-fields .input { min-width: 0; max-width: 100%; }
450 .row-fields .input-short { width: 5em; }
450451 .row-fields .check { align-items: center; }
451452 .setting-list .row { flex-wrap: wrap; align-items: flex-start; }
452453 .setting-list .row-main { flex: 1 1 18rem; }
src/web/style/content.ts −8
@@ -269,14 +269,6 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); }
269269 .frozen-form .field { margin: 0; min-width: 0; flex: 1 1 14rem; max-width: 22rem; }
270270
271271 .wall-cells { margin: 8px 0 0; padding-left: 18px; font-family: var(--mono); font-size: 12.5px; }
272 /* A subscription's headroom for people: a small number beside its windows. */
273 .headroom { display: flex; align-items: center; gap: 6px; }
274 .headroom .input { width: 5em; }
275 /* On a phone an account's controls go under its name, not over it. */
276 @media (max-width: 640px) {
277 .row:has(.headroom) { flex-wrap: wrap; }
278 .row:has(.headroom) .row-trail { flex-basis: 100%; flex-wrap: wrap; }
279 }
280272 /* Settings → Flags: a flag's controls wrap under its text on a phone, never sideways. */
281273 .flag-form { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
282274 @media (max-width: 640px) {
test/subscriptions.test.ts +1
@@ -604,6 +604,7 @@ describe("the pages", () => {
604604 setHeadroom(app.db, work.id, 0);
605605 let html = await get("/settings/subscriptions");
606606 expect(html).toContain(`action="/settings/subscriptions/${work.id}/headroom"`);
607 expect(html).not.toContain('class="headroom');
607608 expect(html).toContain("5-hour: ~$0.00 used · opens on next use");
608609 const kept = await post(`/settings/subscriptions/${work.id}/headroom`, {
609610 headroom: "25",

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs