Skip to content

Reviews – Frontend

Technical documentation for the member-facing Reviews frontend in Alan Home (eu-home-app). Intended for developers debugging or developing on the feature. For the HR / community-lead tooling (reviews / cycles / templates management), see Admin.

Routes and pages

Route Component Purpose
/reviews ReviewsHome List of pending actions (self, coachee, peer) and active reviews
/reviews/:reviewId ReviewPacket Aggregated review packet (self-review + all published submissions)
/reviews/:reviewId/select-reviewers PickReviewers Reviewee/coach: add reviewers to the review
/reviews/:reviewId/validate-reviewers PendingReviewers Coach: approve or reject pending reviewer submissions
/reviews/:reviewId/:reviewSubmissionId WriteReviewRouter Reviewer: write or edit a submission (self / peer, answers, publication)

PickReviewers and PendingReviewers share a common layout, route guard, and callout. The callout text is driven by the cycle's reviewers_selection_guidelines (markdown). The select-reviewers CTA is hidden before the cycle start_date. The packet view (ReviewPacket) is gated on released_on (coach release CTA otherwise).

Data layer

Query options (OpenAPI)

Function Route What it does
searchReviewsQueryOptions(parameters) GET /reviews List reviews (filters: reviewee_ids, reviewer_ids, statuses, etc.)
searchReviewSubmissionsQueryOptions(parameters) GET /reviews/{review_id}/review-submissions List submissions (filters: reviewer_ids, published, types)
reviewQueryOptions(reviewId) GET /reviews/{review_id} Get a single review
reviewSubmissionsQueryOptions(reviewId) GET /reviews/{review_id}/review-submissions List submissions for a review
reviewSubmissionQueryOptions(reviewId, submissionId) GET /reviews/{review_id}/review-submissions/{review_submission_id} Get a single submission
openApiPolicyCheckOptions(...) HEAD /{resource}?method={verb} ABAC policy checks (e.g. view answers, approve, publish)

Mutations

Mutations in utils/reviews.tsx for creating submissions, updating answers, publishing, approving, rejecting, extending dates, releasing.

Types

Types come from @alaneu/openapi-codegen/src/generated/eu-tools (Schemas.Review, Schemas.ReviewSubmission, etc.). Status and submission-type labels are in REVIEW_STATUS_LABELS and REVIEW_SUBMISSION_STATUS_LABELS.

Flow (high level)

  1. Home: Load todos and active/coachee reviews via query options; render lists and links to ReviewPacket, PickReviewers, PendingReviewers, or WriteReviewRouter.
  2. Packet: ReviewPacket loads the review and submissions; shows status, timeline, and actions (add reviewers, validate, write submission, extend dates, release) depending on policy. Gated on released_on.
  3. Select reviewers: Add submissions (reviewers) for the review; when enough are added, status moves to coach approval.
  4. Validate reviewers: Coach approves or rejects each submission; when enough are approved, status moves to self-review or submissions.
  5. Write review: WriteReviewRouter picks the self vs peer writing flow; reviewer edits answers and publishes. After all submissions are published, status becomes completed; coach can then release (PDF to Drive).

Notable behaviors

  • Step navigator: the writing flow uses a simplified header with a step navigator.
  • Self-review: answers render as markdown; a warning shows when the word count exceeds ~600. Submitting redirects to home.
  • Wrap-up questions: the wrap_up summary items are clickable to jump back and edit the underlying answer.
  • Peer-review sidebar: non-callout questions are numbered (hidden when a step has a single question); validated sections show a blue tick; the sidebar badges when a self-review is re-published.
  • Submission: a confirmation popup appears after a peer review is submitted.
  • AI feedback summary: the peer-review UI reads the precomputed ReviewFeedbackSummary (GET /reviews/<id>/feedback-summary) on load.
  • Google Calendar: a review submission is synced to the reviewer's Google Calendar.
  • Deadline extension: HR can extend the deadline of an already-completed review.
  • Opt-in: members opt into eligible cycles from their Profile (ReviewCycleOptInReasonModal).

Permissions

Access is enforced by the backend via ABAC. The frontend uses openApiPolicyCheckOptions to show/hide or enable/disable actions (e.g. "Approve", "Publish", "View answers"). Policy IDs align with backend (e.g. reviewee, reviewer, reviewee-coach).