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

The repository head's title and description draw one §5 head component #4650

Parked opened this
Closed without merging

scout/forge:scout/4593-the-repository-head-s-title-and-descript → main 10 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
5 files changed +24 −9
docs/DESIGN.md +4
@@ -395,7 +395,11 @@ 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` `.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` `.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 <<<<<<< HEAD
399 - **`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-layout` `.repo-lineage` `.search` `.steps` `.sub` `.sys-pair` `.table-wrap` `.tok` `.where-sep`
400 =======
398401 - **`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` `.headroom` `.issue-head` `.issue-meta` `.mirror-form` `.number` `.origin-mark` `.origin-name` `.origin-row` `.owner` `.page-head` `.policy-line` `.qf` `.repo-actions` `.repo-audience` `.repo-desc` `.repo-layout` `.repo-lineage` `.repo-title` `.search` `.slash` `.sub` `.sys-pair` `.table-wrap` `.tok` `.where-sep`
402 >>>>>>> origin/main
399403 - **`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`
400404 - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r`
401405 - **`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` `.dn` `.dn-comment` `.nonl` `.wd`
docs/design/areas/repo.md added +4
@@ -0,0 +1,4 @@
1 # Repository page
2
3 - `.head-title` — a head's title line: icon, `owner / name`, badges and actions on one wrapping row (`<h1>`, or a `<div>` when the page has its own). `.head-sep` is the muted slash between owner and name; `.owner` inside it is the muted owner.
4 - `.head-desc` — the one-paragraph description under a head's title, muted, wrapped with `text-wrap: pretty`.
src/web/chrome.ts +4 −4
@@ -310,7 +310,7 @@ export function scopeHeader(
310310 <span
311311 >${scope.kind === "local"
312312 ? html`<a class="owner" href="/${owner}">${owner}</a>`
313 : html`<span class="owner">${owner}</span>`}<span class="slash">/</span
313 : html`<span class="owner">${owner}</span>`}<span class="head-sep">/</span
314314 ><a href="${base}">${facts.name}</a></span
315315 >
316316 ${facts.visibility === "private"
@@ -323,11 +323,11 @@ export function scopeHeader(
323323
324324 return html`<header class="repo-head">
325325 ${options.ownTitle
326 ? html`<div class="repo-title">${title}</div>`
327 : html`<h1 class="repo-title">${title}</h1>`}
326 ? html`<div class="head-title">${title}</div>`
327 : html`<h1 class="head-title">${title}</h1>`}
328328 ${when(
329329 !options.compact && facts.description !== "",
330 () => html`<p class="repo-desc">${facts.description}</p>`,
330 () => html`<p class="head-desc">${facts.description}</p>`,
331331 )}
332332 ${repo === undefined ? null : lineageLine(ctx.app.db, repo, parent)}
333333 ${when(
src/web/style/content.ts +4 −4
@@ -19,12 +19,12 @@ export const content = /* css */ `
1919 .page-head .sub { flex-basis: 100%; color: var(--muted-fg); font-size: 13px; margin-top: -4px; }
2020
2121 .repo-head { margin: 18px 0 0; view-transition-name: repo-head; }
22 .repo-title {
22 .head-title {
2323 display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
2424 font-size: 20px; font-weight: 620; letter-spacing: -0.02em; line-height: 1.3;
2525 }
26 .repo-title .owner { font-weight: 400; color: var(--muted-fg); }
27 .repo-title .slash { color: var(--faint); font-weight: 400; }
26 .head-title .owner { font-weight: 400; color: var(--muted-fg); }
27 .head-title .head-sep { color: var(--faint); font-weight: 400; }
2828 .repo-audience {
2929 flex: 1 1 16ch; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
3030 font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted-fg);
@@ -35,7 +35,7 @@ a.repo-audience:hover { color: var(--fg); }
3535 .repo-audience { flex-basis: 100%; white-space: normal; text-overflow: clip; }
3636 a.repo-audience { display: block; padding: 12px 0; min-height: 44px; box-sizing: border-box; }
3737 }
38 .repo-desc { margin-top: 4px; color: var(--muted-fg); font-size: 13px; text-wrap: pretty; }
38 .head-desc { margin-top: 4px; color: var(--muted-fg); font-size: 13px; text-wrap: pretty; }
3939 .repo-lineage { margin-top: 3px; font-size: 12.5px; color: var(--faint); }
4040 .repo-head .tabs { margin-top: 12px; }
4141
test/repo-audience.test.ts +8 −1
@@ -57,7 +57,7 @@ beforeAll(async () => {
5757 }
5858 const promoted = setRole(app, users[0]!, "olive", "member");
5959 if (!promoted.ok) throw new Error(promoted.error);
60 const r = await createRepo(app, users[1]!, { name: "yard", visibility: "public" });
60 const r = await createRepo(app, users[1]!, { name: "yard", visibility: "public", description: "Where the <mowers> sleep" });
6161 if (!r.ok) throw new Error(String(r.error));
6262 });
6363
@@ -84,3 +84,10 @@ test("somebody not signed in sees the public sentence", async () => {
8484 expect(h).toContain("Public: anyone can read this; 1 person can change it.");
8585 expect(h).toContain('<span class="repo-audience"');
8686 });
87
88 test("the head draws the title and the escaped description with the head component", async () => {
89 const h = await head("/olive/yard");
90 expect(h).toMatch(/<h1 class="head-title">[\s\S]*<span class="head-sep">\/<\/span\s*>\s*<a href="\/olive\/yard">yard<\/a>/);
91 expect(h).toContain('<p class="head-desc">Where the &lt;mowers&gt; sleep</p>');
92 expect(h).not.toMatch(/repo-title|repo-desc|class="slash"/);
93 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs