Skip to content

Social: add the platform-specific input step to the new connection flow#50804

Open
manzoorwanijk wants to merge 1 commit into
trunkfrom
add/connection-flow-platform-input-step
Open

Social: add the platform-specific input step to the new connection flow#50804
manzoorwanijk wants to merge 1 commit into
trunkfrom
add/connection-flow-platform-input-step

Conversation

@manzoorwanijk

@manzoorwanijk manzoorwanijk commented Jul 24, 2026

Copy link
Copy Markdown
Member

Fixes SOCIAL-531

Proposed changes

  • Extract the connect-input rules out of use-request-access.ts into connect-input-validation.ts: notice-free, returning { values, error } so both the legacy connect form (global notice) and the new flow (inline error, gated Submit) share them. use-request-access keeps its existing behaviour.
  • Add the platform-input step: intro copy, Mastodon handle / Bluesky handle + app password fields, footer with Cancel and Submit. Submit stays disabled until the input is valid; duplicate-account errors render inline in the step.
  • Submit calls the existing useRequestAccess() and advances to authorizing only once the connect popup actually opened.
  • Store: goToNextStep, plus connectionFlow.inputs so entered values survive stepping back to the picker and returning. Cleared when the flow starts or is cancelled.
  • Bluesky is undesigned, so it reuses the Mastodon layout with the existing helper text and app-password link.

The legacy accordion (custom-inputs.tsx) is untouched — it keeps its own markup until the flag ships.

  • Bluesky
    Screenshot 2026-07-24 at 4 58 26 PM
  • Mastodon
    Screenshot 2026-07-24 at 4 59 19 PM

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

Add the social-admin-ui-v2 blog sticker to the site to enable the feature flag, then go to Jetpack → Social and click Add account.

  • Pick Mastodon. The title reads "Connect Mastodon account", the field is labelled Handle with placeholder @username@mastodon.social and the helper text below it. Submit is disabled.
  • Type a malformed handle (foo) — Submit stays disabled. Type @user@mastodon.social — Submit enables.
  • Enter the handle of an account already connected to the site: an inline error appears in the step (not a global notice) and Submit is disabled.
  • Click the back chevron, pick Mastodon again — the handle you typed is still there. Closing the modal and reopening it clears the values.
  • Repeat with Bluesky: both handle and app password are required before Submit enables, and a handle like foo.bar.bsky.social shows the "cannot contain dots" guidance.
  • Submit opens the connect popup; the flow moves to authorizing, whose UI lands in M2-03.
  • Cancel and the close icon reset the flow.
  • Disable the flag → the service accordion still connects and reconnects Mastodon/Bluesky, with the same global notices for an invalid handle or an already-connected account.

Extracts the connect-input validation out of use-request-access into a
shared, notice-free helper, then builds the platform-input step on top of
it: Mastodon and Bluesky credential fields, Submit gated on validity, and
duplicate-account errors rendered inline instead of as global notices.

Entered values are held in the store so stepping back to the picker and
returning does not wipe them.
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the add/connection-flow-platform-input-step branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/connection-flow-platform-input-step

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@manzoorwanijk manzoorwanijk added [Status] Needs Team Review Obsolete. Use Needs Review instead. and removed [Status] In Progress labels Jul 24, 2026
@manzoorwanijk
manzoorwanijk requested a review from a team July 24, 2026 11:44
@manzoorwanijk
manzoorwanijk marked this pull request as ready for review July 24, 2026 11:44
@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 9 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/packages/publicize/_inc/components/connection-flow/index.tsx 2/24 (8.33%) -0.36% 1 ❤️‍🩹
projects/packages/publicize/_inc/social-store/actions/connection-flow.ts 5/9 (55.56%) 12.70% 0 💚
projects/packages/publicize/_inc/social-store/actions/constants.ts 38/38 (100.00%) 0.00% 0 💚
projects/packages/publicize/_inc/social-store/constants.ts 10/10 (100.00%) 0.00% 0 💚
projects/packages/publicize/_inc/social-store/reducer/connection-flow.ts 25/25 (100.00%) 0.00% 0 💚

4 files are newly checked for coverage.

File Coverage
projects/packages/publicize/_inc/components/connection-flow/platform-input/index.tsx 26/43 (60.47%) 💚
projects/packages/publicize/_inc/components/services/connect-fields.tsx 6/8 (75.00%) 💚
projects/packages/publicize/_inc/components/services/connect-input-validation.ts 30/31 (96.77%) 💚
projects/packages/publicize/_inc/components/services/use-connect-input-validation.ts 9/9 (100.00%) 💚

Full summary · PHP report · JS report

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant