Align shared page score computation with local history popup#40
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
==========================================
+ Coverage 52.84% 52.96% +0.11%
==========================================
Files 22 22
Lines 1790 1790
Branches 198 199 +1
==========================================
+ Hits 946 948 +2
+ Misses 844 842 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Aligns shared round score computation with the local history dialog by ensuring the B-part time passed into scoring is in rounded seconds (rather than milliseconds), and adds a regression test to prevent the mismatch from reappearing.
Changes:
- Convert
roundData.totalTimefrom ms → rounded seconds when populatingScoringParameters.bPartTimeinSharedRoundCard. - Add a unit test asserting the rendered total points for a round payload where ms-vs-s would be observable.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| components/shared-round-card.tsx | Converts B-part time input to rounded seconds for scoring to match the local dialog behavior. |
| tests/unit/components/shared-round-card.test.tsx | Adds a regression test asserting the total points rendered by SharedRoundCard. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| aPartErrorPoints: roundData.aPartErrorPoints!, | ||
| knotTime: roundData.knotTime!, | ||
| aPartPenaltySeconds: roundData.aPartPenaltySeconds!, | ||
| overallImpression: roundData.overallImpression!, | ||
| bPartTime: roundData.totalTime, | ||
| bPartTime: Math.round(roundData.totalTime / 1000), // § 5.6 |



The shared round view was calculating points with a different B-part time unit than the local history popup, leading to divergent total scores for the same round. This change aligns both views to the same scoring input contract.
Scoring consistency fix
§ 5.6behavior), matching the local history popup logic.Regression coverage
SharedRoundCardthat asserts the rendered total points for a representative round payload where unit mismatch would be visible.