Repository navigation
feat(ui): show the overrun counting up and route the rest period - #151
Merged
Merged
Conversation
A session that ran out simply stopped. The countdown sat at 00:00 with nothing to say it had ended, which on a track day is the moment a driver most needs telling, and the rest period they had configured never appeared at all. Nothing was missing from the state machine. SessionController already modelled overtime, session_overrun_ms, rest and rest_remaining_ms, with the transitions between them host tested since the rest workflow landed. What was missing was routing: the router reduced six states to one boolean and sent everything that was not running or overtime to the dashboard, so rest was invisible and overtime was indistinguishable from a session still going. The countdown field now turns round and counts up once the session is spent, and the line beneath it stops reporting a lap estimate, which is meaningless when the session is over, and says OVER RUN instead. Rest is drawn on the same screen with the same fixed cells and the same green-through-red ramp, because it is the same kind of thing: a clock the driver is watching run out. The overrun colour is chosen on measured contrast rather than by name. The literal "deep purple" #6A0DAD manages 2.27:1 against the black panel where every other state here sits between 5.9 and 10.5, and a 10 mm numeral at 2.27:1 is hard work in daylight. #9A4DFF reads as a deep saturated purple and lands beside the ramp's red. The overrun clock carries no sign. The field is five fixed cells and a sixth would need 664 px of a 600 px panel; the colour and the caption already say which way it counts. Double tap ends whichever clock is running because this ends a session, and a stray touch in a moving car must not. The first tap is still delivered as a press: holding it back pending a possible second would delay every press by the 400 ms window, and the screens that act on a double tap ignore single presses. confirm_stop lands in review by design, so the double tap carries through to rest programmatically rather than rearranging a tested state machine; a review screen later inserts itself there. Verified on the panel end to end. A 60 second session ran for 60,010 ms, transitioned to overtime by itself at zero, moved to rest on a double tap with 20 minutes on the clock, and returned to ready on a second, with no accidental transitions in the seconds either side of each tap. Closes #142 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #142 — the overrun and rest scope. The review screen and the deliberate-stop
confirmation remain open there, so this deliberately does not close it.
The gap
A session that ran out simply stopped. The countdown sat at 00:00 with nothing to say it had
ended — on a track day, the moment a driver most needs telling — and the rest period they had
configured never appeared at all.
Nothing was missing from the state machine.
SessionControlleralready modelledovertime,session_overrun_ms,restandrest_remaining_ms, host-tested since the restworkflow landed. What was missing was routing: the router reduced six states to one boolean
and sent everything that was not running or overtime to the dashboard.
What it does now
OVER RUNRESTRest is drawn on the same screen with the same fixed cells and the same ramp, because it is
the same kind of thing: a clock the driver is watching run out.
Colour chosen on contrast, not on name
#6A0DADliteral "deep purple"#8A2BE2blueviolet#9A4DFFchosen#FF3B30#2FD16DEvery other state on this screen sits between 5.9 and 10.5. A 10 mm numeral at 2.27:1 is hard
work in daylight, so the literal answer was the wrong one;
#9A4DFFstill reads as a deepsaturated purple. Trivial to darken if it looks bright on the panel.
Two decisions worth reviewing
No sign on the overrun clock. The field is five fixed cells, and a sixth would need 664 px
of a 600 px panel. The colour and the caption already say which way it counts.
Double tap passes through
review.confirm_stoplands there by design, so the tapcarries on to rest programmatically rather than rearranging a tested state machine — a review
screen later inserts itself at that point. If review ever becomes a screen the driver sees,
this flow gains a stop before rest.
Double tap
Two taps rather than one because this ends a session and a stray touch in a moving car must
not. The first tap is still delivered as a
press: holding it back pending a possible secondwould delay every press by the 400 ms window, and the screens that act on a double tap ignore
single presses anyway.
Verification
35 host suites and 70 simulator tests, with new coverage for the counting-up format, the
caption per phase, the ratio and ramp during rest, and that the overrun colour matches no
point on the ramp.
End to end on the panel:
The 60 second session ran 60,010 ms, and there were no accidental transitions in the
seconds either side of each tap. Probe removed and its absence confirmed on the final image;
no watchdog triggers.
Still open on #142
The review screen itself, and the deliberate-stop confirmation UI. #142 stays open for them.