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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/4228-a-repository-head-s-lineage-line-draws-5 → main 1 commit fork

  • Merged. scout/4228-a-repository-head-s-lineage-line-draws-5 was merged into main as e5e7b5e.

Review

Sign in to review this change.
5 files changed +26 −5
src/web/chrome.ts +2 −2
@@ -339,7 +339,7 @@ export function scopeHeader(
339339 // truth for this". This line is the fallback for the one case the
340340 // strip cannot link: a fork whose origin has been disconnected.
341341 () =>
342 html`<p class="repo-lineage">
342 html`<p class="muted small break">
343343 ${icon("fork", 16)}fork of
344344 <span class="mono">${scope.upstream}</span>
345345 </p>`,
@@ -382,7 +382,7 @@ export function lineageLine(
382382 for (const p of shown.parents)
383383 segments.push(html`fork of ${out(parentUrl(shown.sourceUrl, p), p)}`);
384384 }
385 return html`<p class="repo-lineage" data-lineage>
385 return html`<p class="muted small break" data-lineage>
386386 ${segments.map((s, i) => (i === 0 ? s : html` · ${s}`))}
387387 </p>`;
388388 }
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="repo-lineage">
515 return html`<p class="muted small break">
516516 Reads from
517517 ${at.htmlUrl === ""
518518 ? host
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="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] ?? "";
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="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] ?? "";
187187 };
188188 const api = async () =>
189189 ((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 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs