The cooldown was returning lastSignal every frame, which reset the
600ms display timer in usePoseLoop each frame — doubling the total
display time to ~1200ms. Now returns null during cooldown so only
the display timer controls visibility.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The old signalShowUntil suppressed all detection AND baseline adaptation
for 600ms after any signal. Removing it caused rapid re-triggering of
steps and baseline drift during active gestures.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only the bottom boundary (feet at 85%) is enforced. The red box is now
a single bottom line instead of a full rectangle.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The dispose() was unconditionally nulling video.srcObject, which in
StrictMode double-fire would kill the second init's webcam stream.
Now only clears if video.srcObject still points to our stream.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces cooldown timer with proper hysteresis. Arms must be lowered
and stay down for 2 seconds before arms-out can trigger again. This
prevents rapid toggling when arms hover near the threshold. The
pos-center and pause-resume arms-out checks don't require the
cooldown (they're one-shot transitions).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When paused after leaving the 10% zone, user must get back within
the tighter 15% bounds and raise arms to resume. Shows framing
hints during pause and the 15% red box.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Framing requires tighter bounds (15% top/bottom) to enter.
Gameplay uses looser bounds (10%) before pausing. Red box shows
during both framing and paused states with the appropriate margins.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces separate head/ankle visibility checks with a unified
bounds check matching the framing red box. During gameplay, leaving
the zone triggers pause. During calibration, resets to framing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Framing check now requires nose below top 10% and toes above bottom
10% (body fits in 80% of vertical space). Red dashed rectangle shows
the target zone during framing. Hints updated: 'head too high',
'step back', etc.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Arms-out during ready state triggers pause. Wrists now only need to
be within 20cm below shoulder height (was ±10cm around shoulder),
making it easier to trigger before arms are fully at shoulder level.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously checked both feet's X displacement for step-left/right
reset, so a persistent offset in the non-stepping foot prevented
reset. Now tracks which foot triggered the step and only checks
that foot's displacement on the triggering axis.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
stepsReset now checks only the X axis for left/right steps and only
the Z axis for forward/back steps. Previously used Euclidean distance
of both axes, so a persistent offset in the non-triggering axis
prevented reset indefinitely.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy Log now exports unbounded StepLogEntry array from session start,
including: raw toe XZ (hip-relative), current baseline XZ, displacement
XZ, and active step signal per frame.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Applies 0.99/0.01 EMA to heelBaseL/R X and Z when no step is active,
same approach as the ankle Y baseline adaptation. Prevents the resting
position from drifting away from the threshold over time.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Framing stage now checks toes are above 90% of frame height,
ensuring the person stands far enough back for room below feet.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pauses when landmarks are lost during gameplay. Resumes when head,
ankles, toes are visible and arms-out is detected. Adds 100px
bottom bar below the video feed for the stage text.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collect toe (31/32) X/Z positions during the 5s calibration and
average them for the step detection baseline. More stable than a
single snapshot. Switched from heels (29/30) to toes (31/32) for
step detection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>