feat: Trial Pairing Simulator - COI calculator with common ancestors #22

Merged
jason merged 3 commits from feat/trial-pairing-simulator into master 2026-03-09 20:26:17 -05:00
Owner

Trial Pairing Simulator

Implements the top-priority next feature from the roadmap: a full Trial Pairing Simulator UI that leverages the existing /api/pedigree/trial-pairing backend endpoint.

New Files

  • client/src/pages/PairingSimulator.jsx — Full simulator page

Modified Files

  • client/src/App.jsx — Added /pairing route + navbar link with FlaskConical icon
  • client/src/index.css — Added .risk-badge, .risk-low, .risk-med, .risk-high styles

Features

  • Sire (male) and Dam (female) dropdowns populated from /api/dogs
  • Calls POST /api/pedigree/trial-pairing with selected IDs
  • Displays COI percentage with color coding (green/yellow/red)
  • Risk badge: Low (<5%), Moderate (5-10%), High (>10%)
  • Common ancestors table with sire-side and dam-side generation columns
  • Empty state message when no common ancestors found
  • Loading and error states handled
  • Consistent with existing dark theme design system

Backend

No backend changes needed — POST /api/pedigree/trial-pairing already exists and returns { sire, dam, coi, commonAncestors, recommendation }.

Screenshots

N/A — dark theme, matches existing UI patterns.

## Trial Pairing Simulator Implements the top-priority next feature from the roadmap: a full Trial Pairing Simulator UI that leverages the existing `/api/pedigree/trial-pairing` backend endpoint. ### New Files - `client/src/pages/PairingSimulator.jsx` — Full simulator page ### Modified Files - `client/src/App.jsx` — Added `/pairing` route + navbar link with `FlaskConical` icon - `client/src/index.css` — Added `.risk-badge`, `.risk-low`, `.risk-med`, `.risk-high` styles ### Features - Sire (male) and Dam (female) dropdowns populated from `/api/dogs` - Calls `POST /api/pedigree/trial-pairing` with selected IDs - Displays COI percentage with color coding (green/yellow/red) - Risk badge: **Low** (<5%), **Moderate** (5-10%), **High** (>10%) - Common ancestors table with sire-side and dam-side generation columns - Empty state message when no common ancestors found - Loading and error states handled - Consistent with existing dark theme design system ### Backend No backend changes needed — `POST /api/pedigree/trial-pairing` already exists and returns `{ sire, dam, coi, commonAncestors, recommendation }`. ### Screenshots N/A — dark theme, matches existing UI patterns.
jason added 3 commits 2026-03-09 20:24:35 -05:00
jason merged commit cc8179894b into master 2026-03-09 20:26:17 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jason/breedr#22