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

Design: the front page's featured app uses §5's card and look, and front-featured* leave §5d #4028

Parked opened this
Closed without merging

scout/forge:scout/3940-design-the-front-page-s-featured-app-use → main 5 commits fork 2 threads · 2 unresolved

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
4 files changed +31 −41
docs/DESIGN.md +4
@@ -392,7 +392,11 @@ gone, so this list only shrinks.
392392 - **`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`
393393 - **`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`
394394 - **`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`
395 <<<<<<< HEAD
396 - **`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` `.close-into` `.close-reason` `.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-controls` `.front-crew` `.front-issues` `.front-live` `.front-more` `.front-pick` `.front-pin-any` `.front-weights` `.front-wrap` `.frozen` `.frozen-form` `.frozen-sentence` `.grants` `.grants-foot` `.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` `.quiet-details` `.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-dot` `.where-note` `.where-sep`
397 =======
395398 - **`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` `.grants` `.grants-foot` `.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` `.quiet-details` `.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-dot` `.where-note` `.where-sep`
399 >>>>>>> origin/main
396400 - **`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`
397401 - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r`
398402 - **`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/studio/home.ts +21 −19
@@ -355,24 +355,26 @@ function featuredCard(featured: NonNullable<FrontPage["featured"]>): Html {
355355 : ""}
356356 </p>`
357357 : null;
358 return html`<section class="front-featured" aria-label="Featured">
359 ${when(
360 picture,
361 (src) =>
362 html`<a class="front-featured-look" href="${base}"
363 ><img
364 src="${src}"
365 width="${LOOK_SIZES.thumb.width}"
366 height="${LOOK_SIZES.thumb.height}"
367 alt="${repo.name} as it looks now"
368 /></a>`,
369 )}
370 <div class="front-featured-body">
371 <span class="small muted">Featured</span>
372 <h2><a href="${base}">${repo.ownerName}/${repo.name}</a></h2>
373 ${when(repo.description, (d) => html`<p>${d}</p>`)} ${work}
374 <div class="bar">${btn("Open", { href: base, variant: "primary" })}</div>
375 </div>
358 const look = when(
359 picture,
360 (src) =>
361 html`<a href="${base}"
362 ><img
363 class="app-tile-look"
364 src="${src}"
365 width="${LOOK_SIZES.thumb.width}"
366 height="${LOOK_SIZES.thumb.height}"
367 alt="${repo.name} as it looks now"
368 /></a>`,
369 );
370 const body = html`<div class="stack stack-tight">
371 <span class="small muted">Featured</span>
372 <h2><a href="${base}">${repo.ownerName}/${repo.name}</a></h2>
373 ${when(repo.description, (d) => html`<p class="muted">${d}</p>`)} ${work}
374 <div class="bar">${btn("Open", { href: base, variant: "primary" })}</div>
375 </div>`;
376 return html`<section class="front-wrap" aria-label="Featured">
outdated

front-admin is reused here only for max-width and centring. Give the shared wrapper a neutral name (and update §5d) so the next reader does not take the featured card for an admin control.

377 ${card(html`${look}<div class="card-body">${body}</div>`, { pad: false })}
376378 </section>`;
377379 }
378380
@@ -547,7 +549,7 @@ export function studioDoor(ctx: Ctx): Response {
547549 })}
548550 </div>`
549551 : null}
550 ${when(admin, () => html`<div class="mt front-admin">${frontControls(ctx, front)}</div>`)}`;
552 ${when(admin, () => html`<div class="mt front-wrap">${frontControls(ctx, front)}</div>`)}`;
551553 return page({ ctx, title: "forge", body });
552554 }
553555
src/web/style/content.ts +2 −20
@@ -481,21 +481,7 @@ form.inline { display: inline; margin-left: auto; }
481481 .explore-row > .btn { margin-left: 0; }
482482 }
483483
484 /* The featured repository: its picture and its crew at work, side by side
485 on a desk, stacked on a phone. */
486 .front-featured {
487 display: grid; gap: 0; max-width: 1040px; margin-inline: auto;
488 grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
489 border: 1px solid var(--border); border-radius: var(--radius);
490 overflow: hidden; background: var(--card);
491 }
492 .front-featured-look img { display: block; width: 100%; height: auto; background: var(--muted); }
493 .front-featured-body { display: grid; align-content: center; gap: 8px; padding: 20px 24px; min-width: 0; }
494 .front-featured-body > * { min-width: 0; }
495 .front-featured-body h2 { font-size: 20px; letter-spacing: -0.02em; }
496 .front-featured-body h2 a { color: inherit; text-decoration: none; }
497 .front-featured-body p { color: var(--muted-fg); text-wrap: pretty; }
498 .front-featured:not(:has(.front-featured-look)) { grid-template-columns: 1fr; }
484 /* The featured repository is a card; its crew at work follows. */
499485 .front-crew { display: flex; align-items: center; gap: 8px; font-size: 14px; }
500486 .front-live {
501487 width: 8px; height: 8px; border-radius: 50%; background: var(--success);
@@ -505,7 +491,7 @@ form.inline { display: inline; margin-left: auto; }
505491 .front-issues li { min-width: 0; }
506492 .front-issues a { color: inherit; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
507493 .front-more { text-align: center; }
508 .front-admin { max-width: 1040px; margin-inline: auto; }
494 .front-wrap { max-width: 1040px; margin-inline: auto; }
509495 .front-pick { gap: 8px; }
510496 .front-pick form.inline { margin-left: 0; }
511497 .front-pin-any { padding: 12px 16px; flex-wrap: nowrap; }
@@ -518,10 +504,6 @@ form.inline { display: inline; margin-left: auto; }
518504 .app-shelf { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
519505 .app-tile-body { padding: 8px 10px; }
520506 }
521 @media (max-width: 720px) {
522 .front-featured { grid-template-columns: 1fr; }
523 .front-featured-body { padding: 16px; }
524 }
525507
outdated

This @media (max-width: 720px) block is empty now that its two rules are gone. Remove it.

526508 /* Every page grid, in one rule: a grid item's automatic minimum size is its
527509 *content*, so a column with a long unbreakable line pushes the page wider
test/front.test.ts +4 −2
@@ -428,10 +428,12 @@ describe("the front page", () => {
428428 const body = await door();
429429 // The most-forked app is featured — a stranger's, ahead of the owner's.
430430 const featured = body.slice(
431 body.indexOf('class="front-featured"'),
432 body.indexOf("</section>", body.indexOf('class="front-featured"')),
431 body.indexOf('aria-label="Featured"'),
432 body.indexOf("</section>", body.indexOf('aria-label="Featured"')),
433433 );
434434 expect(featured).toContain('href="/zed/loved"');
435 expect(featured).toContain('class="card');
436 expect(body).not.toContain("front-featured");
435437 expect(body).not.toContain('href="/owner/down"');
436438 expect(body).not.toContain('href="/owner/bare"');
437439 expect(body).not.toContain("hush");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs