Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 5.55 KB

File metadata and controls

23 lines (14 loc) · 5.55 KB

Classroom Edition — phase 4 review sheet (REVIEW-CLASSROOM-4) — PAUSED 2026-08-23

Phase 4 was planned as four commits (A–D). A and B landed; C and D did not. Work was paused by the author mid-C to save budget; the tree is clean at 21e6fc7 (tests 189 green, tsc clean, vite build clean, all eight HASHES.md rows reproduced by npm run check:hashes). Nothing pushed.

Commit A — d758ebd WCAG 2.1 AA pass (done)

  • Audit: npm run audit:a11y (scripts/audit-a11y.mjs; axe-core 4.13.0 via playwright-core + local Chrome; src/classroom/audit.ts = target list, report shape, gate; test/a11y-audit.test.ts). 19 routes × EN/zh, lesson pages also after driving every hint/chip/roll/step/slider/table = 38 page states.
  • Before: 6 critical + 18 serious (128 nodes): unnamed Gamble/Loop text fields and sliders (label), .act-num ink 2.3:1 and 75 %-opacity token ids (color-contrast), scrolling tables / embed <pre> unreachable by keyboard (scrollable-region-focusable). After: 0 critical / 0 serious / 0 moderate / 0 minor at 1280 px and at 375 px; axe best-practice rules (landmarks, heading order) also 0.
  • Fixes (all behind an optional a11y prop → essays' DOM byte-identical): Chopper piece list + live count; Gamble named field/slider (aria-valuetext), bar list, live "picked" line; TheLoop named field/slider, each written word a <button> (Enter opens alternatives, Escape closes), sr-only status line, "Show the step log" table, reduced-motion run lands at once (30 words < 120 ms vs 4.3 s paced, no cursor); X-ray letters row as one phrase, piece list; Hundred Rolls localized slider name. Pages: skip link (focus, not hash), <main>/banner/contentinfo, 3 px focus ring, focusable named TableWrap + embed <pre>, th scope, lang on glossary columns, per-block lang heuristic in Markdown.tsx (blockLang). Light-theme contrast verified computed over every text node of M1/M2/crosswalk: min 4.7:1 (X-ray hit letter); only disabled "Reset rolls" (2.4:1, exempt) below 4.5.
  • Keyboard walk with real key events (Playwright): skip link → #cl-main with hash unchanged; Loop token button opens/closes popover (aria-expanded true/false, 8 rows); slider ArrowRight "T = 1.00" → "T = 1.10"; Roll by Enter updates live region; Hundred Rolls by Enter → 100 rolls, table 10 rows; zh names render ("第 2 块:“raw”,编号 1831"). Not done: any real screen reader (ChromeVox/VoiceOver/NVDA) — the statement says so, first known-gap row.
  • Accessibility statement (EN + zh) rewritten to the audited truth; guides' notes + index blurb updated.

Commit B — 21e6fc7 service worker (done)

src/classroom/sw/{strategy,classroom-sw,register,vite-plugin}.ts → dist/classroom-sw.js (1.9 KB, no framework): versioned precache (content hash of 8 files, 10.9 MB: shell, 3 chunks, weights, tokenizer), network-first navigations (never stale HTML), cache-first precached paths (pathname match, ignoreVary), everything else bypassed, nothing cached at runtime; registered only from #/classroom… in production. Offline proof (headless Chrome on vite preview, real weights): worker active 2.0 s after model load; context offline; reload → M2 renders, Gamble 10 bars, Hundred Rolls rolls, Loop steps, 0 failed requests, un-precached fetch fails; offline nav to M1 zh + tech check OK; essays/flagship/dev register nothing. Tech check (EN+zh) new "Offline after the first visit" section; model card/privacy say built; bundle re-measured 1.29 MB disk / ~412 KB gz (total 10.90 MB disk, ~8.5 MB wire). +10 tests (test/classroom-sw.test.ts).

Commit C — embed kit + evidence surface (NOT done; partial work in git stash@{0}, not applied)

Planned: CLASSROOM_ORIGIN = "" / CLASSROOM_REPO_URL = "" / hasOrigin / embedOrigin in config.ts (PROMO_URL pattern: placeholder https://classroom.YOUR-DOMAIN + note until set); src/classroom/embed.ts (cleanUrl, embedSnippet, embedTargets: lesson, steps 1–3, guide, printable, slides per module); route kinds embed (#/classroom/embed, per-module/per-step URL + Canvas iframe snippet + copy button) and taught (#/classroom/taught: §8.1 rules, GitHub Discussion link when repo set else "not open yet", mailto: with prefilled subject + §8.2 field template, letter-kit link, dual-use consent text); guides' §14 to use the shared snippet; OG meta upserted by ClassroomFrame + build-time static stubs dist/classroom/<route>/index.html with og:* tags and redirect (pure og.ts + Vite plugin); .github/DISCUSSION_TEMPLATE/i-taught-with-this.yml; replace front-matter [… — TBD] placeholders from the constants when set; add embed/taught to audit targets. REVIEW-3 fixes: drop HS-SOC-HU-44 row from M2 guide standards table (EN+zh; keep the "follows its framing" prose, mark it a Module 3 standard) + crosswalk re-verification row noting the change per PRODUCT r2 §4.2; policy page: resolve the EO 14277 Sec. 6 caveat per r2 and add a bullet for priorities (a)(ii)/(a)(ix)/(a)(x) with the "how this aligns" sentence (EN+zh, list-length parity). Stash holds: config constants, embed.ts, types + EN strings for embed/taught (zh table not written; nothing wired).

Commit D — close-out docs (NOT done)

Planned: src/classroom/README.md (architecture, routes, config constants, build:pdf, audit:a11y, check:hashes, service worker, how to add M3) and the full REVIEW-CLASSROOM-4 with the §10.1 "done means" gaps — real-teacher pilot, 4 GB Chromebook / iPad / 30-client test (hardware), hosting/domain + filter submissions, weights-license closure, bundle-budget decision (1.29 MB vs ~0.5 MB left) — each author/hardware-dependent.