diff --git a/.changeset/form-labels-and-motion.md b/.changeset/form-labels-and-motion.md
new file mode 100644
index 00000000..b83b42ab
--- /dev/null
+++ b/.changeset/form-labels-and-motion.md
@@ -0,0 +1,5 @@
+---
+"@reelsaw/server": patch
+---
+
+Accessibility: the sign-in, reset-password and must-change-password fields are labelled for screen readers and their errors are announced; the new-project upload box is reachable with Tab; the marketing site's looping demo clips and self-advancing feature tabs have a pause button.
diff --git a/apps/server/test/ui-a11y-guards.test.ts b/apps/server/test/ui-a11y-guards.test.ts
new file mode 100644
index 00000000..6cc1e0d5
--- /dev/null
+++ b/apps/server/test/ui-a11y-guards.test.ts
@@ -0,0 +1,69 @@
+/**
+ * Accessibility fixes the browser ratchet (apps/web/e2e/a11y.spec.ts) does not reach: it runs signed in, on the main
+ * screens, against a running stack. Read as source, like the other web checks here.
+ * - Sign-in, reset and must-change-password: each field's label names its input (htmlFor/id), and errors are
+ * announced (role="alert", or a live region).
+ * - New project: the file input is visually hidden, not display:none, so the keyboard reaches it.
+ * - Marketing site: every looping demo clip and the self-advancing tabs obey a pause button (WCAG 2.2.2), not only
+ * prefers-reduced-motion.
+ */
+import { describe, it } from "node:test";
+import assert from "node:assert/strict";
+import fs from "node:fs";
+import path from "node:path";
+
+const root = path.join(import.meta.dirname, "..", "..", "..");
+const read = (p: string) => fs.readFileSync(path.join(root, p), "utf8");
+
+/** each with the first {
+ const out: Array<{ label: string; input: string }> = [];
+ for (const m of src.matchAll(/]*>/g)) {
+ const rest = src.slice(m.index);
+ const input = / ]*?(\/>|>)/s.exec(rest);
+ assert.ok(input, `no input after ${m[0]}`);
+ out.push({ label: m[0], input: input[0] });
+ }
+ return out;
+}
+
+describe("auth forms", () => {
+ for (const page of ["Login", "ResetPassword", "MustChangePassword"]) {
+ it(`${page}: every label names its input`, () => {
+ const fields = labelledFields(read(`apps/web/src/pages/${page}.tsx`));
+ assert.ok(fields.length >= 2);
+ for (const { label, input } of fields) {
+ const id = /htmlFor="([^"]+)"/.exec(label)?.[1];
+ assert.ok(id, `label without htmlFor: ${label}`);
+ assert.match(input, new RegExp(`\\bid="${id}"`), `input for ${id}`);
+ }
+ });
+ }
+ it("errors are announced", () => {
+ assert.match(read("apps/web/src/pages/Login.tsx"), /role=\{error \? "alert" : "status"\}/);
+ assert.match(read("apps/web/src/pages/MustChangePassword.tsx"), /role=\{save\.error \? "alert" : "status"\}/);
+ assert.match(read("apps/web/src/pages/ResetPassword.tsx"), /aria-live=\{tone === "err" \? "assertive" : "polite"\}/);
+ });
+});
+
+describe("new project upload", () => {
+ it("the file input is reachable by keyboard and its box shows focus", () => {
+ const src = read("apps/web/src/pages/NewProject.tsx");
+ const input = / ]*type="file"[^>]*>/.exec(src)?.[0];
+ assert.ok(input);
+ assert.doesNotMatch(input, /className="hidden"/);
+ assert.match(input, /className="sr-only"/);
+ assert.match(src, /focus-within:outline-acc/);
+ });
+});
+
+describe("marketing site motion", () => {
+ it("reduced motion includes the visitor's pause, and every moving section offers the pause button", () => {
+ const loop = read("website/components/loop-video.tsx");
+ assert.match(loop, /return reduced \|\| paused;/);
+ assert.match(loop, /const live = play && visible && !reduced;/);
+ for (const c of ["hero-reel", "clip-strip", "feature-tabs"]) assert.match(read(`website/components/${c}.tsx`), /
{mode === "signup" && (
-
+
Name
- setName(e.target.value)} />
+ setName(e.target.value)} />
)}
-
+
Email
- setEmail(e.target.value)} />
+ setEmail(e.target.value)}
+ />
{!expiredLink && (
-
+
Password
}
{(error || notice) && (
-
+
{error ?? accountNotice(notice)}
)}
diff --git a/apps/web/src/pages/MustChangePassword.tsx b/apps/web/src/pages/MustChangePassword.tsx
index b004bff9..87beb4af 100644
--- a/apps/web/src/pages/MustChangePassword.tsx
+++ b/apps/web/src/pages/MustChangePassword.tsx
@@ -48,10 +48,11 @@ export function MustChangePasswordPage() {
{accountNotice(MUST_CHANGE_PASSWORD_COPY)}
{me.data ? t`Signed in as ${me.data.email}` : ""}
-
+
New password
-
+
Confirm
{(save.error || mismatch || tooShort) && (
-
+
{save.error?.message ?? (tooShort ? t`Use at least 8 characters.` : t`The two passwords do not match.`)}
)}
diff --git a/apps/web/src/pages/NewProject.tsx b/apps/web/src/pages/NewProject.tsx
index 418b2d1a..248d87da 100644
--- a/apps/web/src/pages/NewProject.tsx
+++ b/apps/web/src/pages/NewProject.tsx
@@ -396,13 +396,14 @@ export function NewProjectPage() {
const f = [...e.dataTransfer.files].find(isVideo);
if (f) setFile(f);
}}
- className="flex cursor-pointer flex-col items-center gap-1 rounded-[12px] border-2 border-dashed border-line2 px-4 py-6 text-center text-sm text-ink2 hover:border-acc"
+ className="flex cursor-pointer flex-col items-center gap-1 rounded-[12px] border-2 border-dashed border-line2 px-4 py-6 text-center text-sm text-ink2 hover:border-acc focus-within:border-acc focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-acc"
>
{file ? file.name : t`Choose or drop a video file`}
{file ? `${formatNumber(Math.round(file.size / 1e6))} MB` : t`MP4, MOV, MKV or WebM · up to ${maxUploadText} MB`}
- setFile(e.target.files?.[0] ?? null)} />
+ {/* visually hidden, not display:none, so Tab reaches it; the dashed box shows its focus */}
+ setFile(e.target.files?.[0] ?? null)} />
{uploadPct !== null && (
diff --git a/apps/web/src/pages/ResetPassword.tsx b/apps/web/src/pages/ResetPassword.tsx
index 856c308b..7d7cc140 100644
--- a/apps/web/src/pages/ResetPassword.tsx
+++ b/apps/web/src/pages/ResetPassword.tsx
@@ -125,10 +125,11 @@ export function ResetPasswordPage() {
{choosing ? (
<>
-
+
New password
-
+
Confirm password
) : (
-
+
Email
- setEmail(e.target.value)} />
+ setEmail(e.target.value)}
+ />
)}
{!choosing && captcha && }
+ {/* always rendered, so screen readers hear each new message: at once for an error, politely otherwise */}
{banner ?? ""}
diff --git a/scripts/lint-baseline.json b/scripts/lint-baseline.json
index 703ad5e8..3e41dfe4 100644
--- a/scripts/lint-baseline.json
+++ b/scripts/lint-baseline.json
@@ -1,6 +1,6 @@
{
"a11y/noAutofocus": 11,
- "a11y/noLabelWithoutControl": 21,
+ "a11y/noLabelWithoutControl": 13,
"a11y/noStaticElementInteractions": 28,
"a11y/useAriaPropsSupportedByRole": 5,
"a11y/useButtonType": 209,
diff --git a/website/components/clip-strip.tsx b/website/components/clip-strip.tsx
index b7591c24..ccded062 100644
--- a/website/components/clip-strip.tsx
+++ b/website/components/clip-strip.tsx
@@ -9,7 +9,7 @@ import { t, rich } from "@/lib/i18n";
import { ArrowRight } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { DEMO_RUN, clipPoster, clipVideo } from "@/content/demo";
-import { LoopVideo } from "./loop-video";
+import { LoopVideo, MotionToggle } from "./loop-video";
const { source, picks } = DEMO_RUN;
@@ -42,11 +42,14 @@ export function ClipStrip() {
{source.length}
-
- {rich(msg`The whole <0/>, 16:9. <1/> came out of it.`, {
- 0: source.kind,
- 1: {t(msg`${plural({ clips: DEMO_RUN.clips }, { one: "# clip", other: "# clips" })}`)} ,
- })}
+
+
+ {rich(msg`The whole <0/>, 16:9. <1/> came out of it.`, {
+ 0: source.kind,
+ 1: {t(msg`${plural({ clips: DEMO_RUN.clips }, { one: "# clip", other: "# clips" })}`)} ,
+ })}
+
+
diff --git a/website/components/feature-tabs.tsx b/website/components/feature-tabs.tsx
index 06c2198c..3f968538 100644
--- a/website/components/feature-tabs.tsx
+++ b/website/components/feature-tabs.tsx
@@ -13,7 +13,7 @@ import editor from "@/public/editor.png";
import transcriptFixes from "@/public/transcript-fixes.png";
import workspace from "@/public/workspace.png";
import { CAPTIONS_FILE, REFRAMES, clipPoster, clipVideo } from "@/content/demo";
-import { LoopVideo, useInView, useReducedMotion } from "./loop-video";
+import { LoopVideo, MotionToggle, useInView, useReducedMotion } from "./loop-video";
const HASH = "see-";
const ADVANCE_MS = 9000;
@@ -263,6 +263,7 @@ export function FeatureTabs() {
))}
+
);
diff --git a/website/components/hero-reel.tsx b/website/components/hero-reel.tsx
index 6d7f5fe4..ce50ef26 100644
--- a/website/components/hero-reel.tsx
+++ b/website/components/hero-reel.tsx
@@ -10,7 +10,7 @@ import { rich, t as tr } from "@/lib/i18n";
import { useCallback, useState } from "react";
import { HERO, clipPoster, clipVideo, fmtTime } from "@/content/demo";
-import { LoopVideo } from "./loop-video";
+import { LoopVideo, MotionToggle } from "./loop-video";
/** How long the hook shows with default settings (hookSeconds). */
const HOOK_SECONDS = 3.5;
@@ -126,23 +126,26 @@ export function HeroReel() {
))}
-
- {HERO.map(({ pick: p, source: src }, k) => (
-
{
- setI(k);
- setHeld(true);
- setT(0);
- }}
- aria-label={tr(msg`${{ kind: src.kind }}, pick #${{ rank: p.rank }}: ${{ hook: p.hook }}`)}
- aria-pressed={k === i}
- className="grid h-6 place-items-center px-0.5"
- >
-
-
- ))}
+
+
+ {HERO.map(({ pick: p, source: src }, k) => (
+ {
+ setI(k);
+ setHeld(true);
+ setT(0);
+ }}
+ aria-label={tr(msg`${{ kind: src.kind }}, pick #${{ rank: p.rank }}: ${{ hook: p.hook }}`)}
+ aria-pressed={k === i}
+ className="grid h-6 place-items-center px-0.5"
+ >
+
+
+ ))}
+
+
diff --git a/website/components/loop-video.tsx b/website/components/loop-video.tsx
index d9409d49..35a80eb7 100644
--- a/website/components/loop-video.tsx
+++ b/website/components/loop-video.tsx
@@ -4,10 +4,34 @@
// viewport, and playing only while the parent says so, it is on screen and the visitor has not asked for
// reduced motion. Every demo clip on the home page goes through this one element.
-import { useEffect, useRef, useState, type RefObject } from "react";
+import { msg } from "@lingui/core/runtime-macro";
+import { Pause, Play } from "lucide-react";
+import { useEffect, useRef, useState, useSyncExternalStore, type RefObject } from "react";
+import { t } from "@/lib/i18n";
+// The visitor's pause (WCAG 2.2.2): one switch for every looping clip and the self-advancing tabs on the page, so
+// pausing one pauses them all. Per page view; reduced motion still stops everything on its own.
+let motionPaused = false;
+const motionListeners = new Set<() => void>();
+const subscribeMotion = (fn: () => void) => {
+ motionListeners.add(fn);
+ return () => motionListeners.delete(fn);
+};
+function setMotionPaused(v: boolean) {
+ motionPaused = v;
+ for (const fn of motionListeners) fn();
+}
+const useMotionPaused = () =>
+ useSyncExternalStore(
+ subscribeMotion,
+ () => motionPaused,
+ () => false,
+ );
+
+/** Whether nothing should move: the visitor asked for reduced motion, or paused the page's clips (MotionToggle). */
export function useReducedMotion(): boolean {
const [reduced, setReduced] = useState(false);
+ const paused = useMotionPaused();
useEffect(() => {
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
const apply = () => setReduced(mq.matches);
@@ -15,7 +39,25 @@ export function useReducedMotion(): boolean {
mq.addEventListener("change", apply);
return () => mq.removeEventListener("change", apply);
}, []);
- return reduced;
+ return reduced || paused;
+}
+
+/** Pause or play every moving clip on the page. */
+export function MotionToggle({ className = "" }: { className?: string }) {
+ const paused = useMotionPaused();
+ const label = paused ? t(msg`Play the demo clips`) : t(msg`Pause the demo clips`);
+ return (
+
setMotionPaused(!paused)}
+ aria-pressed={paused}
+ aria-label={label}
+ title={label}
+ className={`inline-grid h-7 w-7 shrink-0 place-items-center rounded-full border border-line bg-panel text-ink2 transition hover:bg-sunk hover:text-ink ${className}`}
+ >
+ {paused ? : }
+
+ );
}
/** Whether `ref` is on screen (at least `threshold` of it), and whether it has ever come within `margin` of it. */
diff --git a/website/locales/en-XA.po b/website/locales/en-XA.po
index 6a32715e..8600be37 100644
--- a/website/locales/en-XA.po
+++ b/website/locales/en-XA.po
@@ -3342,6 +3342,10 @@ msgstr ""
msgid "Pause and filler removal from Starter; bad-take removal on Pro and up"
msgstr ""
+#: components/loop-video.tsx
+msgid "Pause the demo clips"
+msgstr ""
+
#: components/replay-ranges.tsx
msgid "Peaks taken"
msgstr ""
@@ -3430,6 +3434,10 @@ msgstr ""
msgid "Play pick #{rank}: {hook}"
msgstr ""
+#: components/loop-video.tsx
+msgid "Play the demo clips"
+msgstr ""
+
#: content/demo.ts
msgid "podcast"
msgstr ""
diff --git a/website/locales/en.po b/website/locales/en.po
index b61dc31d..f8c1aed3 100644
--- a/website/locales/en.po
+++ b/website/locales/en.po
@@ -3345,6 +3345,10 @@ msgstr "Pause"
msgid "Pause and filler removal from Starter; bad-take removal on Pro and up"
msgstr "Pause and filler removal from Starter; bad-take removal on Pro and up"
+#: components/loop-video.tsx
+msgid "Pause the demo clips"
+msgstr "Pause the demo clips"
+
#: components/replay-ranges.tsx
msgid "Peaks taken"
msgstr "Peaks taken"
@@ -3433,6 +3437,10 @@ msgstr "Play"
msgid "Play pick #{rank}: {hook}"
msgstr "Play pick #{rank}: {hook}"
+#: components/loop-video.tsx
+msgid "Play the demo clips"
+msgstr "Play the demo clips"
+
#: content/demo.ts
msgid "podcast"
msgstr "podcast"
diff --git a/website/locales/ru.po b/website/locales/ru.po
index a16009d1..f6d85655 100644
--- a/website/locales/ru.po
+++ b/website/locales/ru.po
@@ -3345,6 +3345,10 @@ msgstr "Пауза"
msgid "Pause and filler removal from Starter; bad-take removal on Pro and up"
msgstr "Удаление пауз и слов-паразитов со Starter; удаление неудачных дублей на Pro и выше"
+#: components/loop-video.tsx
+msgid "Pause the demo clips"
+msgstr "Приостановить демо-клипы"
+
#: components/replay-ranges.tsx
msgid "Peaks taken"
msgstr "Пики взяты"
@@ -3433,6 +3437,10 @@ msgstr "Играть"
msgid "Play pick #{rank}: {hook}"
msgstr "Вариант #{rank}: {hook}"
+#: components/loop-video.tsx
+msgid "Play the demo clips"
+msgstr "Воспроизвести демо-клипы"
+
#: content/demo.ts
msgid "podcast"
msgstr "подкаст"