fix(ui): the paid org gate must reach the user with a way to pay - #350
Merged
Conversation
Creating an org used to be a hard one-per-account cap, so both renderers special-cased kind='organization': they said 'each account can own one organization', pointed at capy invite, and deliberately withheld the upgrade link — an offer that could not be taken. CAP-550/CAP-592 turned that cap into a Team-tier paywall, which inverts the requirement: the link IS the way out now, and withholding it strands a user who is willing to pay. Both surfaces carried the mistake independently, so both change: errorScreen's organization branch no longer returns early and now goes through the shared paywall render, and commandErrorScreen carries the upgrade URL as a fact and offers paying first, with the invite route as the alternative rather than the only exit. 'Capy Business' is retired under Free/Solo/Team and no longer appears in any user-facing string. All new CLI wording is minimal-neutral and COPY-FLAGged — Vince approved the service strings and the behaviour, not this copy. Existing test expectations are unchanged (27 pass before, 31 after); the four added tests assert the property, since nothing previously covered the organization branch's text at all. Also replaces a let/reassign pair in renderQuotaExceeded with an early-return quotaCopyFor() helper.
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.
Creating an org is now a paywall, not a hard cap — it's gated on the Team tier. Both error renderers still treated it as the old one-per-account rule.
The bug
renderQuotaExceeded(terminal) andquotaExceeded(page) each special-casedkind: 'organization'with the same reasoning — "the 1-org-per-user cap is a hard rule, not a paywall" — and returned early. That branch told the user "Each Capy account can own one organization", pointed them at asking for an invite, and deliberately withheldupgrade_url, on the grounds that an upgrade link would be an offer that couldn't be taken.That reasoning was correct for the old model and is now exactly backwards. The service computes a correct upgrade link, and the CLI threw it away — so the paid gate reached the user with no way to pay.
The fix
Both surfaces now offer the upgrade. The terminal's organization branch no longer returns early and goes through the shared paywall render; the page carries
upgrade_urlas a fact and offers paying first, with the invite route as the alternative rather than the only exit. Project and member refusals now surface the URL on the page too, which they previously only did in the terminal.Capy Businesswas the single paid tier and is retired under Free / Solo / Team; it no longer appears in any user-facing string.Copy
All new CLI wording is minimal-neutral and marked
COPY-FLAG. The service strings and the behaviour ("prompt users to pay") are approved; this file's wording is not yet. The renderers still take their specific reason from the service message rather than inventing one, which the added tests pin.Verification
Existing expectations are unchanged — 27 passed before, 31 after. Nothing previously asserted the organization branch's text, so the four added tests are new coverage rather than adjusted expectations.
Pairs with the service side in capysc/capy#573. Neither half is releasable alone.