[DQ-11] Lead with plain-language training labels - #2400
Conversation
Move model names and formulas into accessible details across web and mobile.\n\nCloses #2084
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
📝 WalkthroughWalkthroughThe PR centralizes training terminology across web and mobile surfaces. Plain-language labels appear by default. Technical names, formulas, explanations, and sources are available through expandable web sections or mobile alerts. It also adds a Mobile Metro CI incident record. ChangesTraining terminology and disclosures
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
actor Athlete
participant TrainingSurface
participant TRAINING_TERMINOLOGY
participant MethodExplanation
Athlete->>TrainingSurface: View training metric
TrainingSurface->>TRAINING_TERMINOLOGY: Read plain label and description
TrainingSurface-->>Athlete: Show plain-language content
Athlete->>MethodExplanation: Expand calculation details
MethodExplanation-->>Athlete: Show technical name, details, and source
Assessment against linked issues
Out-of-scope changes
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideThis PR standardizes training metric terminology across web and mobile, leading with plain-language labels in headings and charts while moving technical model details into centralized, expandable explanations and new shared utilities, and updates tests to assert the new UX and accessibility behavior. Sequence diagram for mobile expandable training method detailssequenceDiagram
actor User
participant TrainingMethodDetails
participant ChartDescriptionTooltip
participant Alert
participant openExternalUrl
User->>TrainingMethodDetails: tap "About How this is calculated"
TrainingMethodDetails->>ChartDescriptionTooltip: render(title, description)
ChartDescriptionTooltip-->>Alert: alert(title, description, [{ text: Close }])
User->>TrainingMethodDetails: tap source link
TrainingMethodDetails->>openExternalUrl: openExternalUrl(source.url, sourceActionId)
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Mobile PreviewScan to open on device:
To test on device:
|
|
Storybook previews for This comment updates automatically on each PR push. |
Code Review by Qodo
Context used✅ Compliance rules (platform):
190 rules✅ Skills:
fix-provider, write-tests, cloudflare 1.
|
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
PR Summary by QodoLead training views with plain-language labels (web + mobile parity)
AI Description
Diagram
High-Level Assessment
Files changed (34)
|
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
Code review by qodo was updated up to the latest commit 437b59e |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/production-incident-baseline.md`:
- Around line 42-45: Add a “### Follow-up Work” section to the incident record
after “### Remaining Risk,” documenting the action to rerun the workflow once
the Infisical OIDC request succeeds and the evidence to capture, including the
successful job URL and mobile Metro/dependent CI gate results.
- Around line 14-25: Add a “### Follow-Up Work” section to
docs/production-incident-baseline.md, following the existing incident details
and AGENTS.md requirements. Include a brief, actionable durable remediation for
the failed Build Mobile / Metro Bundle CI validation before merge.
In `@packages/web/src/components/MethodExplanation.test.tsx`:
- Around line 25-34: Update
packages/web/src/components/MethodExplanation.test.tsx lines 25-34 to assert the
technical name and at least one detail line with toBeVisible() after clicking
the disclosure trigger; update
packages/web/src/components/GradeAdjustedPaceTable.test.tsx lines 132-135 to
replace the toBeDefined() assertion for “How this is calculated” with
toBeVisible().
In `@packages/web/src/components/PowerCurveChart.tsx`:
- Around line 146-156: Update the conditional rendering around MethodExplanation
in PowerCurveChart to use modelCurveData.length > 0 instead of only checking
model, matching the condition used for the fitted model curve. Ensure the
Current fit disclosure is hidden when the fitted series is empty, including when
model.cp is 0, and add a regression case covering cp: 0.
In `@packages/web/src/components/StrainCard.tsx`:
- Around line 176-180: Remove the existing direct paragraph rendering
data.context.description near MethodExplanation in StrainCard, leaving the
description rendered only through MethodExplanation’s lines prop. Preserve the
disclosure’s existing technicalName and styling so the explanation appears only
after expansion.
In `@packages/web/src/routes/training/hiking.test.tsx`:
- Line 135: Remove the negative screen.queryByText(/Minetti/) assertion from the
hiking route test, while preserving the existing plain-language assertions.
Cover technical-detail availability with a positive assertion in the disclosure
component test instead.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: fcdd56af-daec-4a71-9a85-2cef73c414b1
📒 Files selected for processing (34)
docs/production-incident-baseline.mdpackages/mobile/app/(tabs)/strain.test.tsxpackages/mobile/app/(tabs)/strain.tsxpackages/mobile/components/TrainingDistributionCards.test.tsxpackages/mobile/components/TrainingDistributionCards.tsxpackages/mobile/components/TrainingMethodDetails.tsxpackages/training/src/terminology.test.tspackages/training/src/terminology.tspackages/web/src/components/ActivityVariabilityTable.test.tsxpackages/web/src/components/ActivityVariabilityTable.tsxpackages/web/src/components/EstimatedMaxChart.test.tsxpackages/web/src/components/EstimatedMaxChart.tsxpackages/web/src/components/GradeAdjustedPaceTable.test.tsxpackages/web/src/components/GradeAdjustedPaceTable.tsxpackages/web/src/components/MethodExplanation.test.tsxpackages/web/src/components/MethodExplanation.tsxpackages/web/src/components/PolarizationTrendChart.test.tsxpackages/web/src/components/PolarizationTrendChart.tsxpackages/web/src/components/PowerCurveChart.test.tsxpackages/web/src/components/PowerCurveChart.tsxpackages/web/src/components/StrainCard.tsxpackages/web/src/components/TrainingInsightsPanel.test.tsxpackages/web/src/components/TrainingInsightsPanel.tsxpackages/web/src/components/TrainingMonotonyChart.test.tsxpackages/web/src/components/TrainingMonotonyChart.tsxpackages/web/src/components/WorkloadRatioChart.test.tsxpackages/web/src/components/WorkloadRatioChart.tsxpackages/web/src/components/chart-options.test.tspackages/web/src/lib/hikingPaceCopy.tspackages/web/src/routes/training/cycling.tsxpackages/web/src/routes/training/endurance.tsxpackages/web/src/routes/training/hiking.test.tsxpackages/web/src/routes/training/range-plumbing.test-helper.tsxpackages/web/src/routes/training/strength.lazy.tsx
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
Addressed the actionable CodeRabbit review in a2f6a59, merged current origin/main in fee5b85, and pushed 6fde14f.
All nine inline threads have concrete replies and are resolved. Focused validation is green: 8 files, 57 tests. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
Summary
Validation
Closes #2084
Summary by Sourcery
Lead training metrics with shared plain-language labels while moving technical model details into expandable explanations across web and mobile.
New Features:
Enhancements:
Tests:
Summary by cubic
Leads training metrics with plain-language labels across web and mobile, moving model names and formulas into “How this is calculated” details. Centralizes terminology in
@dofek/training/terminologyand applies it across power, strength, pace, workload, and distribution views, aligning with issue #2084.New Features
@dofek/training/terminologyentries for intensity distribution, workload ratio, normalized power, sustainable power, short‑burst reserve (W′), polarization, monotony, grade‑adjusted pace, and estimated 1‑rep max.MethodExplanationadded and applied to Power Curve (shown as “Sustainable power model” with CP/W′ details), Estimated single‑rep strength, Grade‑adjusted Pace, Polarization Trend (“Easy‑to‑hard balance”), Training Monotony (“Training variety” and “Weekly load strain”), Workload Ratio, and the Insights intensity donut; Activity Variability table now shows “Effort‑adjusted power (W)”.TrainingMethodDetails; updatedTrainingDistributionCardsandStrainScreento lead with plain labels, keep server explanations in a disclosure, and align error titles with plain terms.POWER_UNIT_LABELandWORK_UNIT_LABELin@dofek/format/unitsand used in charts, tables, and tooltips.Refactors
packages/training/src/terminology.tsfrom coverage and mutation checks.Written for commit f0d39a8. Summary will update on new commits.
Summary by CodeRabbit