Skip to content

Use shared scheduled-workout prompt service in useScheduledWorkoutPrompt - #489

Merged
gdoumen merged 2 commits into
mainfrom
feat/web-workout-attach
Nov 16, 2026
Merged

gdoumen merged 2 commits into
mainfrom
feat/web-workout-attach

Conversation

@gdoumen

@gdoumen gdoumen commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Summary

The scheduled-today prompt logic moved into incyclist-services so desktop/web can share it. The mobile hook is now a thin wrapper around it; behaviour is unchanged.

Depends on incyclist/services#692 (adds getScheduledWorkoutPromptPageService). The incyclist-services version needs bumping after it is published.

What changed

  • useScheduledWorkoutPrompt calls the shared prompt page service (guard, calendar relay, Yes / Check workouts / No intents). Hook signature and return shape are unchanged; enabled=false still makes no service call or subscription.
  • The hook test is rewritten against a fake prompt service. All 9 cases and their expectations at the hook boundary (prompt, navigate calls) are kept; the guard and calendar-id checks now live in the services tests.
  • Page tests (Workouts, Routes, Activities) that mocked the old hook's dependencies now stub the prompt service.

Test plan

  • npx jest on hooks/workouts and the Workouts, Routes, Activities and NotImplemented pages
  • npx tsc --noEmit, npm run lint (no errors)
  • Device check: scheduled-today prompt after pairing (Yes opens the workout details, Check opens Workouts, No dismisses, once per session)

@sonarqubecloud

Copy link
Copy Markdown

@gdoumen
gdoumen marked this pull request as ready for review November 16, 2026 13:32
@gdoumen
gdoumen merged commit bd91ba2 into main Nov 16, 2026
3 checks passed
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