Link a signed-in visitor to the configured continue page #134

Merged
thatguygriff merged 3 commits from feature/registration-logged-in-continue-link into main 2026-07-29 02:18:21 +00:00
Owner

Closes #131.

A signed-in visitor landing on the registration page got a dead end — RegistrationPage::render() returned a bare "You already have an account and are logged in." with no way onward.

The link they needed was already being built ten lines above, in the just-registered-via-invite branch. This extracts it into continueLink() and uses it for both logged-in outcomes.

Behaviour

State Before After
Signed in, page configured bare sentence sentence + "Continue to your account" link
Signed in, no page configured bare sentence bare sentence (unchanged)
Signed in, configured page deleted bare sentence bare sentence, no broken link
?us_registered=invite unchanged unchanged

There is deliberately still no wp_login_url() fallback. Pointing someone who is already signed in at the login screen is the same dead end with extra steps — the same reasoning the invite branch already documented.

Also

Both messages now carry the us-register-form wrapper and enqueue us-scheduler. The invite branch emitted that markup but never loaded the stylesheet for it, so its success panel rendered unstyled.

Tests

  • testAlreadyLoggedInVisitorIsLinkedToTheChosenPage — link present, and not mistaken for the just-registered branch.
  • testAlreadyLoggedInVisitorGetsNoLinkWithoutAChosenPage — covers both no page configured and a page since deleted.

composer test (657 tests, 1868 assertions), composer lint, composer cs all pass.

🤖 Generated with Claude Code

Closes #131. A signed-in visitor landing on the registration page got a dead end — `RegistrationPage::render()` returned a bare "You already have an account and are logged in." with no way onward. The link they needed was already being built ten lines above, in the just-registered-via-invite branch. This extracts it into `continueLink()` and uses it for both logged-in outcomes. ## Behaviour | State | Before | After | |---|---|---| | Signed in, page configured | bare sentence | sentence + "Continue to your account" link | | Signed in, no page configured | bare sentence | bare sentence (unchanged) | | Signed in, configured page deleted | bare sentence | bare sentence, no broken link | | `?us_registered=invite` | unchanged | unchanged | There is deliberately still no `wp_login_url()` fallback. Pointing someone who is already signed in at the login screen is the same dead end with extra steps — the same reasoning the invite branch already documented. ## Also Both messages now carry the `us-register-form` wrapper and enqueue `us-scheduler`. The invite branch emitted that markup but never loaded the stylesheet for it, so its success panel rendered unstyled. ## Tests - `testAlreadyLoggedInVisitorIsLinkedToTheChosenPage` — link present, and not mistaken for the just-registered branch. - `testAlreadyLoggedInVisitorGetsNoLinkWithoutAChosenPage` — covers both no page configured and a page since deleted. `composer test` (657 tests, 1868 assertions), `composer lint`, `composer cs` all pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Reworded per feedback: the link now names the destination page — "Continue to Book a Lesson" rather than "Continue to your account", via get_the_title(). An untitled page keeps the generic wording so the link can never render as "Continue to ". Covered by testContinueLinkFallsBackToGenericWordingForAnUntitledPage and asserted in both linked-page tests.

Reworded per feedback: the link now names the destination page — "Continue to Book a Lesson" rather than "Continue to your account", via `get_the_title()`. An untitled page keeps the generic wording so the link can never render as "Continue to ". Covered by `testContinueLinkFallsBackToGenericWordingForAnUntitledPage` and asserted in both linked-page tests.
thatguygriff force-pushed feature/registration-logged-in-continue-link from 1975630136 to c642fb7c3e 2026-07-29 02:05:25 +00:00 Compare
thatguygriff added 3 commits 2026-07-29 02:07:28 +00:00
The registration page's already-logged-in branch returned a bare
sentence with nowhere to go, leaving the visitor to find their own way
to their account. The invited-student branch a few lines above already
built exactly the link that was missing.

Extract that into continueLink() and use it for both logged-in
outcomes. There is deliberately still no wp_login_url() fallback:
sending someone already signed in to the login screen is the same dead
end with extra steps, so with no page configured there is no link.

Both messages now carry the us-register-form wrapper and enqueue the
plugin stylesheet, which the invite branch emitted markup for but never
loaded.

Closes #131
"Continue to your account" says nothing about where the link goes. Use
the chosen page's own title instead — "Continue to Book a Lesson" — so
the visitor knows before clicking.

An untitled page keeps the generic wording rather than rendering
"Continue to ".
Add the changelog entry for the continue link
CI / Tests (PHP 8.1) (pull_request) Successful in 50s
CI / Coding Standards (pull_request) Successful in 3m0s
CI / No Debug Code (pull_request) Successful in 2s
CI / Tests (PHP 8.2) (pull_request) Successful in 52s
CI / PHPStan (pull_request) Successful in 3m0s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m53s
CI / Build Plugin Zip (pull_request) Skipped
61b00c2ed3
thatguygriff force-pushed feature/registration-logged-in-continue-link from c642fb7c3e to 61b00c2ed3 2026-07-29 02:07:28 +00:00 Compare
thatguygriff merged commit d9dd576630 into main 2026-07-29 02:18:21 +00:00
thatguygriff deleted branch feature/registration-logged-in-continue-link 2026-07-29 02:18:21 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#134