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

The front page's featured app draws §5's card, and front-featured* leave the stylesheet #4651

Parked opened this
Closed without merging

scout/forge:scout/4596-the-front-page-s-featured-app-draws-5-s → main 3 commits fork 2 threads · 2 unresolved

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
4 files changed +28 −43
docs/DESIGN.md +1 −1
@@ -395,7 +395,7 @@ gone, so this list only shrinks.
395395 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
396396 - **`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` `.menu-item` `.menu-panel` `.menu-sep` `.menu-title` `.palette-empty` `.palette-foot` `.palette-group` `.palette-heading` `.palette-input` `.palette-item` `.palette-list` `.passkey` `.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`
397397 - **`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`
398 - **`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: `.app-shelf` `.backups-drill` `.backups-error` `.backups-now` `.backups-restore` `.bform` `.bgrid` `.bmanage` `.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` `.commit-body` `.commit-head` `.domain-records` `.fg-s0` `.fg-s1` `.fg-s2` `.fg-s3` `.fg-s4` `.fg-s5` `.fg-s6` `.fg-s7` `.filters` `.flag-form` `.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-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` `.tok` `.wall-cells` `.where-sep`
398 - **`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: `.app-shelf` `.backups-drill` `.backups-error` `.backups-now` `.backups-restore` `.bform` `.bgrid` `.bmanage` `.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` `.commit-body` `.commit-head` `.domain-records` `.fg-s0` `.fg-s1` `.fg-s2` `.fg-s3` `.fg-s4` `.fg-s5` `.fg-s6` `.fg-s7` `.filters` `.flag-form` `.front-admin` `.front-controls` `.front-crew` `.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-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` `.tok` `.wall-cells` `.where-sep`
399399 - **`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`
400400 - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r`
401401 - **`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 +20 −19
@@ -358,25 +358,26 @@ function featuredCard(featured: NonNullable<FrontPage["featured"]>): Html {
358358 }),
359359 ])
360360 : null;
361 return html`<section class="front-featured" aria-label="Featured">
362 ${when(
363 picture,
364 (src) =>
365 html`<a class="front-featured-look" href="${base}"
366 ><img
367 src="${src}"
368 width="${LOOK_SIZES.thumb.width}"
369 height="${LOOK_SIZES.thumb.height}"
370 alt="${repo.name} as it looks now"
371 /></a>`,
372 )}
373 <div class="front-featured-body">
374 <span class="small muted">Featured</span>
375 <h2><a href="${base}">${repo.ownerName}/${repo.name}</a></h2>
376 ${when(repo.description, (d) => html`<p>${d}</p>`)} ${work}
377 <div class="bar">${btn("Open", { href: base, variant: "primary" })}</div>
378 </div>
379 </section>`;
361 return html`<section aria-label="Featured">${card(
outdated

card() renders a plain div, so the old <section aria-label="Featured"> landmark is gone. Wrap this in a labelled section and assert it in the test. Also check the .look border/radius against the card edge.

362 html`${when(
363 picture,
364 (src) =>
365 html`<a class="look" href="${base}"
366 ><img
367 src="${src}"
368 width="${LOOK_SIZES.thumb.width}"
369 height="${LOOK_SIZES.thumb.height}"
370 alt="${repo.name} as it looks now"
371 /></a>`,
372 )}
373 <div class="card-body stack stack-tight">
374 <span class="small muted">Featured</span>
375 <h2><a href="${base}">${repo.ownerName}/${repo.name}</a></h2>
376 ${when(repo.description, (d) => html`<p class="muted">${d}</p>`)} ${work}
377 <div class="bar">${btn("Open", { href: base, variant: "primary" })}</div>
378 </div>`,
379 { pad: false },
380 )}</section>`;
380381 }
381382
382383 /** A weight's name as the controls say it. */
src/web/style/content.ts −19
@@ -352,21 +352,6 @@ form.inline { display: inline; margin-left: auto; }
352352 grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
353353 }
354354
355 /* The featured repository: its picture and its crew at work, side by side
356 on a desk, stacked on a phone. */
357 .front-featured {
358 display: grid; gap: 0; max-width: 1040px; margin-inline: auto;
359 grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
360 border: 1px solid var(--border); border-radius: var(--radius);
361 overflow: hidden; background: var(--card);
362 }
363 .front-featured-look img { display: block; width: 100%; height: auto; background: var(--muted); }
364 .front-featured-body { display: grid; align-content: center; gap: 8px; padding: 20px 24px; min-width: 0; }
365 .front-featured-body > * { min-width: 0; }
366 .front-featured-body h2 { font-size: 20px; letter-spacing: -0.02em; }
367 .front-featured-body h2 a { color: inherit; text-decoration: none; }
368 .front-featured-body p { color: var(--muted-fg); text-wrap: pretty; }
369 .front-featured:not(:has(.front-featured-look)) { grid-template-columns: 1fr; }
370355 .front-crew { display: flex; align-items: center; gap: 8px; font-size: 14px; }
371356 .front-live {
372357 width: 8px; height: 8px; border-radius: 50%; background: var(--success);
@@ -388,10 +373,6 @@ form.inline { display: inline; margin-left: auto; }
388373 /* Two to a row on a phone: a few live apps in one screen, not a scroll. */
389374 .app-shelf { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
390375 }
391 @media (max-width: 720px) {
392 .front-featured { grid-template-columns: 1fr; }
393 .front-featured-body { padding: 16px; }
394 }
395376
outdated

The @media (max-width: 720px) block is now empty. Delete it.

396377 /* Every page grid, in one rule: a grid item's automatic minimum size is its
397378 *content*, so a column with a long unbreakable line pushes the page wider
test/front.test.ts +7 −4
@@ -427,11 +427,14 @@ describe("the front page", () => {
427427 forgetFrontScores(app);
428428 const body = await door();
429429 // The most-forked app is featured — a stranger's, ahead of the owner's.
430 const featured = body.slice(
431 body.indexOf('class="front-featured"'),
432 body.indexOf("</section>", body.indexOf('class="front-featured"')),
433 );
430 expect(body).not.toContain("front-featured");
431 expect(body).toContain('<section aria-label="Featured">');
432 const at = body.indexOf("Featured</span>");
433 expect(at).toBeGreaterThan(0);
434 const featured = body.slice(body.lastIndexOf('class="card"', at), at);
435 expect(featured).toContain('<a class="look" href="/zed/loved"');
434436 expect(featured).toContain('href="/zed/loved"');
437 expect(body.slice(at)).toContain('<h2><a href="/zed/loved">');
435438 expect(body).not.toContain('href="/owner/down"');
436439 expect(body).not.toContain('href="/owner/bare"');
437440 expect(body).not.toContain("hush");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs