From 22ddf051a1a82868d3e4eec53af471c179756f17 Mon Sep 17 00:00:00 2001 From: abrichr Date: Fri, 20 Nov 2026 22:27:20 -0500 Subject: [PATCH 01/26] feat(seal-view): make the Seal page one screen, like an app, with light and dark themes The program map fills the left pane (resizable, or the whole width), the Seal and its verdict sit top right, and Summary, Steps, Evidence and Raw tabs sit bottom right. Picking a step on the map, the ring or the list opens its evidence. Below 900 px the page is one column with the map as a tab. The verdict stays in the top bar at every width. The URL fragment keeps the tab and the step, so a link can open one step. Colours come from the shared --oa-* semantic roles; the offline viewer inlines a pinned copy of openadapt-web's semantic-theme.css without fonts. The viewer still makes no requests and checks the signature in the page. Honesty fixes: a failed read-back no longer shows the passing words, the digest line says 'not computed' when nothing was computed, and the not-loaded verdict no longer points at commands the page does not have. Wording follows openadapt.ai's ('record checks confirmed'). --- CAPABILITIES.md | 2 +- llms-full.txt | 2 +- openadapt/seal_view/viewer.html | 17 +- packages/seal-view/CHANGELOG.md | 9 + packages/seal-view/README.md | 32 +- .../seal-view/src/components/HashLine.jsx | 11 +- .../src/components/InspectorSeal.module.css | 28 +- packages/seal-view/src/components/SealArt.jsx | 36 +- .../src/components/SealArt.module.css | 92 +- .../src/components/SealEmblem.module.css | 32 +- packages/seal-view/src/components/SealMap.jsx | 34 +- .../seal-view/src/components/SealPage.jsx | 1005 +++++--- .../src/components/SealPage.module.css | 2230 ++++++++--------- .../src/vendor/semantic-theme/provenance.json | 12 + .../vendor/semantic-theme/semantic-theme.css | 123 + packages/seal-view/src/viewer/template.html | 5 +- packages/seal-view/src/viewer/viewer.jsx | 4 +- tests/snapshots/seal_viewer_size.json | 4 +- tests/test_seal_view.py | 101 + 19 files changed, 2241 insertions(+), 1538 deletions(-) create mode 100644 packages/seal-view/src/vendor/semantic-theme/provenance.json create mode 100644 packages/seal-view/src/vendor/semantic-theme/semantic-theme.css diff --git a/CAPABILITIES.md b/CAPABILITIES.md index 7f7a85d526..5157f24653 100644 --- a/CAPABILITIES.md +++ b/CAPABILITIES.md @@ -352,7 +352,7 @@ improvising or retrying when something is off. | Offline Seals signed with a key the customer holds: a key file, the OS keychain, or a PKCS#11 token or HSM; pinned keys with rotation and revocation; no fallback to a generated key | On main ([#1392](https://github.com/OpenAdaptAI/OpenAdapt/pull/1392)) | Unit tests with synthetic data (keychain and PKCS#11 through stand-ins) | `openadapt-flow local-seal --key`, `local-seal key create`, `pin`, `revoke`; `openadapt seal verify FOLDER` checks every sealed run in a folder; [OFFLINE_SEALS.md](packages/flow/docs/OFFLINE_SEALS.md#customer-held-keys) | | Anchor an offline Seal in the public Sigstore Rekor transparency log (opt-in; sends one digest and the public key), and verify the anchor offline from the stored inclusion proof | Released ([#1394](https://github.com/OpenAdaptAI/OpenAdapt/pull/1394)) | Unit tests against a simulated Rekor log; real public Rekor entries and Sigstore TSA tokens for the landing demo's referral runs, verified offline in tests; Ed25519ph matches the RFC 8032 test vector | `openadapt-flow local-seal anchor`, `local-seal verify --require-anchor`; [OFFLINE_SEALS.md](packages/flow/docs/OFFLINE_SEALS.md#optional-anchor-a-seal-in-a-public-transparency-log) | | Signed write receipts: a verifier verdict with its scope (stores read, window, strength) and a plain not-checked list, signed as a COSE_Sign1 (IETF SCITT shape) and logged in a local Merkle transparency log; checked offline against pinned keys; a receipt that claims more than its scope is neither issued nor accepted; optional Rekor anchor | On main | Unit tests on the real verifier (SQLite) and shadow proxy; COSE checked through python-cwt | `openadapt-flow receipt verify`, `receipt keys export`, `receipt anchor`; `verify_write(..., write_receipt=True)`; `shadow --receipts`; [WRITE_RECEIPTS.md](packages/flow/docs/WRITE_RECEIPTS.md) | -| See a run's Seal offline: one HTML page that checks the Ed25519 signature over the run's exact report in the browser, draws the Seal from it, replays the run over its program map, and lets the reader tamper with a copy; no network requests; the quickstart ends on the person's own | On main ([#1566](https://github.com/OpenAdaptAI/OpenAdapt/pull/1566)) | A real quickstart run's Seal opened from `file://` in Chromium (valid, tampered, no requests); RFC 8032 test vectors; a published OpenEMR Seal's Rekor entry and timestamp | `openadapt seal view RUN_DIR`; `openadapt quickstart`; [`@openadapt/seal-view`](packages/seal-view/README.md) | +| See a run's Seal offline: one HTML page that checks the Ed25519 signature over the run's exact report in the browser, draws the Seal from it, replays the run over its program map, and lets the reader tamper with a copy; no network requests; the quickstart ends on the person's own. One screen: map left, Seal and verdict top right, Summary, Steps, Evidence and Raw tabs; light and dark | On main ([#1566](https://github.com/OpenAdaptAI/OpenAdapt/pull/1566)) | A real quickstart run's Seal opened from `file://` in Chromium (valid, tampered, no requests; a link to one step, keyboard tabs and steps, theme switch, phone layout); RFC 8032 test vectors; a published OpenEMR Seal's Rekor entry and timestamp | `openadapt seal view RUN_DIR`; `openadapt quickstart`; [`@openadapt/seal-view`](packages/seal-view/README.md) | | Publish a run's Seal online: a signed public card (counts, outcomes, each step's check, digests; the program name only with `--names` or for the tutorial; never inputs, intents, screenshots, URLs or halt text) shown in full and uploaded only after a yes, with a delete token; check a hosted link here | On main ([#2266](https://github.com/OpenAdaptAI/OpenAdapt/pull/2266)) | Unit tests with synthetic reports: planted values absent from the file, 64-step card within 4,096 bytes, stopped runs, mock uploads with real sockets blocked; 29 golden vectors shared with Cloud's verifier | `openadapt-flow local-seal public`; `openadapt seal publish`, `unpublish`, `seal verify `; [OFFLINE_SEALS.md](packages/flow/docs/OFFLINE_SEALS.md#public-seals-a-summary-you-can-post) | | Run authorizations signed with the authorizer's GitHub SSH key (`ssh-keygen -Y sign`, after a summary of what it allows), naming the signing key and bound to the bundle digest, items, profile and Seal keys, and referenced by each Seal; the identity checked against github.com (`--live`) or pinned allowed signers; a pseudonymous operator profile counted from anchored Seals only | Released ([#1401](https://github.com/OpenAdaptAI/OpenAdapt/pull/1401)) | Unit tests with synthetic data; signatures checked against OpenSSH's `ssh-keygen` both ways | `openadapt-flow local-seal authorize`, `local-seal run --authorization`, `local-seal profile`; [OFFLINE_SEALS.md](packages/flow/docs/OFFLINE_SEALS.md#run-authorizations-who-authorized-the-runs) | | Run reports redacted before they are sealed: session and CSRF tokens, OAuth grants and credential headers become `` and are listed in `redactions`; a Seal refuses a report that still holds one; per-app policy | Released ([#1407](https://github.com/OpenAdaptAI/OpenAdapt/pull/1407)) | Unit tests with generated tokens; 7,773 local reports scanned, only OpenEMR `token_main` matched | `openadapt-flow redact-report`, `local-seal run --allow-unredacted`; [REPORT_REDACTION.md](packages/flow/docs/REPORT_REDACTION.md) | diff --git a/llms-full.txt b/llms-full.txt index c74a23a193..6fcb1cbfe5 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -786,7 +786,7 @@ improvising or retrying when something is off. | Offline Seals signed with a key the customer holds: a key file, the OS keychain, or a PKCS#11 token or HSM; pinned keys with rotation and revocation; no fallback to a generated key | On main ([#1392](https://github.com/OpenAdaptAI/OpenAdapt/pull/1392)) | Unit tests with synthetic data (keychain and PKCS#11 through stand-ins) | `openadapt-flow local-seal --key`, `local-seal key create`, `pin`, `revoke`; `openadapt seal verify FOLDER` checks every sealed run in a folder; [OFFLINE_SEALS.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/OFFLINE_SEALS.md#customer-held-keys) | | Anchor an offline Seal in the public Sigstore Rekor transparency log (opt-in; sends one digest and the public key), and verify the anchor offline from the stored inclusion proof | Released ([#1394](https://github.com/OpenAdaptAI/OpenAdapt/pull/1394)) | Unit tests against a simulated Rekor log; real public Rekor entries and Sigstore TSA tokens for the landing demo's referral runs, verified offline in tests; Ed25519ph matches the RFC 8032 test vector | `openadapt-flow local-seal anchor`, `local-seal verify --require-anchor`; [OFFLINE_SEALS.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/OFFLINE_SEALS.md#optional-anchor-a-seal-in-a-public-transparency-log) | | Signed write receipts: a verifier verdict with its scope (stores read, window, strength) and a plain not-checked list, signed as a COSE_Sign1 (IETF SCITT shape) and logged in a local Merkle transparency log; checked offline against pinned keys; a receipt that claims more than its scope is neither issued nor accepted; optional Rekor anchor | On main | Unit tests on the real verifier (SQLite) and shadow proxy; COSE checked through python-cwt | `openadapt-flow receipt verify`, `receipt keys export`, `receipt anchor`; `verify_write(..., write_receipt=True)`; `shadow --receipts`; [WRITE_RECEIPTS.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/WRITE_RECEIPTS.md) | -| See a run's Seal offline: one HTML page that checks the Ed25519 signature over the run's exact report in the browser, draws the Seal from it, replays the run over its program map, and lets the reader tamper with a copy; no network requests; the quickstart ends on the person's own | On main ([#1566](https://github.com/OpenAdaptAI/OpenAdapt/pull/1566)) | A real quickstart run's Seal opened from `file://` in Chromium (valid, tampered, no requests); RFC 8032 test vectors; a published OpenEMR Seal's Rekor entry and timestamp | `openadapt seal view RUN_DIR`; `openadapt quickstart`; [`@openadapt/seal-view`](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/seal-view/README.md) | +| See a run's Seal offline: one HTML page that checks the Ed25519 signature over the run's exact report in the browser, draws the Seal from it, replays the run over its program map, and lets the reader tamper with a copy; no network requests; the quickstart ends on the person's own. One screen: map left, Seal and verdict top right, Summary, Steps, Evidence and Raw tabs; light and dark | On main ([#1566](https://github.com/OpenAdaptAI/OpenAdapt/pull/1566)) | A real quickstart run's Seal opened from `file://` in Chromium (valid, tampered, no requests; a link to one step, keyboard tabs and steps, theme switch, phone layout); RFC 8032 test vectors; a published OpenEMR Seal's Rekor entry and timestamp | `openadapt seal view RUN_DIR`; `openadapt quickstart`; [`@openadapt/seal-view`](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/seal-view/README.md) | | Publish a run's Seal online: a signed public card (counts, outcomes, each step's check, digests; the program name only with `--names` or for the tutorial; never inputs, intents, screenshots, URLs or halt text) shown in full and uploaded only after a yes, with a delete token; check a hosted link here | On main ([#2266](https://github.com/OpenAdaptAI/OpenAdapt/pull/2266)) | Unit tests with synthetic reports: planted values absent from the file, 64-step card within 4,096 bytes, stopped runs, mock uploads with real sockets blocked; 29 golden vectors shared with Cloud's verifier | `openadapt-flow local-seal public`; `openadapt seal publish`, `unpublish`, `seal verify `; [OFFLINE_SEALS.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/OFFLINE_SEALS.md#public-seals-a-summary-you-can-post) | | Run authorizations signed with the authorizer's GitHub SSH key (`ssh-keygen -Y sign`, after a summary of what it allows), naming the signing key and bound to the bundle digest, items, profile and Seal keys, and referenced by each Seal; the identity checked against github.com (`--live`) or pinned allowed signers; a pseudonymous operator profile counted from anchored Seals only | Released ([#1401](https://github.com/OpenAdaptAI/OpenAdapt/pull/1401)) | Unit tests with synthetic data; signatures checked against OpenSSH's `ssh-keygen` both ways | `openadapt-flow local-seal authorize`, `local-seal run --authorization`, `local-seal profile`; [OFFLINE_SEALS.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/OFFLINE_SEALS.md#run-authorizations-who-authorized-the-runs) | | Run reports redacted before they are sealed: session and CSRF tokens, OAuth grants and credential headers become `` and are listed in `redactions`; a Seal refuses a report that still holds one; per-app policy | Released ([#1407](https://github.com/OpenAdaptAI/OpenAdapt/pull/1407)) | Unit tests with generated tokens; 7,773 local reports scanned, only OpenEMR `token_main` matched | `openadapt-flow redact-report`, `local-seal run --allow-unredacted`; [REPORT_REDACTION.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/REPORT_REDACTION.md) | diff --git a/openadapt/seal_view/viewer.html b/openadapt/seal_view/viewer.html index 206896af22..f83bd23149 100644 --- a/openadapt/seal_view/viewer.html +++ b/openadapt/seal_view/viewer.html @@ -6,24 +6,25 @@ - + OpenAdapt Seal -
- diff --git a/packages/seal-view/CHANGELOG.md b/packages/seal-view/CHANGELOG.md index 6ebf5bc031..acff6761d4 100644 --- a/packages/seal-view/CHANGELOG.md +++ b/packages/seal-view/CHANGELOG.md @@ -2,6 +2,15 @@ ## v0.1.0 (unreleased) +- The Seal page is one screen, like an app: the program map on the left + (resizable, or the whole width), the Seal and verdict top right, and + Summary, Steps, Evidence and Raw tabs bottom right; one column with the map + as a tab below 900 px. The verdict stays in the top bar. The URL's fragment + keeps the tab and the step. Light and dark themes from the shared `--oa-*` + roles; the offline viewer inlines them. A failed read-back now says "not + exactly 1" or "not equal" instead of the passing wording, and the report's + digest says "not computed" when nothing was computed. + - `SealPage`: one run's Seal, drawn from its signed report (step ring, screen checks, read-backs, right-record checks and an iris drawn from the digests), checked in the browser (Ed25519 over the exact `report.json`), diff --git a/packages/seal-view/README.md b/packages/seal-view/README.md index 3fda3fb900..c7f94716c7 100644 --- a/packages/seal-view/README.md +++ b/packages/seal-view/README.md @@ -31,12 +31,42 @@ openadapt.ai's Seal pages and `openadapt quickstart` use the same code. timestamp (`seal.tsa.json` naming its token file `seal.tsr`) are checked offline and shown only when the run has them. +## Layout + +One screen, like an app. From 900 px wide it is a split view: the program +map fills the left pane (drag the divider, or focus it and use the arrow +keys; "Expand map" or Enter gives the map the whole width), the Seal and the +verdict sit top right, and the details sit bottom right in four tabs: + +- **Summary**: the counts, the AI model calls and program time, and the + signature check (the report's SHA-256 in this browser against the one the + Seal signed), with the tamper demo. +- **Steps**: every step, with its result and checks. Up and Down move, Enter + or a click opens the step's evidence. +- **Evidence**: the picked step (on the map, the ring or the list): its + checks, its pictures when the host has them, and its record checks. +- **Raw**: the signed fields, the witnesses, the files and the commands. + +Narrower, the page is one column (the Seal and the verdict, then the tabs) +and the map is a fifth tab. The verdict stays in the top bar at every width +and on every tab. The URL's fragment keeps the tab and the step +(`#tab=evidence&step=6`, steps from 1), so a link can open one step. `j` and +`k` move to the next and previous step from anywhere but a field. + +Light and dark come from the shared semantic theme roles (`--oa-*`, +openadapt-web's `styles/semantic-theme.css`). The host provides them; the +offline viewer inlines a pinned copy without fonts +(`src/vendor/semantic-theme`, with its provenance). The visitor's choice is +`data-theme` on `` and `oa-theme` in local storage, the same as +openadapt.ai's own switch; with no choice, the system setting. + ## Use it ```jsx import { SealPage, sealPageProps } from '@openadapt/seal-view' import '@openadapt/program-graph/styles.css' import '@openadapt/seal-view/styles.css' +// and the --oa-* theme roles, e.g. openadapt-web's styles/semantic-theme.css const files = { report: reportBytes, sealText } // exact bytes and text const { page } = await sealPageProps({ files, keys, program: { spec } }) @@ -62,7 +92,7 @@ slot that `openadapt seal view RUN_DIR` fills with the run's files. Its Content-Security-Policy allows no requests, so it works from `file://` with the network off and uploads nothing. -Size, measured on 2026-10-24: 212,474 bytes (68,660 gzipped). The budget is +Size, measured on 2026-11-20: 230,946 bytes (73,545 gzipped). The budget is 262,144 bytes (`VIEWER_BUDGET` in `scripts/build.mjs`, and `tests/snapshots/seal_viewer_size.json` at the repository root); `node scripts/build.mjs --check` fails over it or when the launcher's copy is diff --git a/packages/seal-view/src/components/HashLine.jsx b/packages/seal-view/src/components/HashLine.jsx index b653b95e24..e05f8126a2 100644 --- a/packages/seal-view/src/components/HashLine.jsx +++ b/packages/seal-view/src/components/HashLine.jsx @@ -68,14 +68,19 @@ export default function HashLine({ label, from, to, against, running, still }) { const final = done && to const matches = final && to === against + // Nothing computed (before the check, or the files didn't load): say so, + // rather than show the animation's seed as if it were a digest. + const idle = !running && !to return ( -
+
{label} {final ? {matches ? ' · matches' : ' · differs'} : null} - - {final + + {idle + ? 'not computed' + : final ? [...to].map((ch, i) => ( {ch} diff --git a/packages/seal-view/src/components/InspectorSeal.module.css b/packages/seal-view/src/components/InspectorSeal.module.css index 9b82816900..2d89081804 100644 --- a/packages/seal-view/src/components/InspectorSeal.module.css +++ b/packages/seal-view/src/components/InspectorSeal.module.css @@ -5,23 +5,23 @@ margin: 0 0 14px; } .card { - --t0: #4cf0b8; - --edge: rgba(76, 240, 184, 0.45); - --wash: rgba(76, 240, 184, 0.09); + --t0: var(--seal-ok, #4cf0b8); + --edge: color-mix(in srgb, var(--seal-ok, var(--seal-ok, #4cf0b8)) 45%, transparent); + --wash: color-mix(in srgb, var(--seal-ok, var(--seal-ok, #4cf0b8)) 9%, transparent); display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--edge); border-radius: 14px; - background: linear-gradient(160deg, var(--wash), rgba(255, 255, 255, 0.02) 70%); + background: linear-gradient(160deg, var(--wash), color-mix(in srgb, var(--seal-ink, #fff) 2%, transparent) 70%); box-shadow: 0 0 28px -12px var(--edge); animation: cardIn 420ms ease-out both; } .card[data-tone='halt'] { - --t0: #ffbf55; - --edge: rgba(255, 191, 85, 0.5); - --wash: rgba(255, 191, 85, 0.09); + --t0: var(--seal-halt, #ffbf55); + --edge: color-mix(in srgb, var(--seal-halt, var(--seal-halt, #ffbf55)) 50%, transparent); + --wash: color-mix(in srgb, var(--seal-halt, var(--seal-halt, #ffbf55)) 9%, transparent); } .body { min-width: 0; @@ -36,14 +36,14 @@ } .line { margin: 0; - color: #f2f7fb; + color: var(--seal-ink, #f2f7fb); font-size: 14px; font-weight: 600; line-height: 1.35; } .sub { margin: 4px 0 10px; - color: #9fb0c3; + color: var(--seal-ink-muted, #9fb0c3); font-size: 12px; line-height: 1.4; } @@ -55,7 +55,7 @@ border: 0; border-radius: 999px; background: var(--t0); - color: #04120c; + color: var(--seal-core, #04120c); font: inherit; font-size: 13px; font-weight: 700; @@ -64,13 +64,13 @@ cursor: pointer; } .card[data-tone='halt'] .action { - color: #1a1002; + color: var(--seal-core, #1a1002); } .action:hover { filter: brightness(1.08); } .action:focus-visible { - outline: 2px solid #a2c6ff; + outline: 2px solid var(--seal-focus, #a2c6ff); outline-offset: 2px; } @keyframes cardIn { @@ -90,7 +90,7 @@ flex-wrap: wrap; gap: 4px 10px; margin: 10px 0 0; - color: #9fb0c3; + color: var(--seal-ink-muted, #9fb0c3); font-size: 12px; } .others a { @@ -98,6 +98,6 @@ font-weight: 600; } .others a:focus-visible { - outline: 2px solid #a2c6ff; + outline: 2px solid var(--seal-focus, #a2c6ff); outline-offset: 2px; } diff --git a/packages/seal-view/src/components/SealArt.jsx b/packages/seal-view/src/components/SealArt.jsx index e7181b0c12..3dd7a43f7c 100644 --- a/packages/seal-view/src/components/SealArt.jsx +++ b/packages/seal-view/src/components/SealArt.jsx @@ -301,7 +301,7 @@ function AnchorMark({ deg, kind }) { return ( - {kind === 'stop' ? 'Sealed here: the run stopped at this step' : 'Sealed here: the save its read-backs prove'} + {kind === 'stop' ? 'Sealed here: the run stopped at this step' : 'Sealed here: the save OpenAdapt confirmed by reading the record back'} @@ -321,11 +321,18 @@ function Iris({ layers, phase, broken, tone }) { useEffect(() => { const root = box.current if (!root) return undefined - const css = getComputedStyle(root) - const color = (name, fallback) => css.getPropertyValue(name).trim() || fallback - const fills = broken - ? [color('--fail', '#ff4d6a'), color('--fail', '#ff4d6a'), color('--fail', '#ff4d6a')] - : [color('--t0', '#4cf0b8'), color('--soft', '#b9fbe5'), color('--t0', '#4cf0b8')] + // The colours come from the theme's roles, read again when the theme changes. + let fills = [] + let lit = '#ffffff' + const readColors = () => { + const css = getComputedStyle(root) + const color = (name, fallback) => css.getPropertyValue(name).trim() || fallback + fills = broken + ? [color('--fail', '#ff4d6a'), color('--fail', '#ff4d6a'), color('--fail', '#ff4d6a')] + : [color('--t0', '#4cf0b8'), color('--soft', '#b9fbe5'), color('--t0', '#4cf0b8')] + lit = color('--seal-ink', '#ffffff') + } + readColors() const alphas = broken ? [0.3, 0.26, 0.22] : [0.62, 0.45, 0.35] const paths = layers.map((layer) => layer.petals.map((p) => ({ path: new Path2D(p.d), at: p.at }))) const draw = (progress) => { @@ -343,20 +350,31 @@ function Iris({ layers, phase, broken, tone }) { for (const p of paths[l]) { const lift = progress == null ? 0 : Math.max(0, 1 - Math.abs(progress - p.at) * 6) ctx.globalAlpha = Math.min(1, alphas[l] + lift * 0.6) - ctx.fillStyle = lift > 0.3 ? '#ffffff' : fills[l] + ctx.fillStyle = lift > 0.3 ? lit : fills[l] ctx.fill(p.path) } }) } draw(null) - if (phase !== 'verify' || window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined + // A frame later: the page re-renders with the new theme first. + const themed = new MutationObserver(() => + requestAnimationFrame(() => { + readColors() + draw(null) + }) + ) + themed.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] }) + if (phase !== 'verify' || window.matchMedia('(prefers-reduced-motion: reduce)').matches) return () => themed.disconnect() const start = performance.now() let frame = requestAnimationFrame(function tick(now) { const k = (now - start) / SWEEP_MS draw(k > 1.1 ? null : k) if (k <= 1.1) frame = requestAnimationFrame(tick) }) - return () => cancelAnimationFrame(frame) + return () => { + cancelAnimationFrame(frame) + themed.disconnect() + } }, [layers, phase, broken, tone]) return (