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

Design: the repository head becomes a §5 component, and repo-title/desc/actions/lineage and slash leave §5d #4461

Parked opened this
Closed without merging

mason/forge:mason/3945-design-the-repository-head-becomes-a-5-c → main 17 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
8 files changed +40 −26
docs/DESIGN.md +2 −2
@@ -178,7 +178,7 @@ specification.
178178 | **code block** | `.code` | `:target` / `[data-hl]` line highlight | — | a numbered gutter |
179179 | **prose** | `.prose` | — | 15px, 72ch measure | wrapped markdown |
180180 | **settings shell** `settingsLayout()` | `.settings` (`.settings-nav`, `.settings-main`) | — | sticky nav ≥860px, scroll strip below | a sidebar and a pane |
181 | **repo header** `repoHeader()` | `.repo-head` | — | tab counts, Settings only for admins | a title line and a tab row |
181 | **repo header** `repoHeader()` (`chrome.ts`) | `.repo-head` (`.repo-head-title` with `.repo-head-owner` `.repo-head-slash` and `.repo-head-actions`; `.repo-head-desc`, `.repo-head-lineage`, also drawn by `studioOriginNote()` in `scope.ts`) | — | tab counts, Settings only for admins | a title line and a tab row |
182182 | **where strip** `whereStrip()` (`scope.ts`) | `.where > .where-place` | `data-state=reading\|present\|absent` — accent dot, success dot, faint dot — the dot is the place's `aria-hidden` glyph span, its aside `.muted` | three places, always in this order and these words; a place is a link where one exists, and the third is the pin toggle | `● codeberg.org · ● workbench · ◆ this machine` |
183183 | **live-browse banner** `liveBanner()` | `.live-note` | — | only on a live browse, above the content, one sentence | one accent line under the tab row |
184184 | **where-it-lives block** | `.where-block` | — | origin, last fetch, Sync now and where pushes land, as one block in the About rail | the same four lines under a rule |
@@ -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` `.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`
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` `.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` `.commit-body` `.commit-head` `.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` `.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-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` `.tok` `.tree-row` `.tree-total` `.wall-cells` `.where-sep`
398 - **`style/content.ts`, page furniture** — what frames a page's content: page 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` `.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` `.commit-body` `.commit-head` `.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` `.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-link` `.origin-mark` `.origin-name` `.origin-row` `.page-head` `.path-head` `.policy-line` `.qf` `.repo-audience` `.repo-layout` `.search` `.stage-detail` `.stage-dot` `.steps` `.sub` `.sys-pair` `.table-wrap` `.tok` `.tree-row` `.tree-total` `.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/chrome.ts +8 −8
@@ -310,8 +310,8 @@ export function scopeHeader(
310310 )}
311311 <span
312312 >${scope.kind === "local"
313 ? html`<a class="owner" href="/${owner}">${owner}</a>`
314 : html`<span class="owner">${owner}</span>`}<span class="slash">/</span
313 ? html`<a class="repo-head-owner" href="/${owner}">${owner}</a>`
314 : html`<span class="repo-head-owner">${owner}</span>`}<span class="repo-head-slash">/</span
315315 ><a href="${base}">${facts.name}</a></span
316316 >
317317 ${facts.visibility === "private"
@@ -319,16 +319,16 @@ export function scopeHeader(
319319 : badge("Public", { variant: "secondary" })}
320320 ${repo === undefined ? null : audienceLine(ctx, repo, admin, base)}
321321 ${actions.text.trim() !== ""
322 ? html`<span class="repo-actions">${actions}</span>`
322 ? html`<span class="repo-head-actions">${actions}</span>`
323323 : null}`;
324324
325325 return html`<header class="repo-head">
326326 ${options.ownTitle
327 ? html`<div class="repo-title">${title}</div>`
328 : html`<h1 class="repo-title">${title}</h1>`}
327 ? html`<div class="repo-head-title">${title}</div>`
328 : html`<h1 class="repo-head-title">${title}</h1>`}
329329 ${when(
330330 !options.compact && facts.description !== "",
331 () => html`<p class="repo-desc">${facts.description}</p>`,
331 () => html`<p class="repo-head-desc">${facts.description}</p>`,
332332 )}
333333 ${repo === undefined ? null : lineageLine(ctx.app.db, repo, parent)}
334334 ${when(
@@ -338,7 +338,7 @@ export function scopeHeader(
338338 // truth for this". This line is the fallback for the one case the
339339 // strip cannot link: a fork whose origin has been disconnected.
340340 () =>
341 html`<p class="muted small break">
341 html`<p class="repo-head-lineage break">
342342 ${icon("fork", 16)}fork of
343343 <span class="mono">${scope.upstream}</span>
344344 </p>`,
@@ -381,7 +381,7 @@ export function lineageLine(
381381 for (const p of shown.parents)
382382 segments.push(html`fork of ${out(parentUrl(shown.sourceUrl, p), p)}`);
383383 }
384 return html`<p class="muted small break" data-lineage>
384 return html`<p class="repo-head-lineage break" data-lineage>
385385 ${segments.map((s, i) => (i === 0 ? s : html` · ${s}`))}
386386 </p>`;
387387 }
src/web/scope.ts +1 −1
@@ -512,7 +512,7 @@ export function studioOriginNote(repo: Repo | undefined): Html | null {
512512 const at = repo?.origin;
513513 if (at == null) return null;
514514 const host = at.htmlUrl === "" ? at.fullName : hostOf(at.htmlUrl);
515 return html`<p class="muted small break">
515 return html`<p class="repo-head-lineage break">
516516 Reads from
517517 ${at.htmlUrl === ""
518518 ? host
src/web/style/components.ts +13
@@ -519,6 +519,19 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); }
519519 overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
520520 }
521521
522 /* ---- repo head (\`repoHeader\` in chrome.ts): owner / name, then the lines under it ---- */
523 .repo-head { margin: 18px 0 0; view-transition-name: repo-head; }
524 .repo-head-title {
525 display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
526 font-size: 20px; font-weight: 620; letter-spacing: -0.02em; line-height: 1.3;
527 }
528 .repo-head-owner { font-weight: 400; color: var(--muted-fg); }
529 .repo-head-slash { color: var(--faint); font-weight: 400; }
530 .repo-head-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
531 .repo-head-desc { margin-top: 4px; color: var(--muted-fg); font-size: 13px; text-wrap: pretty; }
532 .repo-head-lineage { margin-top: 3px; font-size: 12.5px; color: var(--faint); }
533 .repo-head .tabs { margin-top: 12px; }
534
522535 /* ---- tabs (navigation links, never role=tab) ---- */
523536 .tabs {
524537 min-width: 0; max-width: 100%; display: flex; gap: 2px; align-items: stretch;
src/web/style/content.ts −12
@@ -18,13 +18,6 @@ export const content = /* css */ `
1818 .page-head h1 { min-width: 0; }
1919 .page-head .sub { flex-basis: 100%; color: var(--muted-fg); font-size: 13px; margin-top: -4px; }
2020
21 .repo-head { margin: 18px 0 0; view-transition-name: repo-head; }
22 .repo-title {
23 display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
24 font-size: 20px; font-weight: 620; letter-spacing: -0.02em; line-height: 1.3;
25 }
26 .repo-title .owner { font-weight: 400; color: var(--muted-fg); }
27 .repo-title .slash { color: var(--faint); font-weight: 400; }
2821 .repo-audience {
2922 flex: 1 1 16ch; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
3023 font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted-fg);
@@ -35,9 +28,6 @@ a.repo-audience:hover { color: var(--fg); }
3528 .repo-audience { flex-basis: 100%; white-space: normal; text-overflow: clip; }
3629 a.repo-audience { display: block; padding: 12px 0; min-height: 44px; box-sizing: border-box; }
3730 }
38 .repo-desc { margin-top: 4px; color: var(--muted-fg); font-size: 13px; text-wrap: pretty; }
39 .repo-lineage { margin-top: 3px; font-size: 12.5px; color: var(--faint); }
40 .repo-head .tabs { margin-top: 12px; }
4131
4232 /* Provenance and pinning: one line under the title, so a <form> never has to
4333 live inside the <h1>. */
@@ -189,8 +179,6 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); }
189179
190180 .bar > .device-code { flex: 1 1 auto; }
191181
192 .repo-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
193
194182 .repo-layout { display: grid; gap: 16px; margin-top: 16px; align-items: start; }
195183 @media (min-width: 960px) {
196184 .repo-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
test/migrate.test.ts +1 −1
@@ -583,7 +583,7 @@ describe("migrate", () => {
583583 const repo = getRepo(app.db, "alice", "arm")!;
584584 const lineage = async (cookie: string): Promise<string> => {
585585 const page = await (await browser(cookie, "/alice/arm")).text();
586 return /<p class="muted small break" data-lineage>[\s\S]*?<\/p>/.exec(page)?.[0] ?? "";
586 return /<p class="repo-head-lineage break" data-lineage>[\s\S]*?<\/p>/.exec(page)?.[0] ?? "";
587587 };
588588 const shown = await lineage("");
589589 expect(shown).toContain("Migrated from");
test/provenance-doors.test.ts +1 −1
@@ -183,7 +183,7 @@ describe("the trail through the API and MCP", () => {
183183 test("a fork made here inherits the parent's trail through every door, and loses it when the parent hides it", async () => {
184184 const page = async (): Promise<string> => {
185185 const text = await (await fetch(`${servers.url}/reader/arm`)).text();
186 return /<p class="muted small break" data-lineage>[\s\S]*?<\/p>/.exec(text)?.[0] ?? "";
186 return /<p class="repo-head-lineage break" data-lineage>[\s\S]*?<\/p>/.exec(text)?.[0] ?? "";
187187 };
188188 const api = async () =>
189189 ((await (await fetch(`${servers.url}/api/v1/repos/reader/arm`)).json()) as {
test/repo-audience.test.ts +14 −1
@@ -57,7 +57,11 @@ 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]!, {
61 name: "yard",
62 visibility: "public",
63 description: "A place to keep things",
64 });
6165 if (!r.ok) throw new Error(String(r.error));
6266 });
6367
@@ -84,3 +88,12 @@ test("somebody not signed in sees the public sentence", async () => {
8488 expect(h).toContain("Public: anyone can read this; 1 person can change it.");
8589 expect(h).toContain('<span class="repo-audience"');
8690 });
91
92 test("the head is drawn with the §5 repo-head names and none of the old ones", async () => {
93 const h = await head("/olive/yard", await signIn("olive"));
94 for (const name of ["repo-head-title", "repo-head-owner", "repo-head-slash", "repo-head-desc"])
95 expect(h).toContain(`class="${name}"`);
96 expect(h).toContain('<p class="repo-head-desc">A place to keep things</p>');
97 for (const old of ["repo-title", "repo-desc", "repo-lineage", "repo-actions", "owner", "slash"])
98 expect(h).not.toContain(`class="${old}"`);
99 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs