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 #4664
scout/forge:scout/4596-the-front-page-s-featured-app-draws-5-s → main 8 commits fork 3 threads · 3 unresolved
5 files
changed +33
−42
docs/DESIGN.md +4
| @@ -395,7 +395,11 @@ gone, so this list only shrinks. | ||
| 395 | 395 | 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 |
| 396 | 396 | - **`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` |
| 397 | 397 | - **`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 | <<<<<<< HEAD | |
| 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, lineage: `.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` `.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` | |
| 400 | ======= | |
| 398 | 401 | - **`style/content.ts`, page furniture** — what frames a page's content: page and repo heads, the front page and its tiles, explore, backups, boards, the fleet chart's series colours, lineage: `.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` `.frozen` `.frozen-form` `.frozen-sentence` `.headroom` `.issue-head` `.issue-meta` `.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` |
| 402 | >>>>>>> origin/main | |
| 399 | 403 | - **`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` |
| 400 | 404 | - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r` |
| 401 | 405 | - **`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
| @@ -358,25 +358,27 @@ function featuredCard(featured: NonNullable<FrontPage["featured"]>): Html { | ||
| 358 | 358 | }), |
| 359 | 359 | ]) |
| 360 | 360 | : 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( | |
| 362 | html`<div class="bar"> | |
| 363 | ${when( | |
| 364 | picture, | |
| 365 | (src) => | |
| 366 | html`<a class="look" data-slot="now" href="${base}" | |
| 367 | ><img | |
| 368 | src="${src}" | |
| 369 | width="${LOOK_SIZES.thumb.width}" | |
| 370 | height="${LOOK_SIZES.thumb.height}" | |
| 371 | alt="${repo.name} as it looks now" | |
| 372 | /></a>`, | |
| 373 | )} | |
| 374 | <div class="stack stack-tight"> | |
| 375 | <span class="small muted">Featured</span> | |
| 376 | <h2><a class="break" href="${base}">${repo.ownerName}/${repo.name}</a></h2> | |
| 377 | ${when(repo.description, (d) => html`<p class="muted break">${d}</p>`)} ${work} | |
| 378 | <div class="bar">${btn("Open", { href: base, variant: "primary" })}</div> | |
| 379 | </div> | |
| 380 | </div>`, | |
| 381 | )}</section>`; | |
| 380 | 382 | } |
| 381 | 383 | |
| 382 | 384 | /** A weight's name as the controls say it. */ |
src/web/style/components.ts +2
| @@ -373,6 +373,8 @@ a.sha:hover { color: var(--accent); } | ||
| 373 | 373 | .look[data-slot="thumb"] { flex: none; width: 30px; height: 40px; border-radius: 4px; } |
| 374 | 374 | .look[data-slot="thumb"] img { height: 100%; object-fit: cover; object-position: top; } |
| 375 | 375 | .look[data-slot="now"] { flex: none; width: 168px; } |
| 376 | /* A picture beside its text: the text takes the rest of the row, or wraps below on a phone. */ | |
| 377 | .bar > .stack { flex: 1 1 220px; min-width: 0; } | |
| 376 | 378 | .looks { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; } |
| 377 | 379 | .looks > [data-slot="phone"] { flex: 0 0 200px; } |
| 378 | 380 | .looks > [data-slot="desktop"] { flex: 1 1 320px; min-width: 0; max-width: 1280px; } |
src/web/style/content.ts −19
| @@ -327,21 +327,6 @@ form.inline { display: inline; margin-left: auto; } | ||
| 327 | 327 | grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | /* The featured repository: its picture and its crew at work, side by side | |
| 331 | on a desk, stacked on a phone. */ | |
| 332 | .front-featured { | |
| 333 | display: grid; gap: 0; max-width: 1040px; margin-inline: auto; | |
| 334 | grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); | |
| 335 | border: 1px solid var(--border); border-radius: var(--radius); | |
| 336 | overflow: hidden; background: var(--card); | |
| 337 | } | |
| 338 | .front-featured-look img { display: block; width: 100%; height: auto; background: var(--muted); } | |
| 339 | .front-featured-body { display: grid; align-content: center; gap: 8px; padding: 20px 24px; min-width: 0; } | |
| 340 | .front-featured-body > * { min-width: 0; } | |
| 341 | .front-featured-body h2 { font-size: 20px; letter-spacing: -0.02em; } | |
| 342 | .front-featured-body h2 a { color: inherit; text-decoration: none; } | |
| 343 | .front-featured-body p { color: var(--muted-fg); text-wrap: pretty; } | |
| 344 | .front-featured:not(:has(.front-featured-look)) { grid-template-columns: 1fr; } | |
| 345 | 330 | .front-crew { display: flex; align-items: center; gap: 8px; font-size: 14px; } |
| 346 | 331 | .front-live { |
| 347 | 332 | width: 8px; height: 8px; border-radius: 50%; background: var(--success); |
| @@ -363,10 +348,6 @@ form.inline { display: inline; margin-left: auto; } | ||
| 363 | 348 | /* Two to a row on a phone: a few live apps in one screen, not a scroll. */ |
| 364 | 349 | .stack[data-shelf] { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); } |
| 365 | 350 | } |
| 366 | @media (max-width: 720px) { | |
| 367 | .front-featured { grid-template-columns: 1fr; } | |
| 368 | .front-featured-body { padding: 16px; } | |
| 369 | } | |
| 370 | 351 | |
| 371 | 352 | /* Every page grid, in one rule: a grid item's automatic minimum size is its |
| 372 | 353 | *content*, so a column with a long unbreakable line pushes the page wider |
test/front.test.ts +6 −4
| @@ -427,11 +427,13 @@ describe("the front page", () => { | ||
| 427 | 427 | forgetFrontScores(app); |
| 428 | 428 | const body = await door(); |
| 429 | 429 | // 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 start = body.indexOf('<section aria-label="Featured">'); | |
| 433 | const featured = body.slice(start, body.indexOf("</section>", start)); | |
| 434 | expect(featured).toMatch(/<a class="look" data-slot="now" href="\/zed\/loved"/); | |
| 434 | 435 | expect(featured).toContain('href="/zed/loved"'); |
| 436 | expect(featured).toMatch(/<h2><a class="break" href="\/zed\/loved">/); | |
| 435 | 437 | expect(body).not.toContain('href="/owner/down"'); |
| 436 | 438 | expect(body).not.toContain('href="/owner/bare"'); |
| 437 | 439 | expect(body).not.toContain("hush"); |
new above
offline
Global selector: scope it to the look-beside-text case (e.g.
.bar > .look + .stack) so other bars with a .stack child are unaffected, and list it in docs/DESIGN.md.