diff --git a/state-hub/dashboard/src/repos.md b/state-hub/dashboard/src/repos.md index d8f35ff..8ef63fd 100644 --- a/state-hub/dashboard/src/repos.md +++ b/state-hub/dashboard/src/repos.md @@ -7,20 +7,32 @@ import {API} from "./components/config.js"; ``` ```js -let _repos = [], _domains = [], _sbom = [], _eps = [], _tds = [], _workstreams = [], _doi = []; +// Fast data — page renders as soon as this resolves (~200ms) +let _repos = [], _domains = [], _sbom = [], _eps = [], _tds = [], _workstreams = []; try { - [_repos, _domains, _sbom, _eps, _tds, _workstreams, _doi] = await Promise.all([ + [_repos, _domains, _sbom, _eps, _tds, _workstreams] = await Promise.all([ fetch(`${API}/repos/`).then(r => r.ok ? r.json() : []), fetch(`${API}/domains/`).then(r => r.ok ? r.json() : []), fetch(`${API}/sbom/`).then(r => r.ok ? r.json() : []), fetch(`${API}/extension-points/`).then(r => r.ok ? r.json() : []), fetch(`${API}/technical-debt/`).then(r => r.ok ? r.json() : []), fetch(`${API}/workstreams/`).then(r => r.ok ? r.json() : []), - fetch(`${API}/repos/doi/summary`).then(r => r.ok ? r.json() : []), ]); } catch {} ``` +```js +// DoI data — lazy-loaded. Starts as [] so the page renders immediately. +// When the fetch resolves (~6s), doiData updates and DoI badges appear. +import {Mutable} from "observablehq:stdlib"; +const doiData = Mutable([]); +const doiLoading = Mutable(true); +fetch(`${API}/repos/doi/summary`) + .then(r => r.ok ? r.json() : []) + .catch(() => []) + .then(data => { doiData.value = data; doiLoading.value = false; }); +``` + ```js const repos = _repos ?? []; const domains = _domains ?? []; @@ -28,7 +40,7 @@ const sbom = _sbom ?? []; const eps = _eps ?? []; const tds = _tds ?? []; const workstreams = _workstreams ?? []; -const doi = _doi ?? []; +const doi = doiData; // reactive — updates when lazy fetch completes // DoI lookups const doiBySlug = Object.fromEntries(doi.map(d => [d.repo_slug, d])); @@ -121,12 +133,15 @@ const doiNoneCount = repoRows.filter(r => r._doiTier === "none").length; import {withDocHelp} from "./components/doc-overlay.js"; const _h1 = document.querySelector("#observablehq-main h1"); if (_h1) { _h1.style.position = "relative"; withDocHelp(_h1, "/docs/repos"); } -display(html`
- DoI tiers: None → +display(html`
+ DoI tiers: None → Core → Standard → Full — - Definition of Integrated policy ↗ + Definition of Integrated policy ↗ + ${doiLoading ? html` + Loading DoI tiers… + ` : html`✓ DoI tiers loaded`}
`); ``` @@ -155,10 +170,10 @@ display(html`${gapCount}
${gapCount === 0 ? "✓ All repos covered" : `⚠ ${gapCount} repo(s) not ingested`}${doiFullCount} / ${repoRows.length}
- ${doiNoneCount > 0 ? `⚠ ${doiNoneCount} at tier None` : "✓ All pass Core tier"} +${doiLoading ? html`` : `${doiFullCount} / ${repoRows.length}`}
+ ${doiLoading ? "Loading…" : doiNoneCount > 0 ? `⚠ ${doiNoneCount} at tier None` : "✓ All pass Core tier"}