Skip readings without a device-reported speed instead of falling back - #8
Merged
Merged
Conversation
When a device has an input speed unit configured, its own reported speed is trusted outright. Previously, readings the device didn't report a speed for fell back to the noisy position-derived calculation and surfaced a warning banner. In production this was a small proportion of readings (e.g. 457 of 4212), and folding them back in via the derived calculation just reintroduced the exact GPS-jitter noise this feature was meant to remove. Those readings — and the outlier-filtering step they'd otherwise need — are now skipped entirely from the chart, average/max speed, and route map, rather than patched with a fallback value. Devices with no input speed unit configured are unaffected: they keep the original fully-derived behaviour, GPS-jitter outlier filtering included. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q1tFbZfhQvqCNtbqopqTbM
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Analysis tab’s speed handling to avoid reintroducing GPS-jitter noise by no longer falling back to position-derived speed when a device is configured to provide its own speed, and removes the associated warning UX.
Changes:
- When
inputSpeedUnitis configured, route segments without device-reported speed are skipped instead of falling back to derived speed. - Removes the “Some readings are calculated” warning banner and related summary fields.
- Updates chart point inclusion logic to skip points whose segment was filtered out (missing device speed or derived outlier).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+478
to
+481
| // Once a device has a configured input unit, its own reported speed is authoritative: | ||
| // readings it didn't report are skipped outright rather than patched with a noisy | ||
| // position-derived guess. Devices with no input unit configured keep the original | ||
| // fully-derived behaviour, GPS-jitter outliers and all. |
Comment on lines
+541
to
+550
| const chartData = pointsWithDerivedSpeed | ||
| .filter((point, index) => index === 0 || resolvedPointIds.has(point.id)) | ||
| .map((point) => ({ | ||
| pointId: point.id, | ||
| timestampMillis: toMillisTimestamp(point.timestamp), | ||
| timestampLabel: displayDateTime(point.timestamp).toFormat("HH:mm"), | ||
| speedDisplay: Number( | ||
| fromMetersPerSecond(point.speedMps, displaySpeedUnit).toFixed(2), | ||
| ), | ||
| })); |
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.
Summary
Follow-up to #7. In production, the fallback-with-warning behaviour showed up as:
That's a small proportion of readings, and falling back to the position-derived calculation for them just reintroduced the exact GPS-jitter noise the device-speed feature was meant to eliminate.
Test plan
npx tsc -b— no new type errors (same two pre-existing, unrelated errors as before intimingPoints.tsx/timingPointsHistoricComparison.tsx)Generated by Claude Code