Skip to content

Extract Training thresholds section into ThresholdsView#5

Open
PrernaWeb wants to merge 1 commit into
testflight/no-paywallfrom
refactor/thresholds-view
Open

Extract Training thresholds section into ThresholdsView#5
PrernaWeb wants to merge 1 commit into
testflight/no-paywallfrom
refactor/thresholds-view

Conversation

@PrernaWeb

Copy link
Copy Markdown
Owner

Behaviour-preserving refactor: pull the ~130-line "Training thresholds" section out of the large SettingsView into its own ThresholdsView. Its body is a Section, so it renders identically whether embedded in Settings' Form or shown standalone.

This is the only production (non-DEBUG) change split out of the marketing-screenshot work, so the reviewable surface is isolated. The DEBUG demo scaffolding that builds on it is in a follow-up stacked PR.

What changed

  • ThresholdsView.swift (new): run pace / cycling FTP / swim CSS / threshold HR steppers, the confirm flow, and the stale-set re-estimate nudge — moved verbatim.
  • SettingsView.swift: removes the section + its helpers; now calls ThresholdsView(model: model).
  • Localizable.xcstrings: Xcode string-catalog re-sync (auto-generated, not hand-edited).

Test plan

  • Settings → Training thresholds renders all four rows with the same values as before.
  • Adjusting any Stepper saves and marks the set Confirmed.
  • When unconfirmed, "These look right — confirm" confirms.
  • When a stale re-estimate exists, the nudge shows the changed rows and Update / Keep current both work.
  • Empty-thresholds state shows the "we'll estimate these…" copy.
  • DEBUG build compiles; no behavioural difference vs. before the extraction.

🤖 Generated with Claude Code

Moves the ~130-line thresholds block (run pace / FTP / swim CSS / threshold
HR, the confirm flow, and the stale-set re-estimate nudge) out of the large
SettingsView into its own view. Its body is a Section, so it renders
identically whether embedded in Settings' Form or shown on its own. Pure,
behaviour-preserving refactor; SettingsView now calls ThresholdsView(model:).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
coachsage-site Ready Ready Preview, Comment Jul 21, 2026 11:45pm
run-coach Ready Ready Preview, Comment Jul 21, 2026 11:45pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant