Public: anyone can read this; the crew can change it.
A repository head's lineage line draws §5's row and links, and .repo-lineage leaves the markup #4289
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/4228-a-repository-head-s-lineage-line-draws-5 → main 1 commit fork
5 files
changed +26
−5
src/web/chrome.ts +2 −2
| @@ -339,7 +339,7 @@ export function scopeHeader( | ||
| 339 | 339 | // truth for this". This line is the fallback for the one case the |
| 340 | 340 | // strip cannot link: a fork whose origin has been disconnected. |
| 341 | 341 | () => |
| 342 | html`<p class="repo-lineage"> | |
| 342 | html`<p class="muted small break"> | |
| 343 | 343 | ${icon("fork", 16)}fork of |
| 344 | 344 | <span class="mono">${scope.upstream}</span> |
| 345 | 345 | </p>`, |
| @@ -382,7 +382,7 @@ export function lineageLine( | ||
| 382 | 382 | for (const p of shown.parents) |
| 383 | 383 | segments.push(html`fork of ${out(parentUrl(shown.sourceUrl, p), p)}`); |
| 384 | 384 | } |
| 385 | return html`<p class="repo-lineage" data-lineage> | |
| 385 | return html`<p class="muted small break" data-lineage> | |
| 386 | 386 | ${segments.map((s, i) => (i === 0 ? s : html` · ${s}`))} |
| 387 | 387 | </p>`; |
| 388 | 388 | } |
src/web/scope.ts +1 −1
| @@ -512,7 +512,7 @@ export function studioOriginNote(repo: Repo | undefined): Html | null { | ||
| 512 | 512 | const at = repo?.origin; |
| 513 | 513 | if (at == null) return null; |
| 514 | 514 | const host = at.htmlUrl === "" ? at.fullName : hostOf(at.htmlUrl); |
| 515 | return html`<p class="repo-lineage"> | |
| 515 | return html`<p class="muted small break"> | |
| 516 | 516 | Reads from |
| 517 | 517 | ${at.htmlUrl === "" |
| 518 | 518 | ? host |
test/migrate.test.ts +1 −1
| @@ -583,7 +583,7 @@ describe("migrate", () => { | ||
| 583 | 583 | const repo = getRepo(app.db, "alice", "arm")!; |
| 584 | 584 | const lineage = async (cookie: string): Promise<string> => { |
| 585 | 585 | const page = await (await browser(cookie, "/alice/arm")).text(); |
| 586 | return /<p class="repo-lineage" data-lineage>[\s\S]*?<\/p>/.exec(page)?.[0] ?? ""; | |
| 586 | return /<p class="muted small break" data-lineage>[\s\S]*?<\/p>/.exec(page)?.[0] ?? ""; | |
| 587 | 587 | }; |
| 588 | 588 | const shown = await lineage(""); |
| 589 | 589 | expect(shown).toContain("Migrated from"); |
test/provenance-doors.test.ts +1 −1
| @@ -183,7 +183,7 @@ describe("the trail through the API and MCP", () => { | ||
| 183 | 183 | test("a fork made here inherits the parent's trail through every door, and loses it when the parent hides it", async () => { |
| 184 | 184 | const page = async (): Promise<string> => { |
| 185 | 185 | const text = await (await fetch(`${servers.url}/reader/arm`)).text(); |
| 186 | return /<p class="repo-lineage" data-lineage>[\s\S]*?<\/p>/.exec(text)?.[0] ?? ""; | |
| 186 | return /<p class="muted small break" data-lineage>[\s\S]*?<\/p>/.exec(text)?.[0] ?? ""; | |
| 187 | 187 | }; |
| 188 | 188 | const api = async () => |
| 189 | 189 | ((await (await fetch(`${servers.url}/api/v1/repos/reader/arm`)).json()) as { |
test/repo-lineage-markup.test.ts added +21
| @@ -0,0 +1,21 @@ | ||
| 1 | import { expect, test } from "bun:test"; | |
| 2 | import { studioOriginNote } from "../src/web/scope.ts"; | |
| 3 | ||
| 4 | test("the studio origin note is drawn with §5 utilities, not .repo-lineage", () => { | |
| 5 | const note = String( | |
| 6 | studioOriginNote({ | |
| 7 | origin: { htmlUrl: "https://github.com/a/arm", fullName: "a/arm", lastFetchAt: null }, | |
| 8 | } as never), | |
| 9 | ); | |
| 10 | expect(note).not.toContain("repo-lineage"); | |
| 11 | expect(note).toContain("Reads from"); | |
| 12 | expect(note).toContain('href="https://github.com/a/arm"'); | |
| 13 | expect(note).toContain("break"); | |
| 14 | }); | |
| 15 | ||
| 16 | test("no page markup names repo-lineage", async () => { | |
| 17 | for (const f of ["chrome.ts", "scope.ts"]) { | |
| 18 | const src = await Bun.file(new URL(`../src/web/${f}`, import.meta.url)).text(); | |
| 19 | expect(src).not.toContain("repo-lineage"); | |
| 20 | } | |
| 21 | }); |
new above
offline