)}
- {/* Date filter chip */}
+ {/* Date filter chip + week totals */}
{fromParam && (
-
+
Week of {format(new Date(fromParam), 'MMM d, yyyy')}
+ {activities?.length > 0 && (
+
+ {formatDistance(totalDistanceM, unit)} ·{' '}
+ {formatDuration(totalDurationS)} ·{' '}
+ {activities.length} {activities.length === 1 ? 'activity' : 'activities'}
+
+ )}
)}
diff --git a/frontend/src/utils/format.js b/frontend/src/utils/format.js
index 4190581..9e06823 100644
--- a/frontend/src/utils/format.js
+++ b/frontend/src/utils/format.js
@@ -117,7 +117,15 @@ export const METRIC_COLOR = {
WEIGHT: '#3b82f6', // blue
}
+// Gym / no-GPS workout types (HIIT, strength, cardio machines etc.) — coloured
+// red so they stand out from the GPS-based outdoor activities.
+const GYM_SPORTS = new Set([
+ 'hiit', 'training', 'fitness_equipment',
+ 'strength_training', 'strength', 'cardio_training', 'cardio',
+])
+
export function sportColor(sportType) {
+ const s = sportType?.toLowerCase()
const colors = {
running: '#22c55e', // green
cycling: '#f97316', // orange
@@ -126,5 +134,6 @@ export function sportColor(sportType) {
swimming:'#38bdf8', // sky
other: '#9ca3af', // gray
}
- return colors[sportType?.toLowerCase()] || '#9ca3af'
+ if (GYM_SPORTS.has(s)) return '#ef4444' // red
+ return colors[s] || '#9ca3af'
}