Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/piratta/gymApp/llms.txt

Use this file to discover all available pages before exploring further.

The Reviews system is FocusFlow’s structured weekly feedback loop between coach and athlete. At the end of each review period (7, 14, or 30 days, set per athlete in their ClientProfile), the athlete submits a check-in report containing their current body measurements, progress photos, subjective wellness scores, and a free-text comment. Coaches review each submission and write technical feedback — creating an ongoing, documented dialogue that drives intelligent training adjustments over time.

The Review Type

Every check-in is stored as a Review document in Firestore. The full interface is:
export interface Review {
  id: string;
  clientId: string;
  clientName: string;
  date: string; // YYYY-MM-DD
  measurements: BodyMeasurements;
  comment: string;
  photos: string[]; // Mock dataUrls or system images
  status: "pending" | "reviewed";
  coachFeedback?: string;
  feedbackPhotos?: string[];
  driveFolderUrl?: string;
  reviewedAt?: string;
  acknowledgedByClient: boolean;
  workoutHistory?: WorkoutSummary[];
}
Key status transitions:
  • pending — submitted by athlete, awaiting coach evaluation.
  • reviewed — coach has submitted coachFeedback; reviewedAt is stamped automatically.
  • acknowledgedByClient — set to true once the athlete opens and reads the feedback on their portal.

Centralized Reviews Inbox

The top-level Reviews tab in the coach dashboard presents a unified inbox of every check-in from every athlete, sorted by submission date (most recent first). Each list entry surfaces:

Athlete Name

Full name of the submitting athlete, drawn from clientName.

Submission Date

The date field in YYYY-MM-DD format — the date the athlete logged the review.

Status Badge

Either Pendiente de Evaluar (amber) or Evaluado (emerald), reflecting review.status.
The oldest review in an athlete’s history is automatically tagged Revisión Inicial, marking the baseline measurement for progress comparison.

What Coaches See in Each Check-in

Opening a review card expands the full submission. The left column belongs to the athlete’s self-reported data; the right column is the coach’s response area.
The athlete’s free-text Notas y Sensaciones is displayed as a quoted block. This is the comment field and typically contains subjective notes about energy, sleep, stress, and diet adherence for the period.
All non-zero fields from the embedded BodyMeasurements object are displayed in a compact grid with the measurement label and value in centimetres. Available measurement sites include:
FieldSite
cuelloNeck
pechoChest / Thorax
cinturaWaist
caderaHip
brazoContraidoFlexed arm
musloMedioMid-thigh
gemeloCalf
(full list in BodyMeasurements)
Up to three photos (Front, Side, Back) are stored as base64 data URLs in the photos array and rendered as thumbnails. Clicking any thumbnail opens a full-screen lightbox via setSelectedCoachPhotoUrl.
If the athlete completed training sessions during the review period, the workoutHistory array contains a WorkoutSummary[] for each session. Each entry shows:
  • Day name (dayName) and date
  • Time spent (converted from timeSpentSeconds to minutes)
  • Compliance rate (completionRate %) — colour-coded: ≥ 80% emerald, ≥ 50% amber, < 50% rose.

Providing Feedback

1

Open the pending review

Locate the check-in in the Reviews inbox (status badge: Pendiente de Evaluar). Click the Evaluar Reporte Ahora button to expand the inline feedback form.
2

Write technical feedback

Type your coaching notes, load adjustments, nutritional corrections, or habit guidance into the coachFeedback textarea. The placeholder reads: “Indica ajustes de cargas, alimentación o hábitos…”
3

Submit the evaluation

Click Validar y Enviar. FocusFlow calls onEvaluateReview(reviewId, feedback, photos), sets status to "reviewed", stamps reviewedAt, and notifies: “Revisión evaluada correctamente. El atleta recibirá feedback en su portal.”
4

Athlete acknowledgement

Once the athlete opens the feedback on their portal, acknowledgedByClient flips to true. You can edit a previously submitted evaluation at any time using the pencil icon (Edit2).

Google Drive Integration

If driveFolderUrl is set on a review, the check-in card displays a link to a Google Drive folder containing the original full-resolution photos. This is useful when athletes upload hi-res photos outside the app (e.g., via a Google Form or direct Drive upload).
Google Drive integration requires the athlete or coach to have completed Google OAuth sign-in. The driveFolderUrl is populated manually or via an automated pipeline — FocusFlow does not upload directly to Drive.

Per-Athlete Reviews Sub-Tab

The centralized inbox shows all athletes at once. For a historical view scoped to a single athlete, navigate to: Athlete Profile → Reviews sub-tab This view (AthleteReviewsView) filters reviews by clientId === targetCli.id and sorts them newest-first, giving you a clean progression timeline for one individual. The oldest entry in this view is always tagged Revisión Inicial.
Photo storage — important: Progress photos (photos[] and feedbackPhotos[]) are stored as base64 data URLs in localStorage, not in Firestore, because Firestore documents have a 1 MB size limit. The reconcileLocalAndCloud function in src/lib/firebase.ts ensures that during cloud sync, locally stored photos are never overwritten by a cloud-only document that lacks them. Always use a device that has previously loaded the photos to view them.

Build docs developers (and LLMs) love