The PRD's three open questions all turn on how much room there is, so the room
was measured before anything was decided. Laptop Chrome, the current screen
with all-samples.m4a loaded, development-only controls subtracted:
| part | height |
|---|---|
| title, source buttons, status | 101 px |
| waveform block (overview + detail + readout) | 222 px |
| player | 48 px |
| expected range, collapsed | 43 px |
| Calculate | 48 px |
| result line | 24 px |
| gaps and page padding | 124 px |
| total, production build | 610 px |
A phone at 740 CSS px tall has roughly 600 to 640 left after browser chrome. So the screen is already full before this phase adds anything.
The PRD's third acceptance criterion cannot hold as written. A number and a marked waveform are about 170 px together; nothing short of hiding the crop makes that fit under 610 px.
Three ways out were considered.
Decision: the third. No modes, no hidden state, the crop stays where it was, and the number and its marks are adjacent so they are on screen together after the scroll. What is lost is seeing the crop at the same time as the answer, which is not needed while reading it.
AC 3 is amended to: the number and the marked waveform are visible together without further scrolling once the result arrives.
Ten seconds at 13 pulses per second is 130 marks. At 448 px of canvas that is one every 3.4 px, and at 360 px phone width one every 2.5 px.
Full-height lines at that spacing would erase the waveform. Ticks along the top and bottom edges, 10 px tall and 1 px wide, leave the middle of the trace clear while still showing the pattern.
Every mark is drawn, none are thinned. Regularity is the whole point: a missed combustion or a doubled one shows up as a gap or a crowd in an otherwise even comb, and thinning would hide exactly that. Where the comb is too dense to count, the count is printed beside the number instead.
One line, and it is the difference between a measured figure and a corrected one. Nothing to gain by letting it be hidden.
src/ui/
ResultView.tsx the number, the note, the count, the failure message
ResultWaveform.tsx canvas: the analysed window with combustion ticks
ResultLine.tsx from phase 4 is replaced by ResultView.tsx and deleted. It
was scaffolding and said so.
No new state. useAnalysis already holds everything, and already clears on a
clip or window change, so the marks clear with the number for free.
Math.round(rpm), in a large plain figure with rpm beneath it in small
muted text, so the unit never competes with the value.
Tabular numerals and a fixed minimum width of four digits, so 998 and 1450 do
not shift the layout between runs. This is why the phase 3 .mono class exists;
it is reused rather than duplicated.
A canvas of its own, 96 px tall, drawn once per result:
computePeaks over the window's samples, the same function the crop
waveform uses. The window clip comes from getWindowClip().pulseTimesS, in the accent
colour, positioned t / windowLength * width.Not interactive. No handles, no crop shading, no position line. It shows one thing: where the app thinks the combustions were.
Colours come from the CSS variables through the same read-once-per-scheme
pattern as WaveformCanvas, so light and dark both work and no frame pays for
getComputedStyle.
The message takes the number's place, in the error colour, at ordinary text size rather than display size: it is a sentence, not a figure. The waveform is not drawn, since there is nothing to mark. Everything above stays live.
When the status becomes done or failed, the result element is scrolled into
view with scrollIntoView({ block: 'nearest', behavior: 'smooth' }).
nearest rather than center so a screen tall enough to show everything does
not scroll at all.
resultWaveform.test.ts — the pure part: tickX(timeS, windowS, width), and
that a tick lands within a pixel of where the pulse is in the window. The
canvas drawing itself is not unit tested; that is what the Playwright pass is
for.analysis.fixtures.test.ts gains an assertion that the mark count is within
5 % of pulsesPerS * durationS for every fixture, which is AC 1 without a
browser.No animation on the number. No sharing. No saving. No confidence figure. The tachometer gauge stays in the backlog where phase 1 put it.