Files
ontime/apps/client
Claude 52f91357a2 refactor(teleprompter): enforce each invariant in one place
A maintenance pass over the view. Nothing changes on screen.

The position was bounded twice on the playing path: advance() clamped its
result and the loop clamped it again. The loop has to clamp regardless, for
nudges and for a document which shrank, so advance() now reports reaching
the end and leaves the bound to its only caller.

maxScroll was floored at zero at each of four reads, though measure() is its
only writer and already floors it. The invariant is stated once, where it is
established.

Arrival at an eased target was tested twice: easeCatchUp snaps to the target
once it is close enough, and hasArrived then measured the same distance
again. Equality with the target is the signal, so hasArrived is gone.

Speed was clamped to its range by the option parser and then clamped to the
identical range again by clampSpeed, on the same call. Only the keys and
buttons, which add deltas, still need to clamp.

The Enter guard in the key handler could never fire: the keymap does not bind
Enter, so the event was already passing through untouched. The reason Enter
stays unbound now lives in the keymap, with a test, rather than as a branch
which reads as though something was being prevented.

Also drops a redundant early return in ReadingLine, an export with no callers
outside its module, and a JSON round trip in the param mirror which existed
only to satisfy a dependency array.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cb8RVPNQ2ETPJxdy4b8CHf
2026-08-18 19:00:12 +00:00
..
2026-03-08 16:22:12 +01:00
2026-08-09 10:44:13 +02:00
2026-03-08 16:22:12 +01:00
2026-03-08 16:22:12 +01:00
2023-05-18 14:02:22 +02:00