Athlete segments tab: link best time to activity; expandable effort list

- best_activity_id now included in segment_summary API response
- Best time is a direct link to the activity that produced it
- Clicking a row expands an inline effort list (lazy-loaded from
  /api/segments/{id}/efforts): date linked to activity, time, Δ vs PR
- Clicking again collapses; ▲/▼ chevron shows state
This commit is contained in:
Davide Scaini
2026-05-13 08:40:39 +02:00
parent 59cf99f0af
commit 0ff5473dfd
2 changed files with 98 additions and 12 deletions
+3 -2
View File
@@ -2699,8 +2699,9 @@ async def user_segment_summary(handle: str) -> JSONResponse:
"sport": seg.sport,
"distance_m": seg.distance_m,
},
"best_elapsed_s": best.elapsed_s,
"effort_count": len(efforts),
"best_elapsed_s": best.elapsed_s,
"best_activity_id": best.activity_id,
"effort_count": len(efforts),
})
result.sort(key=lambda x: x["segment"]["name"].lower())
return JSONResponse(result)