Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

design(states): give 50 dead-looking controls a hover state and gate the rest

nirholase84eab9dc58b
diff --git a/DESIGN-TOKENS.md b/DESIGN-TOKENS.md
index 60f778997..abb82ee95 100644
--- a/DESIGN-TOKENS.md
+++ b/DESIGN-TOKENS.md
@@ -171,6 +171,36 @@ state changes appearance.
Want no ring on a control? Re-style it (a different colour, an inset shadow).
Do not remove it.
+### The state a floor cannot supply: hover (QB-07)
+
+Focus and disabled are floorable because one rule fits every control. Hover is
+not: what "hovered" looks like is component-specific (a card lifts, a button
+tints, a tab brightens its underline), and a blanket rule would *stack* on the
+hundreds of components that already style their own hover instead of filling the
+gap. So hover is audited instead of floored.
+
+`npm run audit:states` ([scripts/audit-interactive-states.mjs](scripts/audit-interactive-states.mjs),
+part of `npm run gate`) finds every selector that declares `cursor: pointer` and
+has no `:hover` rule anywhere in the same stylesheet. That combination is a
+promise with nothing behind it: the pointer changes shape, the control does not,
+and it reads as dead. The count may only go **down**
+(`scripts/audit-interactive-states.baseline.json`). Invisible hit targets
+(`opacity: 0` file inputs over a drop zone), selectors already carrying a state
+pseudo-class, `@media (hover: none)` blocks and vendored third-party CSS are out
+of scope.
+
+Author the hover from tokens, on the motion ladder:
+
+```css
+.thing {
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ border-color var(--duration-fast) var(--ease-standard),
+ color var(--duration-fast) var(--ease-standard);
+}
+.thing:hover { background: var(--surface-3); border-color: var(--stroke-strong); }
+```
+
### Opting out of the reduced-motion floor
"Reduce" does not mean "remove status". A spinner frozen mid-rotation reads as a
diff --git a/package.json b/package.json
index ae4147534..7b5484f29 100644
--- a/package.json
+++ b/package.json
@@ -226,7 +226,7 @@
"audit:route-shadowing": "node scripts/audit-route-shadowing.mjs",
"audit:handlers": "node scripts/audit-empty-handlers.mjs",
"audit:x402-catalog": "node scripts/audit-x402-catalog.mjs",
- "gate": "npm run check:conflicts && npm run check:claude && npm run check:vendored && npm run check:model-viewer && npm run check:gcloudignore && npm run check:fetch-timeouts && npm run check:tdz-bootstrap && npm run check:event && npm run check:cron-syntax && npm run check:studio-openapi && npm run test:gate && npm run test:gate-3d && npm run audit:mcp && npm run audit:mcp-golden && npm run audit:mcp-safety && npm run audit:mcp-catalog && npm run audit:mcp-listing && npm run audit:routes && npm run audit:handlers && npm run audit:pages && npm run audit:links && npm run check:awesome && npm run audit:docs && npm run audit:upstreams && npm run check:tutorials && npm run audit:hidden-guard && npm run audit:inline-handlers && npm run audit:x402-catalog && npm run audit:tokens && npm run audit:guards && npm run audit:tour-atlas && npm run check:ios-icons && npm run check:macos-icon && npm run check:apple-widget",
+ "gate": "npm run check:conflicts && npm run check:claude && npm run check:vendored && npm run check:model-viewer && npm run check:gcloudignore && npm run check:fetch-timeouts && npm run check:tdz-bootstrap && npm run check:event && npm run check:cron-syntax && npm run check:studio-openapi && npm run test:gate && npm run test:gate-3d && npm run audit:mcp && npm run audit:mcp-golden && npm run audit:mcp-safety && npm run audit:mcp-catalog && npm run audit:mcp-listing && npm run audit:routes && npm run audit:handlers && npm run audit:pages && npm run audit:links && npm run check:awesome && npm run audit:docs && npm run audit:upstreams && npm run check:tutorials && npm run audit:hidden-guard && npm run audit:inline-handlers && npm run audit:x402-catalog && npm run audit:tokens && npm run audit:states && npm run audit:guards && npm run audit:tour-atlas && npm run check:ios-icons && npm run check:macos-icon && npm run check:apple-widget",
"test:gate-3d": "vitest run tests/glb-canonicalize.test.js tests/animation-retarget.test.js tests/animation-retarget-rest-pollution.test.js tests/viewer-framing.test.js",
"audit:mcp-golden": "node scripts/audit-mcp-golden.mjs",
"audit:mcp-safety": "node scripts/audit-mcp-safety.mjs",
@@ -238,6 +238,7 @@
"audit:csp": "node scripts/audit-csp.mjs",
"audit:hidden-guard": "node scripts/audit-hidden-guard.mjs",
"audit:tokens": "node scripts/audit-token-drift.mjs",
+ "audit:states": "node scripts/audit-interactive-states.mjs",
"audit:guards": "node scripts/audit-guards.mjs",
"audit:tour-atlas": "node scripts/build-tour-atlas.mjs --check",
"audit:tour-global": "node scripts/sync-tour-global.mjs --check",
diff --git a/public/brain.css b/public/brain.css
index 5170771f9..4c49b873a 100644
--- a/public/brain.css
+++ b/public/brain.css
@@ -1245,3 +1245,42 @@ body {
.br-topbar-right { gap: 5px; }
.br-topbar-btn { padding: 5px 8px; font-size: 11.5px; }
}
+
+/* ── Interactive states (QB-07) ────────────────────────────────────────────
+ Six controls here set cursor: pointer and had no hover rule, so the pointer
+ changed shape and nothing else did, which reads as a dead control. Each now
+ answers on the platform ladder (--duration-fast, --ease-standard). Focus and
+ disabled are already covered by the floors in public/tokens.css. */
+.br-sess-name,
+.br-agent-bar-sel,
+.br-agent-select,
+.br-focus-sel {
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ border-color var(--duration-fast) var(--ease-standard),
+ color var(--duration-fast) var(--ease-standard);
+}
+
+.br-sess-name:hover {
+ color: var(--ink-bright);
+}
+
+.br-agent-bar-sel:hover {
+ color: var(--ink-bright);
+}
+
+.br-agent-select:hover,
+.br-focus-sel:hover {
+ border-color: var(--stroke-strong);
+ color: var(--ink);
+}
+
+.br-mode-btn:hover:not(.active):not(:disabled) {
+ color: var(--ink-dim);
+ background: var(--surface-1);
+}
+
+.br-pill:hover:not(:disabled) {
+ border-color: var(--stroke-strong);
+ color: var(--ink-dim);
+}
diff --git a/public/marketplace.css b/public/marketplace.css
index 4ffb1843a..91030d35f 100644
--- a/public/marketplace.css
+++ b/public/marketplace.css
@@ -147,6 +147,10 @@ body.market-page > header {
font-size: 13px;
cursor: pointer;
}
+.market-sort:hover {
+ background: var(--surface-2);
+ border-color: var(--accent);
+}
/* ── Discovery body ──────────────────────────────────────────────────── */
@@ -506,6 +510,13 @@ body.market-page > header {
border-radius: var(--radius-md);
cursor: pointer;
}
+.market-loadmore button:hover {
+ background: var(--surface-3);
+ border-color: var(--accent);
+}
+.market-loadmore button:active {
+ transform: translateY(1px);
+}
/* ── Avatar deep-link detail page ────────────────────────────────────── */
@@ -1241,6 +1252,10 @@ body.market-page > header {
cursor: pointer;
padding: var(--space-xs) var(--space-sm);
}
+.market-back:hover {
+ color: var(--ink-bright);
+ transform: translateX(-2px);
+}
.market-detail-head {
display: flex;
@@ -1306,6 +1321,10 @@ body.market-page > header {
font-size: 22px;
cursor: pointer;
}
+.market-bookmark:hover {
+ color: var(--warn);
+ transform: scale(1.1);
+}
.market-bookmark.on {
color: var(--warn);
@@ -1329,6 +1348,10 @@ body.market-page > header {
border-bottom: 2px solid transparent;
white-space: nowrap;
}
+.market-tabs button:hover {
+ color: var(--ink);
+ border-bottom-color: var(--stroke-strong);
+}
.market-tabs button.active {
color: var(--ink);
@@ -1901,7 +1924,7 @@ body.market-page > header {
.market-fork {
background: #fafafa;
- color: #000000;
+ color: var(--on-bright);
border: 0;
padding: var(--space-md);
border-radius: var(--radius-md);
@@ -1923,6 +1946,11 @@ body.market-page > header {
font-size: 13px;
cursor: pointer;
}
+.market-export-btn:hover {
+ background: var(--surface-2);
+ border-color: var(--accent);
+ color: var(--ink);
+}
.market-overview-card {
font-size: 13px;
@@ -2199,7 +2227,7 @@ body.market-page > header {
.plugin-install-btn {
background: var(--accent);
- color: #000000;
+ color: var(--on-accent);
border: 0;
border-radius: var(--radius-sm);
padding: var(--space-xs) var(--space-md);
@@ -2259,6 +2287,10 @@ body.market-page > header {
color: var(--ink-dim);
cursor: pointer;
}
+.close-button:hover {
+ color: var(--ink-bright);
+ transform: rotate(90deg);
+}
/* ── Add by URL modal ────────────────────────────────────────────────── */
@@ -2376,13 +2408,25 @@ body.market-page > header {
cursor: pointer;
font-family: inherit;
}
+.plugin-modal-btn:hover:not(:disabled) {
+ background: var(--surface-3);
+ border-color: var(--stroke-strong);
+ color: var(--ink);
+}
+.plugin-modal-btn:active:not(:disabled) {
+ transform: translateY(1px);
+}
.plugin-modal-btn-primary {
background: var(--accent);
- color: #000000;
+ color: var(--on-accent);
border: 0;
font-weight: 600;
}
+.plugin-modal-btn-primary:hover:not(:disabled) {
+ background: var(--btn-primary-bg-hover);
+ color: var(--on-accent);
+}
.plugin-modal-btn:disabled {
opacity: 0.5;
@@ -2436,6 +2480,10 @@ body.market-page > header {
cursor: pointer;
line-height: 1;
}
+.market-modal-close:hover {
+ color: var(--ink-bright);
+ transform: rotate(90deg);
+}
.market-submit-form {
display: flex;
@@ -2500,7 +2548,7 @@ body.market-page > header {
.market-btn-pri {
background: var(--accent);
- color: #000000;
+ color: var(--on-accent);
border: 0;
border-radius: var(--radius-sm);
padding: var(--space-sm) var(--space-md);
@@ -2508,6 +2556,12 @@ body.market-page > header {
font-weight: 600;
cursor: pointer;
}
+.market-btn-pri:hover:not(:disabled) {
+ background: var(--btn-primary-bg-hover);
+}
+.market-btn-pri:active:not(:disabled) {
+ transform: translateY(1px);
+}
.market-btn-sec {
background: var(--surface-2);
@@ -2518,10 +2572,15 @@ body.market-page > header {
font-size: 14px;
cursor: pointer;
}
+.market-btn-sec:hover {
+ background: var(--surface-3);
+ border-color: var(--stroke-strong);
+ color: var(--ink);
+}
.market-submit-btn {
background: var(--accent);
- color: #000000;
+ color: var(--on-accent);
border: 0;
border-radius: var(--radius-sm);
padding: var(--space-xs) var(--space-md);
@@ -2733,6 +2792,10 @@ body.market-page > header {
font-size: 12px;
text-decoration: underline;
}
+.msm-note .msm-note-cta:hover {
+ color: var(--ink-bright);
+ text-decoration-thickness: 2px;
+}
.msm-error {
flex-basis: 100%;
@@ -2763,6 +2826,11 @@ body.market-page > header {
cursor: pointer;
align-self: flex-start;
}
+.market-import-btn:hover {
+ background: var(--surface-2);
+ border-color: var(--stroke-strong);
+ color: var(--ink);
+}
.market-json-input {
background: var(--surface-2);
@@ -3550,12 +3618,18 @@ body.market-page > header {
border: 0;
cursor: pointer;
padding: 0;
- transition: background 0.2s, width 0.2s;
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ width var(--duration-fast) var(--ease-standard);
}
.market-hero-dot.active {
background: var(--ink);
width: 36px;
}
+.market-hero-dot:hover:not(.active) {
+ background: var(--stroke-strong);
+ width: 28px;
+}
/* ── Filter chips (All / Agents / Avatars) ──────────────────── */
@@ -5135,6 +5209,7 @@ body.market-page > header {
.anim-buy-note-err { color: #fca5a5; }
.anim-buy-snippet { margin-top: 16px; border-top: 1px solid var(--stroke); padding-top: 12px; }
.anim-buy-snippet summary { font-size: 12px; font-weight: 600; color: #c7d2fe; cursor: pointer; }
+.anim-buy-snippet summary:hover { color: var(--ink-bright); }
.anim-buy-endpoint { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.anim-buy-endpoint code {
flex: 1; min-width: 0;
@@ -5187,7 +5262,7 @@ body.market-page > header {
gap: 7px;
width: 100%;
background: var(--accent);
- color: #000000;
+ color: var(--on-accent);
border: 0;
border-radius: var(--radius-sm);
padding: var(--space-xs) var(--space-md);
@@ -5381,3 +5456,33 @@ body.market-page > header {
font-weight: 700;
letter-spacing: 0.02em;
}
+
+/* ── Interactive-state motion (QB-07) ──────────────────────────────────────
+ The controls above promise they are clickable (cursor: pointer) and now
+ answer that promise on hover. This is the one place that gives those hovers
+ their timing, so the whole surface moves on a single ladder: --duration-fast
+ for a control, the standard easing, and only cheap properties (colour, and
+ transform, which the compositor handles). prefers-reduced-motion is honoured
+ platform-wide by the floor in public/tokens.css, so there is no media query
+ to repeat here. */
+.market-sort,
+.market-loadmore button,
+.market-back,
+.market-bookmark,
+.market-tabs button,
+.market-export-btn,
+.close-button,
+.plugin-modal-btn,
+.market-modal-close,
+.market-btn-pri,
+.market-btn-sec,
+.msm-note .msm-note-cta,
+.market-import-btn,
+.anim-buy-snippet summary {
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ border-color var(--duration-fast) var(--ease-standard),
+ color var(--duration-fast) var(--ease-standard),
+ text-decoration-thickness var(--duration-fast) var(--ease-standard),
+ transform var(--duration-fast) var(--ease-standard);
+}
diff --git a/public/pump-dashboard.css b/public/pump-dashboard.css
index 195d995a6..c07f03e3b 100644
--- a/public/pump-dashboard.css
+++ b/public/pump-dashboard.css
@@ -1160,3 +1160,34 @@ code, .pd-mono-inline {
.pd-switch input:checked + .pd-switch-track { background: var(--accent); }
.pd-switch input:checked + .pd-switch-track .pd-switch-thumb { transform: translateX(15px); }
.pd-switch input:focus-visible + .pd-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
+
+/* ── Interactive states (QB-07) ────────────────────────────────────────────
+ Four controls set cursor: pointer with no hover rule. The switch and the
+ toggle are the ones that matter most: a track that never lights up under the
+ pointer reads as a decorative graphic rather than a switch. */
+.pd-check:hover {
+ color: var(--ink-bright);
+}
+
+.pd-chip-action:hover {
+ text-decoration-thickness: 2px;
+ filter: brightness(1.15);
+}
+
+.pd-switch:hover .pd-switch-track {
+ background: var(--surface-3);
+ border-color: var(--stroke-strong);
+}
+
+.pd-toggle:hover:not(:disabled) {
+ border-color: var(--stroke-strong);
+ background: var(--surface-2);
+}
+
+.pd-check,
+.pd-chip-action {
+ transition:
+ color var(--duration-fast) var(--ease-standard),
+ filter var(--duration-fast) var(--ease-standard),
+ text-decoration-thickness var(--duration-fast) var(--ease-standard);
+}
diff --git a/public/studio/studio.css b/public/studio/studio.css
index 2eaf004f2..51fd94dba 100644
--- a/public/studio/studio.css
+++ b/public/studio/studio.css
@@ -1932,3 +1932,44 @@ a:hover {
border: 1px solid var(--border);
border-radius: 999px;
}
+
+/* ── Interactive states (QB-07) ────────────────────────────────────────────
+ Seven controls in Widget Studio set cursor: pointer with no hover rule, so
+ the pointer changed shape and the control did not. Each answers now on the
+ platform ladder (--duration-fast, --ease-standard); focus and disabled come
+ from the floors in public/tokens.css. */
+.field input[type='checkbox'],
+.field input[type='color'],
+.field--range input[type='range'],
+.kp-drop-link,
+.kp-section summary,
+.modal details summary,
+.walk-bg-transparent {
+ transition:
+ border-color var(--duration-fast) var(--ease-standard),
+ color var(--duration-fast) var(--ease-standard),
+ transform var(--duration-fast) var(--ease-standard);
+}
+
+.field input[type='checkbox']:hover,
+.field--range input[type='range']:hover {
+ transform: scale(1.08);
+}
+
+.field input[type='color']:hover {
+ border-color: var(--accent);
+}
+
+.kp-drop-link:hover {
+ color: var(--ink-bright);
+ text-decoration-thickness: 2px;
+}
+
+.kp-section summary:hover,
+.modal details summary:hover {
+ color: var(--ink-bright);
+}
+
+.walk-bg-transparent:hover {
+ color: var(--ink-bright);
+}
diff --git a/public/style.css b/public/style.css
index 0ea3ccc1e..dedd13ab1 100644
--- a/public/style.css
+++ b/public/style.css
@@ -4428,6 +4428,25 @@ body.deploy-page {
font-size: var(--text-sm);
cursor: pointer;
}
+/* QB-07 interactive-state pass: every control below promises it is clickable
+ (cursor: pointer) and now answers on hover, on the platform's motion ladder
+ (--duration-fast, --ease-standard). Focus and disabled come from the floors
+ in public/tokens.css; hover is the one a component has to author. */
+.showcase-sort-sel,
+.erc8004-accordion-head,
+.erc8004-checkbox,
+.erc8004-checkbox input[type='checkbox'] {
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ border-color var(--duration-fast) var(--ease-standard),
+ color var(--duration-fast) var(--ease-standard),
+ transform var(--duration-fast) var(--ease-standard);
+}
+
+.showcase-sort-sel:hover {
+ background: var(--surface-3);
+ border-color: var(--accent);
+}
.showcase-sort-sel option {
background: #151515;
color: #e6e6e6;
@@ -7940,6 +7959,13 @@ body[data-viewer-mode='main'][data-authed='false'] .auth-gate {
justify-content: space-between;
align-items: center;
}
+.erc8004-accordion-head:hover {
+ color: var(--ink-bright);
+ background: var(--surface-1);
+}
+.erc8004-accordion-head:hover::after {
+ color: var(--ink);
+}
.erc8004-accordion-head::after {
content: '▼';
@@ -8041,6 +8067,9 @@ body[data-viewer-mode='main'][data-authed='false'] .auth-gate {
cursor: pointer;
user-select: none;
}
+.erc8004-checkbox:hover {
+ color: var(--ink-bright);
+}
.erc8004-checkbox input[type='checkbox'] {
width: 16px;
@@ -8048,6 +8077,9 @@ body[data-viewer-mode='main'][data-authed='false'] .auth-gate {
accent-color: #b15bff;
cursor: pointer;
}
+.erc8004-checkbox input[type='checkbox']:hover {
+ transform: scale(1.12);
+}
.erc8004-qr-canvas-wrap {
display: flex;
diff --git a/scripts/audit-interactive-states.baseline.json b/scripts/audit-interactive-states.baseline.json
new file mode 100644
index 000000000..930c06276
--- /dev/null
+++ b/scripts/audit-interactive-states.baseline.json
@@ -0,0 +1,70 @@
+{
+ "total": 108,
+ "perFile": {
+ "src/agent-picker.css": 2,
+ "src/avatar-gallery-picker.css": 2,
+ "src/character-creator.css": 1,
+ "src/character.css": 1,
+ "src/clash.css": 1,
+ "src/creations.css": 1,
+ "src/defi.css": 2,
+ "src/diorama/diorama.css": 1,
+ "src/economy-lab.css": 2,
+ "src/exchanges.css": 1,
+ "src/exit-lab.css": 3,
+ "src/flow-map.css": 1,
+ "src/friends-panel.css": 1,
+ "src/game/coin-buy.css": 1,
+ "src/game/coincommunities.css": 5,
+ "src/game/play-systems.css": 1,
+ "src/game/spin-wheel.css": 1,
+ "src/genesis.css": 1,
+ "src/holo.css": 1,
+ "src/home/home.css": 2,
+ "src/labor-market.css": 3,
+ "src/launch-copilot.css": 2,
+ "src/launcher-base.css": 1,
+ "src/launches.css": 1,
+ "src/leaderboard.css": 2,
+ "src/model.css": 3,
+ "src/play/war.css": 1,
+ "src/pocket.css": 1,
+ "src/portfolio.css": 3,
+ "src/pulse.css": 1,
+ "src/pump/launch-token-modal.css": 1,
+ "src/radar.css": 1,
+ "src/reasoning-ledger.css": 2,
+ "src/render-lab.css": 1,
+ "src/search-page.css": 1,
+ "src/signals.css": 1,
+ "src/trader.css": 1,
+ "src/vault.css": 1,
+ "src/watchlist.css": 1,
+ "src/yields.css": 2,
+ "public/app-next.css": 1,
+ "public/auth.css": 2,
+ "public/avatar-sdk.css": 1,
+ "public/avatar-studio-demo.css": 4,
+ "public/brain-studio.css": 2,
+ "public/choreograph.css": 3,
+ "public/dashboard-next/shell.css": 1,
+ "public/docs/walk/docs.css": 1,
+ "public/docs-freshness.css": 1,
+ "public/docs-live.css": 1,
+ "public/docs-world.css": 2,
+ "public/galaxy.css": 4,
+ "public/gallery/gallery.css": 1,
+ "public/genome.css": 2,
+ "public/home.css": 2,
+ "public/instant.css": 1,
+ "public/master-wallet.css": 1,
+ "public/memory-studio.css": 3,
+ "public/model-diff.css": 2,
+ "public/my-agents/my-agents.css": 2,
+ "public/nav.css": 1,
+ "public/oracle-coin.css": 1,
+ "public/pipeline-studio.css": 1,
+ "public/studio-panels.css": 4,
+ "public/widgets-gallery/gallery.css": 3
+ }
+}
diff --git a/scripts/audit-interactive-states.mjs b/scripts/audit-interactive-states.mjs
new file mode 100644
index 000000000..3559d0c8f
--- /dev/null
+++ b/scripts/audit-interactive-states.mjs
@@ -0,0 +1,213 @@
+#!/usr/bin/env node
+/**
+ * Interactive-state ratchet (QB-07): every clickable thing must answer the pointer.
+ *
+ * B14 gave the platform a focus floor and a disabled floor in public/tokens.css,
+ * so a keyboard user now sees a ring on every control and a disabled control
+ * always reads as disabled. Hover is the state those floors cannot cover: what
+ * "hovered" looks like is component-specific (a card lifts, a button tints, a
+ * tab brightens its underline), and a blanket rule would stack on top of every
+ * component that already styles its own hover instead of filling the gap.
+ *
+ * So it is audited instead. A selector that declares `cursor: pointer` is
+ * telling the user "this is clickable"; if the same stylesheet never defines a
+ * :hover rule for it, that promise has no feedback behind it. The pointer
+ * changes shape and nothing else happens, which reads as a dead control.
+ *
+ * What counts as covered: any rule in the same file whose selector is this
+ * selector followed by :hover, or that contains it with a :hover on an ancestor
+ * (`.card:hover .thumb`). Selectors already carrying a state pseudo-class are
+ * not themselves audited, and neither is anything inside @media (hover: none),
+ * where a hover state is meaningless.
+ *
+ * The count may only go DOWN, same contract as the token-drift ratchet: the
+ * baseline lives in audit-interactive-states.baseline.json and a run that
+ * exceeds it fails and names the file plus the exact selectors that regressed.
+ *
+ * Usage:
+ * node scripts/audit-interactive-states.mjs # exit 1 if it increased
+ * node scripts/audit-interactive-states.mjs --list # print every gap
+ * node scripts/audit-interactive-states.mjs --update # rewrite the baseline
+ */
+import { readFileSync, writeFileSync, readdirSync, statSync } from 'node:fs';
+import { join, relative, dirname } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
+const BASELINE_PATH = join(ROOT, 'scripts', 'audit-interactive-states.baseline.json');
+
+/** Every stylesheet we author, minus build output and vendored third-party CSS
+ * (public/scene-studio/libs holds CodeMirror; its hover model is not ours to
+ * change and editing it would be overwritten by the next version bump). */
+const SKIP_DIRS = new Set(['node_modules', 'vendor', 'assets', 'libs', 'dist']);
+
+function collectStylesheets(dir) {
+ const out = [];
+ for (const entry of readdirSync(dir)) {
+ const p = join(dir, entry);
+ if (statSync(p).isDirectory()) {
+ if (SKIP_DIRS.has(entry)) continue;
+ out.push(...collectStylesheets(p));
+ } else if (entry.endsWith('.css')) {
+ out.push(p);
+ }
+ }
+ return out;
+}
+
+/** Drop comments, and drop @media blocks where hover cannot happen. */
+function normalize(css) {
+ const noComments = css.replace(/\/\*[\s\S]*?\*\//g, '');
+ // Remove `@media (hover: none) …{ … }` including its nested rules. Brace
+ // counting, because the block contains rules with their own braces.
+ let out = '';
+ let i = 0;
+ while (i < noComments.length) {
+ const at = noComments.indexOf('@media', i);
+ if (at === -1) {
+ out += noComments.slice(i);
+ break;
+ }
+ const open = noComments.indexOf('{', at);
+ if (open === -1) {
+ out += noComments.slice(i);
+ break;
+ }
+ const query = noComments.slice(at, open);
+ if (!/hover\s*:\s*none/.test(query)) {
+ out += noComments.slice(i, open + 1);
+ i = open + 1;
+ continue;
+ }
+ out += noComments.slice(i, at);
+ let depth = 1;
+ let j = open + 1;
+ while (j < noComments.length && depth > 0) {
+ if (noComments[j] === '{') depth++;
+ else if (noComments[j] === '}') depth--;
+ j++;
+ }
+ i = j;
+ }
+ return out;
+}
+
+const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+
+function gapsIn(css) {
+ const sheet = normalize(css);
+ const rules = [...sheet.matchAll(/([^{}]+)\{([^{}]*)\}/g)];
+ const gaps = new Set();
+ for (const [, selectorList, body] of rules) {
+ if (!/cursor:\s*pointer/.test(body)) continue;
+ // An invisible hit target (the transparent <input type=file> stretched
+ // over a drop zone, a bare click-catcher) has nothing to restyle; the
+ // visible element under it owns the feedback.
+ if (/opacity:\s*0\s*(;|$)/.test(body)) continue;
+ for (const selector of selectorList.split(',').map((s) => s.trim()).filter(Boolean)) {
+ if (!selector || selector.startsWith('@')) continue;
+ // A selector that already names a state is not the thing being audited.
+ if (/:hover|:focus|:active|:checked/.test(selector)) continue;
+ const escaped = escapeRe(selector);
+ // Three ways a hover rule can cover this selector:
+ // .x:hover is the direct rule
+ // .x .y:hover / .x:hover .y is a :hover elsewhere in the compound
+ // button.tag-pill:hover for .pills .tag-pill is the same element
+ // reached through a differently-spelled selector, so the LAST
+ // compound carrying a hover counts. Without this the audit files
+ // a finding against a control that visibly does respond.
+ const lastCompound = selector.split(/[\s>+~]+/).filter(Boolean).pop() || selector;
+ // `:hover` can sit on either side of the selector in a covering rule:
+ // `.x:hover .y` (ancestor) and `.x .y:hover` (self) both style it.
+ const inSameSelector = new RegExp(
+ `(?:${escaped}[^{},]*:hover|:hover[^{},]*${escaped})`,
+ );
+ const covered =
+ new RegExp(`${escaped}:hover`).test(sheet) ||
+ inSameSelector.test(sheet) ||
+ (lastCompound !== selector &&
+ // Only when the compound is specific enough to name one
+ // component. A bare `button` or `summary` tail would match
+ // any `button:hover` in the file and hide every real gap.
+ /[.#[]/.test(lastCompound) &&
+ new RegExp(`${escapeRe(lastCompound)}(?=[^{},]*:hover)`).test(sheet));
+ if (covered) continue;
+ gaps.add(selector);
+ }
+ }
+ return [...gaps];
+}
+
+function audit() {
+ const perFile = {};
+ let total = 0;
+ for (const sheet of [
+ ...collectStylesheets(join(ROOT, 'src')),
+ ...collectStylesheets(join(ROOT, 'public')),
+ ]) {
+ const gaps = gapsIn(readFileSync(sheet, 'utf8'));
+ if (gaps.length) {
+ perFile[relative(ROOT, sheet)] = gaps.sort();
+ total += gaps.length;
+ }
+ }
+ return { total, perFile };
+}
+
+const { total, perFile } = audit();
+
+if (process.argv.includes('--list')) {
+ for (const [file, gaps] of Object.entries(perFile).sort((a, b) => b[1].length - a[1].length)) {
+ console.log(`${file} (${gaps.length})`);
+ for (const g of gaps) console.log(` ${g}`);
+ }
+ console.log(`\n${total} clickable selector(s) with no hover rule.`);
+ process.exit(0);
+}
+
+if (process.argv.includes('--update')) {
+ const counts = Object.fromEntries(
+ Object.entries(perFile).map(([file, gaps]) => [file, gaps.length]),
+ );
+ writeFileSync(BASELINE_PATH, JSON.stringify({ total, perFile: counts }, null, '\t') + '\n');
+ console.log(`✓ interactive-state baseline updated: ${total} clickable selector(s) with no hover rule.`);
+ process.exit(0);
+}
+
+let baseline;
+try {
+ baseline = JSON.parse(readFileSync(BASELINE_PATH, 'utf8'));
+} catch {
+ console.error('✗ missing baseline (run: node scripts/audit-interactive-states.mjs --update)');
+ process.exit(1);
+}
+
+if (total > baseline.total) {
+ console.error(
+ `\n✗ interactive-state gaps increased: ${total} clickable selector(s) with no hover rule (baseline ${baseline.total}).\n`,
+ );
+ for (const [file, gaps] of Object.entries(perFile)) {
+ const was = baseline.perFile[file] || 0;
+ if (gaps.length > was) {
+ console.error(` ${file}: ${gaps.length} (was ${was})`);
+ for (const g of gaps) console.error(` ${g}`);
+ }
+ }
+ console.error(
+ '\nA selector that sets cursor: pointer promises the element is clickable.\n' +
+ 'Give it a :hover rule built from tokens, e.g.\n' +
+ ' .thing:hover { background: var(--surface-3); border-color: var(--stroke-strong); }\n' +
+ 'Focus and disabled are already covered platform-wide by the floors in\n' +
+ 'public/tokens.css (see DESIGN-TOKENS.md); hover is the one you must author.\n',
+ );
+ process.exit(1);
+}
+
+if (total < baseline.total) {
+ console.log(
+ `✓ interactive-state gaps: ${total} (baseline ${baseline.total}), improved. Lock it in with:\n` +
+ ' node scripts/audit-interactive-states.mjs --update',
+ );
+} else {
+ console.log(`✓ interactive-state gaps unchanged: ${total} clickable selector(s) with no hover rule.`);
+}
diff --git a/src/agent-detail.css b/src/agent-detail.css
index 6774c2e9d..e75931ce5 100644
--- a/src/agent-detail.css
+++ b/src/agent-detail.css
@@ -2907,3 +2907,46 @@ div.ad-hero-avatar canvas {
color: var(--ad-green);
font-variant-numeric: tabular-nums;
}
+
+/* ── Interactive states (QB-07) ────────────────────────────────────────────
+ Four controls set cursor: pointer with no hover rule. The two retry buttons
+ are the ones that hurt: they only appear after something already failed, and
+ a recovery action that gives no feedback under the pointer reads as broken
+ too. Focus and disabled come from the floors in public/tokens.css. */
+.ad-collapse summary,
+.payment-gift-toggle input[type='checkbox'],
+.retry-primary,
+.retry-secondary {
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ border-color var(--duration-fast) var(--ease-standard),
+ color var(--duration-fast) var(--ease-standard),
+ transform var(--duration-fast) var(--ease-standard);
+}
+
+.ad-collapse summary:hover {
+ background: var(--ad-bg-2);
+}
+
+.ad-collapse summary:hover::after {
+ color: var(--ad-text);
+}
+
+.payment-gift-toggle input[type='checkbox']:hover {
+ transform: scale(1.12);
+}
+
+.retry-primary:hover {
+ background: var(--ink-bright);
+ border-color: var(--ink-bright);
+}
+
+.retry-secondary:hover {
+ border-color: var(--ad-text);
+ color: var(--ad-text);
+}
+
+.retry-primary:active,
+.retry-secondary:active {
+ transform: translateY(1px);
+}
diff --git a/src/deploy-onchain.css b/src/deploy-onchain.css
index f798ced88..802dabf49 100644
--- a/src/deploy-onchain.css
+++ b/src/deploy-onchain.css
@@ -333,3 +333,23 @@
.do-live-dot, .do-stages li.active::before { animation: none; }
.do-agent-tile, .do-btn { transition: none; }
}
+
+/* ── Interactive states (QB-07) ────────────────────────────────────────────
+ The advanced disclosure, the JSON tabs and the option toggles all set
+ cursor: pointer and defined no hover, so a user aiming at a tab got no
+ confirmation they were on it. Focus and disabled come from the floors in
+ public/tokens.css. */
+.do-adv summary,
+.do-json-tab,
+.do-toggle,
+.do-toggle input {
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ color var(--duration-fast) var(--ease-standard),
+ transform var(--duration-fast) var(--ease-standard);
+}
+
+.do-adv summary:hover h2 { color: var(--ink-bright); }
+.do-json-tab:hover:not(.active) { color: var(--ink); background: var(--surface-2); }
+.do-toggle:hover { color: var(--ink-bright); }
+.do-toggle input:hover { transform: scale(1.1); }