Surface Studio Code payment-method requirement before the first prompt - #4422
Draft
sejas wants to merge 1 commit into
Draft
Surface Studio Code payment-method requirement before the first prompt#4422sejas wants to merge 1 commit into
sejas wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
How AI was used in this PR
The visual design, copy, and illustration come from the human-reviewed prototype in #4407. This PR ports that design onto the real account checks; the result was reviewed and tested manually.
Proposed Changes
Since STU-2174, the WordPress.com proxy rejects Studio Code requests from accounts without a saved payment method (or a verified email). Today users only discover this after typing and sending their first prompt, as an error in the conversation.
This PR surfaces the requirement upfront:
has_payment_methodandemail_verified). Users who don't meet a requirement see a dedicated screen explaining the free-beta payment-method requirement — including the monthly allowance and the no-charge reassurance — instead of an unlocked composer that will fail.The screenshot assets are committed under
.github/pr-assets/stu-2178/only so this PR has stable visual references; they can be removed before merge.Screenshots
Core flow (light mode)
Dark mode
Testing Instructions
npm startand log in with a WordPress.com account without a saved payment method — the Studio Code tab should show the payment requirement instead of the composer.https://my.wordpress.com/me/billing/payment-methods/addand Studio shows the waiting state.Validated locally with:
npx eslint --fixon the modified filesnpm run typechecknpm test -- apps/studio/src/components/studio-code-session apps/studio/src/components/tests/site-content-tabs.test.tsx packages/common(599 tests)Pre-merge Checklist