Public: anyone can read this; the crew can change it.
Design: a repository's following panel uses the design system, and its following-* classes leave §5d #3820
scout/forge:scout/3800-design-a-repository-s-following-panel-us → main 9 commits fork 4 threads · 4 unresolved
4 files
changed +30
−34
docs/DESIGN.md +4
| @@ -393,7 +393,11 @@ gone, so this list only shrinks. | ||
| 393 | 393 | - **`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` |
| 394 | 394 | - **`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` |
| 395 | 395 | - **`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` |
| 396 | <<<<<<< HEAD | |
| 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, following, lineage: `.about` `.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` `.connect-more` `.connect-path` `.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` `.handoff` `.handoff-links` `.headroom` `.hero` `.hero-terminal` `.issue-head` `.issue-meta` `.kv` `.lineage` `.lineage-children` `.lineage-here` `.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` | |
| 398 | ======= | |
| 396 | 399 | - **`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, following, lineage: `.about` `.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` `.connect-more` `.connect-path` `.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` `.following` `.following-actions` `.following-eyebrow` `.following-foot` `.following-head` `.following-sentence` `.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` `.handoff` `.handoff-links` `.headroom` `.hero` `.hero-terminal` `.issue-head` `.issue-meta` `.lineage` `.lineage-children` `.lineage-here` `.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` |
| 400 | >>>>>>> origin/main | |
| 397 | 401 | - **`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` |
| 398 | 402 | - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r` |
| 399 | 403 | - **`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/following.ts +20 −21
| @@ -144,8 +144,8 @@ export function releasesBlock(parentUrl: string, releases: ParentReleases): Html | ||
| 144 | 144 | const host = new URL(parentUrl).host; |
| 145 | 145 | const version = running().version; |
| 146 | 146 | const { releases: news } = parentForgeOf(parentUrl, releases, version); |
| 147 | return html`<div class="following-releases"> | |
| 148 | <p class="following-sentence"> | |
| 147 | return html`<div> | |
| 148 | <p> | |
| 149 | 149 | ${releasesSentence(releases, version, host)} |
| 150 | 150 | </p> |
| 151 | 151 | ${news.length === 0 |
| @@ -325,18 +325,16 @@ export function followingCard( | ||
| 325 | 325 | >; say there what to do.` |
| 326 | 326 | : null; |
| 327 | 327 | |
| 328 | const body = html`<div class="following-head"> | |
| 329 | <span class="following-eyebrow" | |
| 330 | >${icon("fork")} following | |
| 331 | <a href="/${parent.ownerName}/${parent.name}">${parentName}</a></span | |
| 332 | > | |
| 333 | ${converge?.kind === "proposed" | |
| 334 | ? badge("proposal ready", { tone: "merged" }) | |
| 335 | : converge?.kind === "working" | |
| 336 | ? badge("converging", { tone: "attn" }) | |
| 337 | : relationBadge(relation)} | |
| 338 | </div> | |
| 339 | <p class="following-sentence"> | |
| 328 | const head = html`<span class="muted" | |
Next: wrap the Following label in a heading (h2 or h3 inside .card-head, which already styles them) so the panel is reachable by heading navigation. |
||
| 329 | >${icon("fork")} Following | |
| 330 | <a href="/${parent.ownerName}/${parent.name}">${parentName}</a></span | |
| 331 | > | |
| 332 | ${converge?.kind === "proposed" | |
| 333 | ? badge("proposal ready", { tone: "merged" }) | |
| 334 | : converge?.kind === "working" | |
| 335 | ? badge("converging", { tone: "attn" }) | |
| 336 | : relationBadge(relation)}`; | |
| 337 | const body = html`<p> | |
| 340 | 338 | ${parent.detached === null |
| 341 | 339 | ? relationSentence(relation) |
| 342 | 340 | : html`${parentName} is frozen: its origin |
| @@ -348,15 +346,11 @@ export function followingCard( | ||
| 348 | 346 | ${following.releases === undefined |
| 349 | 347 | ? null |
| 350 | 348 | : releasesBlock(following.releases.url, following.releases.view)} |
| 351 | ${when( | |
| 352 | actions.length > 0, | |
| 353 | () => html`<div class="following-actions">${actions}</div>`, | |
| 354 | )} | |
| 355 | ${when(foot, (f) => html`<p class="muted small following-foot">${f}</p>`)} | |
| 349 | ${when(foot, (f) => html`<p class="muted small">${f}</p>`)} | |
| 356 | 350 | ${when( |
| 357 | 351 | followers > 0, |
| 358 | 352 | () => |
| 359 | html`<p class="muted small following-foot"> | |
| 353 | html`<p class="muted small"> | |
| 360 | 354 | <a href="${base}/forks" |
| 361 | 355 | >${followers === 1 |
| 362 | 356 | ? "One fork follows" |
| @@ -365,7 +359,12 @@ export function followingCard( | ||
| 365 | 359 | > |
| 366 | 360 | </p>`, |
| 367 | 361 | )}`; |
| 368 | return card(body, { id: "following", extra: "following" }); | |
| 362 | return card(body, { | |
The card no longer carries the 12px top margin the old |
||
| 363 | id: "following", | |
| 364 | extra: "mt", | |
| 365 | head, | |
| 366 | ...(actions.length > 0 ? { foot: html`${actions}` } : {}), | |
| 367 | }); | |
| 369 | 368 | } |
| 370 | 369 | |
| 371 | 370 | /** |
src/web/style/content.ts −9
| @@ -293,15 +293,6 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); } | ||
| 293 | 293 | |
| 294 | 294 | .fork-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; } |
| 295 | 295 | |
| 296 | /* A fork's relationship to what it follows: one sentence, one action. */ | |
| 297 | .following { margin-top: 12px; } | |
| 298 | .following-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } | |
| 299 | .following-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: var(--fs-min); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-fg); } | |
| 300 | .following-eyebrow a { color: var(--fg); text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 13px; font-weight: 600; } | |
| 301 | .following-sentence { margin: 8px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; } | |
| 302 | .following-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; } | |
| 303 | .following-foot { margin: 8px 0 0; } | |
| 304 | ||
| 305 | 296 | /* A mirror whose origin went: what froze, and the one way back. */ |
| 306 | 297 | .frozen { margin-top: 12px; } |
| 307 | 298 | .frozen-sentence { margin: 0; text-wrap: pretty; } |
test/following-card.test.ts +6 −4
| @@ -60,10 +60,12 @@ test("a fork's page has the following card, built by card()", async () => { | ||
| 60 | 60 | const path = "/bob/lib"; |
| 61 | 61 | const res = await fetch(`${servers.url}${path}`, { headers: { cookie: "forge_mode=dev" } }); |
| 62 | 62 | const page = await res.text(); |
| 63 | const m = page.match(/<div\s+class="card following"\s+id="following"[^>]*>[\s\S]*?<div class="card-body">([\s\S]*?)<\/div>\s*<\/div>/); | |
| 63 | const m = page.match(/<div\s+class="card mt"\s+id="following"[^>]*>[\s\S]*?<div class="card-body">([\s\S]*?)<\/div>\s*<\/div>/); | |
| 64 | 64 | expect(page).not.toContain("<section class=\"card following\""); |
| 65 | 65 | expect(m).not.toBeNull(); |
| 66 | expect(m![0]).toContain("following-eyebrow"); | |
| 67 | expect(m![0]).toContain('class="badge'); | |
| 68 | expect(m![0]).toContain("following-sentence"); | |
| 66 | expect(page).toContain('class="card-head"'); | |
| 67 | expect(page).not.toContain("following-releases"); | |
| 68 | expect(m![0]).toContain("<p>"); | |
| 69 | for (const gone of ["following-eyebrow", "following-sentence", "following-head", "following-actions", "following-foot", 'class="card following"']) | |
toContain("<p>") is nearly vacuous. Assert the action forms sit inside .card-foot, and that no card-foot appears with no actions. |
||
| 70 | expect(page).not.toContain(gone); | |
| 69 | 71 | }, 30_000); |
new above
offline
following-releaseshas no CSS. Drop the class, or give the wrapper a reason to exist.