Skip to content

fix: wire the Welcome Plans button to the WorkoutPlansScreen#968

Merged
Somil450 merged 2 commits into
Somil450:mainfrom
Anexus5919:fix/wire-plans-button
Jul 9, 2026
Merged

fix: wire the Welcome Plans button to the WorkoutPlansScreen#968
Somil450 merged 2 commits into
Somil450:mainfrom
Anexus5919:fix/wire-plans-button

Conversation

@Anexus5919

Copy link
Copy Markdown
Contributor

📌 Related Issue

Fixes #883


📝 Description

The Welcome "Plans" button called an empty onViewWorkoutPlans handler, and WorkoutPlansScreen (added by #708) existed but was never imported or rendered, with no Screen value, no transition, and no render block. The button did nothing and the screen was unreachable.

🔹 What has been changed?

  • Added a workoutPlans screen to the Screen union and SCREEN_TRANSITIONS (reachable from welcome, returns to welcome).
  • Lazy-loaded WorkoutPlansScreen and routed the button: onViewWorkoutPlans={() => navigateTo("workoutPlans")}.
  • Rendered WorkoutPlansScreen with activePlan/setActivePlan state; exported ActivePlan from the component so App can type that state.

🔹 Why are these changes needed?

  • The button and screen were both present but never connected, so a documented feature was unreachable. Wiring the route makes the screen reachable. The optional addXP/onStartWorkout props are intentionally omitted (onStartWorkout is declared but unused in the component, and useLeveling exposes no amount-based XP method), so they are left for a follow-up rather than faking a mapping.

🛠️ Type of Change

  • 🐛 Bug Fix

🧪 Testing

✅ Tests Performed

  • Tested locally
  • npx tsc --noEmit and npx eslint clean for the changed files.
  • Traced the navigation path: button -> navigateTo("workoutPlans") -> renders WorkoutPlansScreen -> back returns to welcome.

🔹 Note on automated tests

No committed test: App-level routing of a lazy-loaded screen is not covered by the repo's frontend test setup; verified by tsc/eslint and tracing the path.

🌐 Browsers Tested

Not applicable here (routing wiring; verified via static analysis).


📷 Screenshots / Demo (if applicable)

A screenshot of the Welcome screen's "Plans" button could be added to show the entry point.


📋 Checklist

  • I have read the project's CONTRIBUTING guidelines
  • My code follows the project style guidelines
  • I have performed a self-review of my code
  • I have tested my changes locally
  • I have added/updated documentation where necessary (not applicable)
  • My changes do not introduce new warnings or errors
  • This PR is linked to an existing issue

💬 Additional Notes

Branched from upstream/main; merges cleanly with the current base.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Anexus5919 is attempting to deploy a commit to the somiljain2024-4175's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Anexus5919

Copy link
Copy Markdown
Contributor Author

@Somil450 @diksha78dev Kindly have a review on this pr. Thanks!

The Plans button called an empty onViewWorkoutPlans handler, and
WorkoutPlansScreen existed but was never imported or rendered, so the
button did nothing.

Add a workoutPlans screen (lazy-loaded, with a welcome transition),
route the button to it, and render WorkoutPlansScreen with the active-plan
state. Export ActivePlan so App can type that state.
@Anexus5919 Anexus5919 force-pushed the fix/wire-plans-button branch from 21c1e49 to 7cef592 Compare July 1, 2026 07:29
@Anexus5919

Copy link
Copy Markdown
Contributor Author

@Somil450 @diksha78dev Kindly have a review on this pr. Thanks!

@Anexus5919

Copy link
Copy Markdown
Contributor Author

This failing check is from main, not this PR. Main's CI is currently broken (ShieldAlert used without importing it, plus untyped "privacy"/"terms&conditions" screens), so every PR goes red, even docs-only ones. Fix is up in #1039. Once it merges, a rebase turns this green. Merges cleanly with base.

@Somil450 Somil450 self-requested a review July 9, 2026 14:41
@Somil450 Somil450 added gssoc-26 Marks GSSoC issues gssoc:approved Officially reviewed and approved GSSoC contribution ready for scoring mentor:Somil450 Reviewed and mentored by Somil450 for GSSoC contribution tracking. level:intermediate Moderate complexity requiring good understanding of project structure and implementation. type:bug mentor-approved labels Jul 9, 2026
@Somil450 Somil450 merged commit 325c317 into Somil450:main Jul 9, 2026
0 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Officially reviewed and approved GSSoC contribution ready for scoring gssoc-26 Marks GSSoC issues level:intermediate Moderate complexity requiring good understanding of project structure and implementation. mentor:Somil450 Reviewed and mentored by Somil450 for GSSoC contribution tracking. mentor-approved type:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Welcome "Plans" button does nothing — empty handler and WorkoutPlansScreen never rendered

2 participants