Marshaling: no rulings before commit — kill click-to-insert; unified re-detection preview#354
Merged
Merged
Conversation
…fied re-detection preview
Live-testing surfaced rulings appearing BEFORE any explicit commit while
tuning detection thresholds, plus baffling "Lap inserted" audit entries
while removing laps. Root cause: the RSSI trace svg carried an onclick
that IMMEDIATELY sent an InsertLap at the cursor time — and the browser
synthesizes a click on the svg when a threshold drag (pointerdown →
pointerup on a handle) finishes inside it, so EVERY drag planted a
phantom lap; stray clicks did the same.
Fix 1 — no direct click-to-insert, ever (RssiGraph.svelte):
- The svg's click-to-insert path is removed entirely. The ONLY add path
is the explicit, labelled "Add lap here" button in the cursor readout
under the plot (deliberate, un-misfireable).
- The in-plot hover hint now points at that button ("add lap ↓ below");
the crosshair cursor cues the position readout, not a click action.
- Lap-marker clicks (select-lap) keep working unchanged.
- Tests: a trace click sends NOTHING (component + screen level); a full
threshold drag followed by the browser-synthesized svg click sends
NOTHING; the readout button still sends the exact heat-tagged
InsertLap.
Fix 2 — unified re-detection preview (redetect.ts + Marshaling.svelte):
- New pure `previewRows(current, detected, tolerance?)`: ONE
chronological list telling the whole story — laps derived from the
surviving pass chain, each `kept` (closing pass matched an official
one) or `added` (new), interleaved with `removed` rows for every
official pass the re-detection drops (passes leaving the record — no
lap number). Unit-tested: kept/added classification, removed
interleaving in time order, pure-kept diffs, tolerance matching.
- The tune panel's side-by-side preview-vs-official lap lists are
replaced by that single list: kept rows plain, added rows
accent-marked "+", removed rows struck/dimmed "− pass at Ts —
removed". The "Would be N laps (+A, −R)" summary stays; the exact
commit command batch (VoidDetection/InsertLap) is untouched —
render-only.
Gates: rd-console svelte-check (both passes) clean; vitest 42 files /
544 tests green; frontend eslint + prettier clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Live-testing findings (user): adjusting thresholds produced audit rulings BEFORE commit, and the side-by-side preview-vs-official lap lists confused.
Root cause (verified live): the trace svg carried a click-to-insert handler that sent an unconfirmed
InsertLapon ANY click — and finishing a threshold drag synthesizes exactly such a click, so every drag planted a phantom "Lap inserted" at the cursor. This also explains the earlier "Lap inserted while removing laps" confusion.+-accented, dropped passes struck− pass at Xs — removed— built by a new purepreviewRows(5 unit tests). Commit batch untouched.Verified against the live rig: drag + three bare trace clicks → audit count unchanged, tuning still works, zero page errors. Gates: 544 console tests, both check passes, lint clean. Frontend-only.
🤖 Generated with Claude Code