Commit 82dc2f9
fix(dashboard): two-phase JS-driven firing animation + always-pass enabledTransitions in replay
JS-driven RAF replaces the previous CSS keyframe per-edge fire. Edges
animate as a two-phase progress bar: input arcs fill source → transition
first, output arcs fill transition → destination second. At the half-
duration boundary the post-fire derived marking + enabled-transition
set are applied so the operator never sees post-fire tokens land
before the input arc visually drains. Same refactor closes the
"turn_red_* highlighted at every replay version" bug.
NetDiagram:
- Props refactored: drop firingEdgeIds + firingDurationMs +
enabledEdgeIds. Add firingTransition?: string | null,
firingProgress?: { input: number, output: number },
enabledTransitions?: ReadonlySet<string>. Export FiringProgress.
- buildGraph derives transition-node isEnabled via
isTransitionEnabled(name) helper — the replay-supplied
enabledTransitions override drives BOTH the input-arc accent AND
the transition-node glow. Previously the per-edge override left
the node still glowing from live enabled_count, surfacing the
"turn_red looks enabled at v0" bug.
- OrthogonalEdgeImpl renders a raw <path pathLength={1}> with inline
strokeDasharray=1 + strokeDashoffset=1-progress when firing.
EnactmentDetailPage:
- firingEdgeIds state + setTimeout replaced with firingPhase
({transition, startedAt, halfMs, fullMs}) + firingProgress + RAF
loop. RAF applies stashed derivedMarkings + replayEnabledTransitions
at halfMs boundary.
- onScrub onReply stashes reply data into refs + triggers
startFiringPhase only when single-step advance + occurrence at
target + visible-arc match; otherwise applies immediately.
- Version-bump effect skipped in replay mode (now driven by onReply);
kept for live-mode operator-completion firing.
- enabledTransitions={replayState === null ? undefined :
replayEnabledTransitions} — concrete set in replay, never
undefined. NetDiagram never falls back to live counts during
replay.
CSS:
- @Keyframes cf-edge-fill + .cf-edge-firing rule removed.
Tests:
- NetDiagram: 3 new firingProgress wire-up tests (input/output split
+ clamping), 2 enabledTransitions override tests (wins over live
count for arc + node glow).
- EnactmentDetailPage: mock NetDiagram exposes firing-transition /
firing-input / firing-output / enabled-transitions data attrs.
Two new RAF-driven tests (live progress curve hits 0.5 → 0.5 →
cleared; replay step keeps enabledTransitions=[] until elapsed >
halfMs, then swaps).
- enactment_detail_store_test: TrafficLightFlow v=0 returns
["turn_green_ew"] only — refutes turn_red_* / turn_yellow_*.
mix precommit 177/177, dialyzer 0; pnpm typecheck + 172/172 vitest +
build clean; lib/coloured_flow byte-identical.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent b143546 commit 82dc2f9
6 files changed
Lines changed: 536 additions & 189 deletions
File tree
- dashboard
- test/coloured_flow_dashboard_web/stores
- ui/src
- components
- routes
- styles
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1105 | 1149 | | |
1106 | 1150 | | |
1107 | 1151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
| 150 | + | |
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
159 | 182 | | |
160 | 183 | | |
161 | | - | |
| 184 | + | |
162 | 185 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
168 | 191 | | |
169 | 192 | | |
170 | 193 | | |
| |||
197 | 220 | | |
198 | 221 | | |
199 | 222 | | |
200 | | - | |
| 223 | + | |
201 | 224 | | |
202 | | - | |
203 | | - | |
204 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
205 | 236 | | |
206 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
207 | 261 | | |
208 | 262 | | |
209 | 263 | | |
| |||
0 commit comments