feat: coach read-only view for athlete plans, workouts, sessions, calendar (#3)#56
feat: coach read-only view for athlete plans, workouts, sessions, calendar (#3)#56Kasionchen wants to merge 6 commits into
Conversation
Hides delete/edit affordances when readOnly=true for coach view. Closes nick-transition#3
Hides delete affordance when readOnly=true for coach view. Closes nick-transition#3
When readOnly=true, hides the edit button and Start Session button. This enables coach view to navigate to a read-only workout detail. Closes nick-transition#3
- _ProgramTile: added readOnly param (default false) - hides write affordances in coach view - _WorkoutExpansionTile: added athleteUid param - needed for WorkoutCard routing - AthleteWorkoutsTab: already uses WorkoutCard(readOnly: true) - no change needed - AthleteSessionsTab: read-only inline session cards - no change needed - New _AthleteCalendarTab: read-only calendar scoped to athleteUid For coach to view workout details, WorkoutDetailScreen now accepts readOnly=true to hide edit/start affordances. Closes nick-transition#3
_ProgramTile now shows WorkoutCard(readOnly: true) instead of inline
ExpansionTile so coach can tap through to read-only WorkoutDetailScreen.
Also added ${r} import for CalendarScreen reference.
Closes nick-transition#3
When coach taps "View Details" on a WorkoutCard in athlete detail view, the WorkoutDetailScreen now receives readOnly=true to hide edit/start affordances. This completes the coach read-only viewing flow. Closes nick-transition#3
|
Thanks for the submission, @Kasionchen. Quick status: PR #57 also addresses issue #3 and arrived with slightly broader scope — it includes a change to session_detail_screen.dart covering the access-control audit (deliverable #4 in the issue) and ships a Playwright spec for the coach read-only flow. So #57 is currently the primary merge candidate, though it's blocked on failing E2E right now. Two things I want to be upfront about: This was partly a process failure on my end — issue #3 asked claimants to comment for approval before starting, and I didn't enforce it, which is how two contributors ended up working in parallel without knowing. That's on me, and I'm tightening it for future bounties. I'm not going to ask you to expand this PR while #57 is still in review. Running a "fix the gaps and we'll see" race between two contributors isn't fair to either of you. |
Summary
Implements #3 — Coach read-only view of athlete's plans, workouts, sessions, and calendar.
Changes
lib/widgets/plan_card.dart— AddedreadOnlyparameter (defaultfalse). Whentrue, hides the delete button.lib/widgets/session_card.dart— AddedreadOnlyparameter (defaultfalse). Whentrue, hides the delete button.lib/widgets/workout_card.dart— Already hadreadOnly. Updated "View Details" button to passreadOnlythrough toWorkoutDetailScreen.lib/screens/workout_detail_screen.dart— AddedreadOnlyparameter (defaultfalse). Whentrue, hides the edit button in AppBar and hides the "Start Session" button.lib/screens/athlete_detail_screen.dart— Added Calendar tab (4th tab) showing read-only calendar scoped to the athlete's sessions. Updated Programs tab to useWorkoutCard(readOnly: true)with proper routing to read-onlyWorkoutDetailScreen.Acceptance Criteria Status
PlanCardwidget as athlete, withreadOnly=trueWorkoutCardwithreadOnly=trueWorkoutDetailScreenshowing inline exercise reference videosScreenshots
See the issue for UI reference. The implementation mirrors the athlete view exactly, minus write affordances.
AI-disclosure: This PR was generated with AI assistance (Hermes Agent).