-
-
Notifications
You must be signed in to change notification settings - Fork 65
Enhance activity view for swimming activities #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance activity view for swimming activities #165
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the activity view specifically for swimming by renaming cadence to stroke rate, autodetecting and displaying rest periods, normalizing zero-pace laps to a score of 0, and hiding the intensity column if no intensity data exists.
- Rename “Cadence” labels to “Stroke rate” for swimming activities
- Detect swim rest laps, shade them in charts and tables, and set their normalized score to 0
- Hide intensity column when no lap has intensity data
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
frontend/app/src/utils/activityUtils.js | Introduced activityTypeIsSwimming , added isRest handling in formatPace |
frontend/app/src/i18n/us/generalItems.json | Added translations for rest, laps, and stroke-rate labels |
frontend/app/src/components/Activities/ActivityStreamsLineChartComponent.vue | Collected stroke-rate data for rest shading and updated chart datasets |
frontend/app/src/components/Activities/ActivityLapsComponent.vue | Marked rest laps and conditionally show elevation, stroke rate, and intensity |
frontend/app/src/components/Activities/ActivityMandAbovePillsComponent.vue | Adjusted graph item labels and elevation visibility based on swim type |
frontend/app/src/components/Activities/ActivityBellowMPillsComponent.vue | Switched cadence to stroke-rate labels and imported swim-type helper |
Comments suppressed due to low confidence (4)
frontend/app/src/components/Activities/ActivityLapsComponent.vue:150
- If
lap.enhanced_avg_pace
is zero, this division yields Infinity. Add a guard so laps with zero or null pace getnormalizedScore = 0
explicitly.
const normalizedScore = (fastestPace / lap.enhanced_avg_pace) * 100;
frontend/app/src/components/Activities/ActivityStreamsLineChartComponent.vue:42
- [nitpick] The
cadLabel
variable is populated but never used; consider removing it or wiring it into the dataset’slabel
property to avoid dead code.
const cadLabel = "";
frontend/app/src/components/Activities/ActivityLapsComponent.vue:134
- You've added swim rest detection logic here. Consider adding unit tests to verify
swimIsRest
flags and the two-rest correction loop.
const lapsWithRest = laps.map(lap => {
frontend/app/src/utils/activityUtils.js:156
- The
i18n
reference isn’t imported in this module; you need to import your localization instance (e.g.import i18n from '@/i18n'
) so thati18n.global.t
is defined.
return i18n.global.t("generalItems.labelRest");
Summary
An effort to improve the activity view with features specific for swimming activities:
Further details available in Issue #166