feat(workspace): make the Personal-workspace invite limit obvious - #2721
feat(workspace): make the Personal-workspace invite limit obvious#2721carlosvirreira wants to merge 2 commits into
Conversation
Personal workspaces are created automatically at signup and cannot have members, so "how can someone join my workspace?" is a recurring support question. The rule was never stated in the product, and Settings > Team removed the answer instead of showing it. Onboarding: - Pre-select Team when the onboarding team-size answer indicates more than one person. - State the consequence on both plan cards instead of only describing each option. - Replace "you can always switch later" with the route that actually exists. - Add signalsTeamIntent() so free-text answers such as "1" are not read as a team. Settings > Team: - Explain the limit on the page people open, with a tier-aware upgrade CTA. - Stop redirecting /settings/team/users and /invites to General with no message. - Render Users and Pending invites locked rather than hiding them entirely. - Correct the non-registered members empty state; those records cannot log in. Workspace switcher: - Show the plan the user actually pays for, plus a route to upgrade. resolveTeamUpgradeCta() keeps the CTA honest per tier: Team-entitled users are sent to workspace creation, and users who already spent their free trial are offered an upgrade rather than a trial the subscription action would reject.
🩺 React Doctor — webapp✅ No new findings on the files changed by this PR. Run locally with |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2ac521f1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return { | ||
| to: "/account-details/subscription", | ||
| label: usedFreeTrial ? "Upgrade to Team" : "Start a Team trial", |
There was a problem hiding this comment.
Route non-premium users to workspace creation
When ENABLE_PREMIUM_FEATURES is false, free and Plus users still receive this subscription CTA, but the subscription loader immediately redirects them to /account-details/general (account-details.subscription.tsx:52-53). In the same environment, canCreateMoreOrganizations explicitly permits workspace creation (subscription.server.ts:289), so the new “Start a Team trial”/“Upgrade to Team” action is a dead end instead of taking these users to /account-details/workspace.
Useful? React with 👍 / 👎.
WalkthroughPersonal workspace onboarding now detects team intent, recommends Team plans, and supports switching plans. Team settings and sidebar navigation expose upgrade actions while personal-workspace team-management routes redirect to non-registered members. ChangesPersonal workspace team guidance
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant WelcomeLoader
participant UserData
participant ChoosePurpose
WelcomeLoader->>UserData: read teamSize
WelcomeLoader->>ChoosePurpose: pass teamIntent and default plan
ChoosePurpose->>ChoosePurpose: show recommendation or select Team
sequenceDiagram
participant TeamSettingsLoader
participant UserSubscription
participant TeamSettings
TeamSettingsLoader->>UserSubscription: read tier and trial usage
TeamSettingsLoader->>TeamSettings: provide upgrade CTA
TeamSettings->>TeamSettings: render personal-workspace teaser
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The plan marker read the workspace type, not what the user pays. Tier lives on the user (User.tierId) while add-ons live on the organization (auditsEnabled, barcodesEnabled), and the personal-with-addons onboarding path enables an add-on on a Personal workspace without ever changing tierId. A free-tier customer paying for Barcodes would therefore have been labelled "Free", and no single label can be correct across every tier and add-on combination. Remove the marker rather than try to compute one. The locked Users and Pending invites items are already an always-accurate standing signal and make no billing claim. Also neutralise the switcher action to "Invite your team". "Upgrade" was wrong for a Team-tier user sitting in their Personal workspace, who needs to create a workspace rather than change plan. Entitlement is now claimed in exactly one place, resolveTeamUpgradeCta, which answers only whether the user can create a Team workspace. That is driven by TierLimit.maxOrganizations and is unaffected by add-ons.
Why
Personal workspaces are created automatically at signup and cannot have members, so "how can someone join my workspace?" is a recurring support question. The limitation itself is fine. The problem is that the product never stated it, and
Settings > Teamremoved the answer instead of showing it:UsersandPending inviteswere hidden from the nav, and visiting either URL silently redirected toSettings > Generalwith no message.Changes
Onboarding (
/welcome)Settings > Team
/settings/team/usersand/settings/team/invitesno longer redirect to General with no explanation.UsersandPending invitesrender locked instead of being hidden entirely.Workspace switcher
Notes for review
resolveTeamUpgradeCta()(app/utils/team-upgrade-cta.ts) answers a single narrow question: can this user create a Team workspace? Team-entitled users go to workspace creation; users who already spent their free trial are offered an upgrade rather than a trial thataccount-details.subscriptionwould reject with "You have already used your free trial".User.tierIdwhile add-ons live on the organization (auditsEnabled,barcodesEnabled), and thepersonal-with-addonsonboarding path enables an add-on on a Personal workspace without changingtierId. A free-tier customer paying for Barcodes cannot be honestly labelled by any single badge, so the sidebar states workspace facts only. Add-ons do not affect Team-workspace entitlement, which comes fromTierLimit.maxOrganizations.NestedRouteRendererpreviously ignored a child nav item'sdisabledprop entirely. It now honours it, which is what makes locked sub-items possible.UserBusinessIntel.teamSizeis captured withSelectWithOtherand is therefore free text (production data contains values like"1"), sosignalsTeamIntent()matches against an allowlist derived fromTEAM_SIZE_OPTIONS.Testing
Summary by CodeRabbit
New Features
Bug Fixes
Tests