Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit bd4798f92408a47f423ccd85549adae301f8b6b4
parent bf3a92349425eb02363a0911c6f073666a921e4e
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 30 Sep 2026 09:34:05 -0400

homepage: past the cap the History block says "the latest N of M commits"; the fixture publish can be capped, and source.spec checks that the log lists exactly the commits with a page

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Diffstat:
Mhomepage/app/lib/source.test.ts | 1+
Mhomepage/app/source/page.tsx | 16+++++++++++++---
Mhomepage/e2e/fixture-source.ts | 7+++++--
Mhomepage/e2e/source-history.spec.ts | 13++++++++++++-
Mhomepage/e2e/source.spec.ts | 3+++
5 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/homepage/app/lib/source.test.ts b/homepage/app/lib/source.test.ts @@ -78,6 +78,7 @@ test("malformed, wrong-version or orphaned manifests are the empty state, never const history = { href: "/source/git/log.html", commits: 3, + total: 3, head: "2".repeat(40), files: 9, bytes: 1234, diff --git a/homepage/app/source/page.tsx b/homepage/app/source/page.tsx @@ -91,11 +91,21 @@ export default function SourcePage() { <div data-testid="source-history" className="doc-measure flex flex-col gap-2"> <p className="label-machine">History</p> <p className="text-sm leading-[1.7] text-[var(--muted-foreground)]"> - Every commit of main with its diff, as static pages:{" "} + {manifest.history.total > manifest.history.commits + ? "The newest commits of main with their diffs, as static pages: the latest " + : "Every commit of main with its diff, as static pages: "} <span data-testid="source-history-commits" className="tabular"> {manifest.history.commits.toLocaleString("en-US")} - </span>{" "} - commit{manifest.history.commits === 1 ? "" : "s"}, the newest{" "} + </span> + {manifest.history.total > manifest.history.commits ? ( + <> + {" "}of{" "} + <span data-testid="source-history-total" className="tabular"> + {manifest.history.total.toLocaleString("en-US")} + </span> + </> + ) : null}{" "} + commit{manifest.history.total === 1 ? "" : "s"}, the newest{" "} <a data-testid="source-history-head" href={`/source/${HISTORY_DIR}/commit/${manifest.history.head}.html`} diff --git a/homepage/e2e/fixture-source.ts b/homepage/e2e/fixture-source.ts @@ -20,6 +20,7 @@ export const FIXTURE_SOURCE_NAME = ".e2e-source"; export const FIXTURE_HISTORY = { href: "/source/git/log.html", commits: 1234, + total: 1234, head: "c".repeat(40), files: 1240, bytes: 1_000_000, @@ -29,7 +30,9 @@ export const FIXTURE_HISTORY = { export const FIXTURE_MIRROR_HEAD = "c".repeat(40); -export function writeFixtureSource(dir: string, o: { history: boolean }): void { +// `total` over the history's `commits` is a history past the cap: the page +// says "the latest N of M". +export function writeFixtureSource(dir: string, o: { history: boolean; total?: number }): void { clearFixtureSource(dir); fs.mkdirSync(path.join(dir, "source", "archilyzer.git", "info"), { recursive: true }); fs.mkdirSync(path.join(dir, "downloads"), { recursive: true }); @@ -55,7 +58,7 @@ export function writeFixtureSource(dir: string, o: { history: boolean }): void { treeHref: "/source/tree/", audit: { objects: 3, commits: 1, gitleaks: "skipped" }, tools: { git: "2.55.0", filterRepo: "fixture" }, - ...(o.history ? { history: FIXTURE_HISTORY } : {}), + ...(o.history ? { history: { ...FIXTURE_HISTORY, total: o.total ?? FIXTURE_HISTORY.total } } : {}), }; // Written last, as the publish writes it: the page reads the fixture only // once a manifest is there. diff --git a/homepage/e2e/source-history.spec.ts b/homepage/e2e/source-history.spec.ts @@ -25,8 +25,9 @@ test("with a history in the manifest: the History block names the commits and th await expect(page.getByTestId("source-mirror-head")).toHaveText(FIXTURE_HISTORY.head); const block = page.getByTestId("source-history"); await expect(block).toBeVisible(); - await expect(block).toContainText("Every commit of main with its diff, as static pages"); + await expect(block).toContainText("Every commit of main with its diff, as static pages: 1,234 commits, the newest"); await expect(page.getByTestId("source-history-commits")).toHaveText("1,234"); + await expect(page.getByTestId("source-history-total")).toHaveCount(0); // The head, short, linking to its own commit page. await expect(page.getByTestId("source-history-head")).toHaveText(FIXTURE_HISTORY.head.slice(0, 12)); await expect(page.getByTestId("source-history-head")).toHaveAttribute("href", `/source/git/commit/${FIXTURE_HISTORY.head}.html`); @@ -37,6 +38,16 @@ test("with a history in the manifest: the History block names the commits and th await expect(page.getByTestId("source-history-atom")).toHaveText("Atom feed"); }); +test("past the cap: the History block says the latest N of M commits", async ({ page }) => { + writeFixtureSource(FIXTURE, { history: true, total: 12_345 }); + await page.goto("/source/"); + const block = page.getByTestId("source-history"); + await expect(block).toContainText("The newest commits of main with their diffs, as static pages: the latest 1,234 of 12,345 commits, the newest"); + await expect(page.getByTestId("source-history-commits")).toHaveText("1,234"); + await expect(page.getByTestId("source-history-total")).toHaveText("12,345"); + await expect(page.getByTestId("source-history-log")).toHaveAttribute("href", "/source/git/log.html"); +}); + test("without a history in the manifest: no History block, and the rest of the page as before", async ({ page }) => { writeFixtureSource(FIXTURE, { history: false }); await page.goto("/source/"); diff --git a/homepage/e2e/source.spec.ts b/homepage/e2e/source.spec.ts @@ -125,6 +125,9 @@ test("the history pages: the log, a commit, the Files index into the raw tree; t expect((await page.request.get(headHref!)).status()).toBe(200); const shown = (await page.getByTestId("source-history-commits").textContent())!.replace(/\D/g, ""); expect(shown).toBe(String(manifest.history.commits)); + // The log lists exactly the commits with a page (all of them under the cap). + const listed = await (await page.request.get("/source/git/log.html")).text(); + expect(new Set([...listed.matchAll(/<a href="commit\/([0-9a-f]{40})\.html">/g)].map((m) => m[1])).size).toBe(manifest.history.commits); // The log, with the one line the publish adds, linking back here, and the // homepage's base (dark) for a reader who has stored none.