Commit e3b15f5
feat(M13 chunk 13): reduced-motion + WebGL gate tri-state
Closes chunk 13. Replaces the chunk-1 placeholder gate copy
("once Chunk 13 lands…") with the spec's tri-state behaviour:
full / 2D-svg / debug-text.
Reduced-motion (PowerPoint mode):
- Autoplay disabled (useSceneRunner gets autoplay: false).
- Each scene renders at t = 1 (completion frame).
- 4-second setTimeout auto-advances to the next scene; Step in
PlaybackControls cancels the pending advance and arms a new one
for the next scene.
- No auto-advance past the last scene (guarded).
- All logic in CinematicViz; useSceneRunner stays untouched.
- canvas root gets data-reduced-motion="true|false" for tests.
WebGL 2 unavailable:
- Informational notice only — every M13 primitive is already SVG
(chunk-1 locked "no Three.js" decision), so there's no actual
3D rendering to fall back from.
- Copy matches the spec literal: "3D camera moves are unavailable;
the visualization is rendering in 2D mode."
- The viz continues rendering normally (no blocking like the M12
chunk-8 binary disable).
Tri-state precedence:
- WebGL gate notice wins when both apply (more critical info).
- The reduced-motion BEHAVIOR (t=1 pin + auto-advance) still runs
underneath, even when the WebGL notice covers the message.
- data-gate-mode attribute ("webgl" | "reduced-motion") on the
notice for test assertions.
9 new Vitest tests in CinematicViz-gates.test.tsx:
- No notice when both gates pass.
- Reduced-motion: notice copy + t=1 pin + canvas data attribute.
- WebGL-missing: notice copy + viz still renders + data-reduced-
motion=false (WebGL alone doesn't freeze t).
- Both active: WebGL precedence + reduced-motion behavior still
applies.
Uses vi.resetModules() + vi.doMock + dynamic import to override
the global useWebGL2Support / useReducedMotion mocks per-suite.
The chunk-1 a11y test (webgl-fallback.test.tsx) was updated to
match the new spec copy — its comment block explicitly anticipated
this change.
Full suite: 93 files / 933 tests pass; tsc --noEmit clean.
phase1.md: chunk-13 checkbox [x], status row "chunks 1-13 done",
decisions block (10 bullets) landed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d770257 commit e3b15f5
4 files changed
Lines changed: 206 additions & 15 deletions
File tree
- docs
- resources/js
- Components/Viz
- __tests__
- Components/Viz
- a11y
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | | - | |
| 1045 | + | |
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
| |||
1066 | 1066 | | |
1067 | 1067 | | |
1068 | 1068 | | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
1069 | 1082 | | |
1070 | 1083 | | |
1071 | 1084 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
119 | 124 | | |
120 | 125 | | |
121 | 126 | | |
122 | | - | |
| 127 | + | |
123 | 128 | | |
124 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
125 | 152 | | |
126 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
127 | 159 | | |
128 | | - | |
| 160 | + | |
129 | 161 | | |
130 | 162 | | |
131 | 163 | | |
| |||
279 | 311 | | |
280 | 312 | | |
281 | 313 | | |
282 | | - | |
| 314 | + | |
283 | 315 | | |
284 | 316 | | |
285 | 317 | | |
286 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
287 | 323 | | |
288 | 324 | | |
289 | 325 | | |
| |||
310 | 346 | | |
311 | 347 | | |
312 | 348 | | |
313 | | - | |
| 349 | + | |
| 350 | + | |
314 | 351 | | |
315 | | - | |
| 352 | + | |
316 | 353 | | |
317 | 354 | | |
318 | 355 | | |
| |||
Lines changed: 138 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
0 commit comments