Repository navigation
Show what Starter changes before checkout, and swap at the plan cap - #1603
Open
helpcodeai wants to merge 2 commits into
Open
helpcodeai wants to merge 2 commits into
helpcodeai wants to merge 2 commits into
Conversation
helpcodeai
force-pushed
the
feat/plan-fit-ui
branch
from
November 9, 2026 09:01
7784932 to
e6a8941
Compare
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.
Summary
The Cloud trial now includes everything in Team. A workspace that buys Starter afterwards is downgraded automatically: the most used connectors and MCP servers stay active, and the rest are paused. This PR is the dashboard side. It says before checkout what Starter would pause or leave out, using the plan-fit endpoint from #1601. After a downgrade, it lets the user swap which items are active. The tone is calm. Starter stays selectable, and Team is one click away.
Stacked on #1601 (
feat/plan-fit).Changes
lib/api.ts:PlanFittypes,license.getPlanFit(token, plan?),planFiton the reactivation view, andpausedByPlan?on usage.planLimitOf()/isPlanLimitError()recognise a 403PLAN_LIMITon every axis (connectors,mcpServers,users,fileSearchConnectors).lib/card-trial.ts:planFitLines(fit)turns a plan fit into short lines, each a message key plus its values, so every UI language words them. Also addsselectionForFit(preselects Team when Starter does not fit and Team does, e.g. because inline code is in use),fitForandformatStorage.limitsExceeded/selectionForUsageare unchanged.components/plan-fit-notice.tsx(new): the "What changes with Starter" block. It shows the lines, a "See which ones" disclosure with the keep/pause lists and their calls in 30 days, and "Choose Team instead". When Team fits, it shows one quiet line instead. It sendsplan_fit_shown(once per plan) andplan_fit_details_opened, both added topaywall-tracking.ts.plan-picker.tsx(under the selected plan),license-wall.tsx(ended-trial wall,source: trial_ended_wall),start-trial/page.tsx(card-trial checkout) andreactivate/[token]/page.tsx. On the reactivation page there are no names, only counts ("…You choose which ones after signing in."), worded in the page's 7 languages (copy.ts,PLAN_FIT_COPY).trial-banner.tsx: now reads "Your trial includes everything in Team." In the last 3 days, if the workspace does not fit Starter (plan-fit is fetched only then), it adds "Above Starter: see what changes", which opens the block in a dialog. The old "Keep your N connectors running." clause was removed to keep the banner short.components/plan-usage-meters.tsx, new): meters for connectors, MCP servers, users, File Search folders, files and storage, saved code tools and code runs this month, plus an inline-code line. They are built from the plan fit of the plan in use (a trial uses Team's limits). During a trial there is also a "See what changes with Starter" disclosure.components/plan-swap-dialog.tsx, new):usage.pausedByPlan.usage.calls30dfor MCP servers), with the least used preselected. Actions are "Pause and activate" and "Upgrade to Team" (useManagePlan), or Enterprise past Team. If activation fails, the paused item is turned back on.PLAN_LIMITand also, client-side, when usage shows the cap is reached. The client-side check only applies once the server reportspausedByPlan. Before that, caps are advisory and the client must not refuse what the server accepts.PLAN_LIMITon create / invite:PlanLimitNotice("Your plan includes N … Pause one or upgrade", where "Pause one" opens the swap dialog in create mode). It is shown on connectors/new, connectors/setup/[slug], the MCP server create form and Settings → Users invitations (axis: 'users').usage-banner.tsx: when items are paused, it says e.g. "1 connector is paused by your plan. Switch which ones are active, or upgrade to Team."planFit,planSwapandplanUsagenamespaces in en/de/it. The files that were English-only (plan picker, banners, licence wall body) stay English-only.Cloud vs self-hosted
Everything here is Cloud only. Plan-fit answers 404 on self-hosted,
usePlanFit/usePlanUsagedo not call it off Cloud,pausedByPlanis never present, and noPLAN_LIMITis returned. Self-hosted shows nothing new. Any surface degrades to today's UI when the endpoint is missing or fails (covered by a smoke test).Type
Testing
tests/e2e/plan-fit.spec.ts, rendered with the realen.jsonand every reactivation-page language)New spec
packages/frontend/tests/e2e/plan-fit.spec.ts(12 tests):Commands (all in
packages/frontend, afternpm ciat the root):npm run lintnpx tsc --noEmit -p tsconfig.jsonnpx playwright test tests/e2e/plan-fit.spec.ts --workers=1npx playwright test --workers=1(full suite)Backend not touched; backend tests not run for this PR.
Checklist
npm test)Notes on the API contract
PUT /api/mcp-servers/:id(not PATCH); the client uses PUT.GET /api/license/plan-fitdoes not check the role (the plan says ADMIN); the UI only asks for it in admin flows (wall, card trial, banner for trial admins) and on Settings → License, which is admin-only.teamreports 5,000. The meter shows runs without a max during a trial. AcardTrialflag or the trial's own run cap in plan-fit would let it show the real cap.fileSearchConnectorsPLAN_LIMITis handled by swapping among File Search folders.pausedByPlan.connectorscovering File Search folders works with the same badge.Related Issues
Stacked on #1601.