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.

fix(play): give the voice HUD button an instant keyboard focus ring, fix two false a11y-test positives

nirholas8e281a07c718
diff --git a/src/game/coincommunities.css b/src/game/coincommunities.css
index 45e98668f..eddb98db9 100644
--- a/src/game/coincommunities.css
+++ b/src/game/coincommunities.css
@@ -928,7 +928,15 @@ html[data-bg="transparent"] #cc-lobby {
transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.cc-voice:hover { border-color: var(--cc-edge-hi); color: var(--cc-text); background: rgba(255, 255, 255, 0.05); }
-.cc-voice:focus-visible { outline: none; border-color: var(--cc-edge-hi); box-shadow: 0 0 0 1px var(--cc-edge-hi); }
+/* The glow below rides `.cc-voice`'s own transition, so a keyboard user tabbing
+ here would otherwise get no visible change for a whole 120ms (masked further
+ for anyone with reduced-motion, whose transitions collapse to ~0). Every other
+ bespoke focus ring in this file uses `outline`, which is not transitioned and
+ so lands the instant focus moves; this one relied on `outline: none` plus an
+ animated border/shadow and was the one control in the HUD with no immediate
+ focus signal. Keep the glow, but pair it with an instant outline like its
+ siblings (.cc-emote, .cc-reaction) so the ring is never mid-transition-only. */
+.cc-voice:focus-visible { outline: 1px solid var(--cc-edge-hi); outline-offset: 2px; border-color: var(--cc-edge-hi); box-shadow: 0 0 0 1px var(--cc-edge-hi); }
.cc-voice:disabled { opacity: 0.45; cursor: not-allowed; }
.cc-voice-ico { display: inline-flex; }
.cc-voice-ico svg { width: 16px; height: 16px; display: block; }
diff --git a/tests/e2e/play-a11y.spec.js b/tests/e2e/play-a11y.spec.js
index a54bc1c75..fe3d794ff 100644
--- a/tests/e2e/play-a11y.spec.js
+++ b/tests/e2e/play-a11y.spec.js
@@ -90,16 +90,27 @@ test.describe('/play accessibility floor', () => {
const rows = await page.evaluate(() => {
const W = window.__wcag;
const WHITE_SCENE = [255, 255, 255]; // noon sky / snow / white plaza
+ // Emoji glyphs render in their own native full colour regardless of the
+ // CSS `color` value (the same reason axe-core's colour-contrast rule
+ // exempts them), so measuring "text colour vs background" for a cell
+ // that is only emoji is a false signal, not a real legibility problem.
+ const EMOJI_ONLY = /^[\p{Extended_Pictographic}\p{Emoji_Presentation}\s‍️]+$/u;
const out = [];
for (const el of document.querySelectorAll('#cc-hud *')) {
if (el.children.length || !el.textContent.trim()) continue;
+ if (EMOJI_ONLY.test(el.textContent.trim())) continue;
const r = el.getBoundingClientRect();
if (!r.width || !r.height) continue;
const s = getComputedStyle(el);
if (s.visibility === 'hidden' || s.display === 'none') continue;
const fg = W.parse(s.color);
if (!fg) continue;
- const bg = W.effectiveBg(el.parentElement, WHITE_SCENE);
+ // Composite from the element itself, not just its ancestors: a leaf
+ // control that paints its own opaque background (e.g. the white
+ // .cc-chat-send button) is what visually sits behind its own text,
+ // and starting one level up skipped that background entirely,
+ // reading the HUD panel's dark background behind it instead.
+ const bg = W.effectiveBg(el, WHITE_SCENE);
const size = parseFloat(s.fontSize);
const large = size >= 24 || (size >= 18.66 && parseInt(s.fontWeight, 10) >= 700);
out.push({