Repository navigation
feat(demo): show the demo brand in the product and start a plan by buying or a free trial (demo brand, part 5) - #1738
Conversation
…e "Choose a plan" dialog
On the cloud, an ended trial, a cancel during the trial and a cancel
after the first payment can now sign in and look around. They used to
see a full-screen "subscription expired" notice that only signed out.
Onboarding is unchanged: an admin who never started a trial still goes
to the plan step.
- The dashboard layout lets these workspaces in, read-only. A thin
banner says so, with "See plans".
- UpgradeDialogProvider and useUpgradeGate ({ guard, isLocked,
openUpgrade }) open one "Choose a plan to keep going" dialog, with the
action that was clicked as a label.
- Admins go to Billing; members are told to ask their admin.
- A failed payment (past_due, unpaid) says so and opens Stripe's
portal.
- A 402 subscription_inactive from the API opens the dialog
(use-failure-toast, api-failure's subscription class, and the
Webflow, catalog, publish and Send to CMS clients).
- Automatic calls (Library's Webflow status, the editor's link, source,
claim and page reads, Improve's read) aren't sent while locked.
- Billing: an ended subscription starts a new Checkout ("Choose
{plan}", monthly or annual). The checkout route takes admins only,
refuses a second live subscription (409), and validates its body.
Billing reads again after a change.
- MCP: list_ and get_ tools stay open; every other tool, and REST
writes, answer subscription_inactive. Chat and new conversations
answer 402, and runSiteAuditFor, generateBriefFor and
createImproveActionFor check too. A chat message refused by a 402
goes back to the input.
Self-hosted is unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r Annual and a promo code
The "Choose a plan to keep going" dialog for an ended plan now carries
the plans, as the approved design has them.
- Starter and Growth (Popular) have "Choose {plan}"; Custom has "Starting
at $499/mo" and "Contact us". Each lists the Billing cards' features,
through a shared usePlanFeatures.
- Monthly or Annual ("Save 20%"): an annual price shows its struck 12×
price and what it is a month.
- A promo code is checked by the API (POST /api/stripe/promo-code, admins
only), through the same Stripe lookup ansvisor#1300 uses (findPromotionCode,
takesPromoCode: monthly plans only).
- A valid code shows its chip, the first month's price on each card and
in the button ("Choose Growth · $124.50 today").
- A bad one says so; on Annual a note offers Switch to Monthly.
- Choose opens Stripe Checkout for that plan and period, with the code
applied as a discount. The checkout route checks the code again and
refuses it on an annual plan.
- Members see "Ask your admin to choose a plan", with no code field.
- The footer reads "Prices in USD." with a link to the pricing page.
- A failed payment keeps its "Update payment method" dialog.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g does after ansvisor#1598 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the plan has ended
Read-only, part C1. On an ended plan, every action in Prompts, Prompt
Suggestions, Topics, Query Fan-out, Brand Visibility and Competitors
opens the "Choose a plan" dialog with the action named, and runs
nothing. On an active plan they run as before. Buttons aren't disabled.
- Tracked Prompts: add, import, edit, analyze and refresh volumes, the
bulk bar, work status and the row menu.
- Prompt and topic suggestions: generate, add, accept, dismiss.
- Manage prompts and topics: add, generate, locations, analyze, edit,
delete.
- Query Fan-out's Track; Brand Visibility's Run All, Test Single Prompt,
Opportunities' Track and Send, and pinning a competitor.
- Competitors: suggest (its dialog calls AI on opening), add, delete.
- The Positions panel: Improve's Generate and Regenerate, Send Actions,
and Create or Optimize content.
- The labels live in readOnly.actions.* ("Adding prompts needs a plan").
- volumes.ts tells the API's 402 subscription_inactive from a feature
the plan lacks, so a refused analysis opens the dialog instead of "not
part of your current plan".
- While locked, Tracked Prompts doesn't warn that volume data is
unavailable, and Query Fan-out doesn't send its intent classification.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…keep the editor read-only, while the plan has ended
Read-only, part C2. On an ended plan, every action that writes or costs
in Content Opportunities, the opportunity panel, Content Plan, Library,
New content and the Content Editor opens the "Choose a plan" dialog,
naming the action, and runs nothing.
- Opportunities: New, the bulk bar (send, done, dismiss and delete open
the dialog instead of their confirm), the row menu, the webhook
settings' Test and Save, and the panel's sends, brief, Reviewed,
Restore and Dismiss.
- Plan: New content, Start, Assign, Priority, Hide and Show. A ?start=
link starts nothing while locked.
- Library: New content (and ?new=1), status changes, archive, delete,
and single and bulk Send to CMS.
- The editor:
- Run Agent, Rewrite, Fix rules, hand-off;
- accepting or rejecting suggestions;
- Mark ready, Ready back to review, Mark published, Send to CMS,
History Restore;
- page and site type, author and reviewer;
- Quality's confirms, sources and images, and Add line or Remove;
- renaming, dropping files, the toolbar;
- the Brief's run, rewrite and edit; the Sources and Rules changes;
Your input.
- The editor itself is read-only while locked (editable: false, the
HTML view readOnly), and autosave is off (useDraftAutosave { off }):
nothing is saved, and leaving doesn't warn.
- Reading, filters, exports, Copy HTML and Stop stay open.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d from every way to add a brand, while the plan has ended Site Audit, Action Center, Mentions, Citations, AI Referral Traffic, Shopping, Reports, Chat, brand settings and Settings now guard their actions with useUpgradeGate, as Prompts (ansvisor#1606) and Content (ansvisor#1609) do. Every way to add a brand (sidebar, /dashboard/brands, brand guard, /dashboard/brands/new) opens the dialog. Disconnects, key revokes and API key creation stay open. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…has ended, on the server Server actions and Next routes that write to Supabase without going through the API now call assertWritable() first: on the cloud, an organization without an active plan gets SubscriptionInactiveError (routes: 402 subscription_inactive), so the read-only rule holds even if a guarded button is bypassed. Setup's writes stay open to an organization that never subscribed, as the API's onboarding routes do. Profile, invitations accepted, revokes, removals, API keys and billing stay open. A static test pins every writing action to the check or to the open list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ng stores open while read-only, and stop the site trust card's automatic re-read From the pre-push review: ending an access stays open, as disconnects do; a partial site trust result isn't re-read while the plan has ended, since that read scrapes. Adds tests for the audit page's Run audit and the integrations' property mapping, resets shared mocks between tests, closes the mobile menu before the dialog, and words the KPI preview for a read-only workspace. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…it too, while read-only At the limit, /dashboard/brands' Add Brand links to Billing; a read-only workspace now gets the dialog there as on every other way to add a brand. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ansvisor's decision (2026-10-27): deleting a brand only removes what the person gave us, so it stays open while the plan has ended. The API opens DELETE /brands/:id in ansvisor#1611. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d the plan in one query, and pin the write check's place From the pre-push review: markBrandAsEcommerce no longer goes through the strictly guarded setBrandShoppingMode (a shared applyShoppingMode does the writes), so a setup detected as e-commerce turns Shopping on again. assertWritable reads the profile and its organization in one query. The coverage test now requires the check as each writer's first await, sees writers kept in variables and signed upload URLs, refuses a setup-open function that reaches a strictly guarded one, and keeps brand deletion open (Ansvisor, 2026-10-27). main's saveDraftShoppingPath is guarded; catalog-client's every-code test leaves out 'subscription', which opens the plan dialog instead of a message. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… plan has ended, and keep the buttons opening the plan dialog With ansvisor#1611, an ended workspace's quota reads come back as `noPlan` with 0 limits. isNoPlan(quota, isLocked) keeps those from reading as used up: Site Audit, Prompts, the content usage card, Improve and the opportunity panel say "No active plan" instead of a red 0/0 or "limit reached", and their buttons stay clickable so the guard opens the dialog. The AI bot report shows the workspace's own data instead of the Starter upsell. Setup's suggestions name the onboarding daily limit (429) on their own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…upsell and one lock rule while the plan has ended From the pre-push review: the Prompts row menu still looks up an open content suggestion with no plan; an ended Starter workspace keeps the bot report's upsell (its old plan has no report), read from the plan the web already knows; auditBlock, bulkSuggestBlock and the bot states take isLocked as the pages do; the audit settings and the content usage tooltip don't speak of a plan that renews; setup's prompt step keeps its own "add your own" line. Improve's unreachable no-plan branch is gone. Tests for the onboarding limit and the quota meter. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…essage test main's catalog-client test (ansvisor#1583) asks for words for every StoreError code; 'subscription' opens the upgrade dialog instead of saying one, so the test leaves it out, as ansvisor#1613 does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y-plan-dialog Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # web/src/components/settings/plan-switcher.tsx
…y-guard-prompts Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-guard-content Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-guard-rest Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd main's other new actions while the plan has ended main's new writes, with C3's guard pattern and labels: - Merchant Center (ansvisor#1583): picking and adding an account open the plan dialog ("Connecting a store needs a plan"); the server's 'subscription' refusal on Add opens it too, instead of looking up a missing settings.catalog.stores.errors.subscription message. - Category pages (ansvisor#1587): Change, Save, No page and Use the match are guarded; the catalog client reads the server's 402 subscription_inactive as 'subscription', which opens the dialog instead of the generic failure. - Brief › Shopping path (ansvisor#1591): Pick from the catalog, Pick again, Add product, Lock, Swap and Remove are guarded. - Action Center Check now (AC-010, ansvisor#1565) is guarded. New labels: changeCategoryPages, changeShoppingPath, checkTasks. Insert › Products (ansvisor#1607) already goes through the toolbar's guard and the read-only editor shows no insert menu; a test now says so. The Shopping rules (ansvisor#1610) change through the rules hook, already guarded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-plan-display Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g it during render React's refs rule refuses passing add, which reads addingRef, to guard while rendering. add now opens the plan dialog itself on a read-only workspace. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-plan-display Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y-direct-writes Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/prompts/page.test.tsx
…ver main's new tables sweepPromptDemand chose brands by their organization's plan only, so an active workspace's demo brand would have had its sample prompts read and DataForSEO's paid tasks set for them. It now leaves demo brands out, as the other sweeps do. The demo coverage list names the two brand tables main added: prompt_table_views (skipped: the demo starts on the default columns) and prompt_demand (pending a demo follow-up). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lumn layouts open Main added write routes that name a brand: Action Center's audits and products, WordPress and Framer connections, and their publish-status checks. Each now answers 402 demo_brand on a demo brand, as the Webflow ones do. The Tracked Prompts column layouts (prompt_table_views, 00363) stay writable on a demo brand: they change no sample data and cost nothing, and the web keeps them open while read-only too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # web/messages/en.json # web/src/app/[locale]/(dashboard)/dashboard/agent/page.test.tsx # web/src/app/[locale]/(dashboard)/dashboard/agent/page.tsx # web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.tsx # web/src/app/[locale]/(dashboard)/dashboard/brands/page.test.tsx # web/src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.tsx # web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsx # web/src/app/[locale]/(dashboard)/dashboard/content/library/page.tsx # web/src/app/[locale]/(dashboard)/dashboard/prompts/_suggestions-card.test.tsx # web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx # web/src/app/[locale]/(dashboard)/layout.test.tsx # web/src/app/[locale]/(dashboard)/layout.tsx # web/src/app/[locale]/(onboarding)/dashboard/onboarding/page.test.tsx # web/src/app/[locale]/(onboarding)/dashboard/onboarding/page.tsx # web/src/app/api/stripe/checkout/route.test.ts # web/src/app/api/stripe/checkout/route.ts # web/src/components/action-center/action-drawer.test.tsx # web/src/components/action-center/action-drawer.tsx # web/src/components/action-center/action-table.tsx # web/src/components/billing/choose-plan-dialog.test.tsx # web/src/components/billing/choose-plan-dialog.tsx # web/src/components/billing/read-only-banner.test.tsx # web/src/components/billing/read-only-banner.tsx # web/src/components/content/send-to-cms-dialog.tsx # web/src/components/dashboard/add-brand-link.test.tsx # web/src/components/layout/brand-switcher.test.tsx # web/src/components/layout/brand-switcher.tsx # web/src/components/providers/plan-provider.tsx # web/src/components/providers/upgrade-dialog-provider.test.tsx # web/src/components/providers/upgrade-dialog-provider.tsx # web/src/components/providers/upgrade-gate.ts # web/src/components/settings/billing-section.tsx # web/src/components/settings/integrations-section.test.tsx # web/src/components/settings/integrations-section.tsx # web/src/components/settings/plan-switcher.test.tsx # web/src/components/settings/plan-switcher.tsx # web/src/components/settings/webflow-card.tsx # web/src/lib/actions/action-center.ts # web/src/lib/actions/action-task-reviews.ts # web/src/lib/actions/brand-domain.ts # web/src/lib/actions/brand-platform.ts # web/src/lib/actions/brand.ts # web/src/lib/actions/catalog.ts # web/src/lib/actions/competitor.ts # web/src/lib/actions/content-authors.ts # web/src/lib/actions/content-drafts.ts # web/src/lib/actions/content-plan.ts # web/src/lib/actions/content-settings.ts # web/src/lib/actions/content.ts # web/src/lib/actions/getting-started.ts # web/src/lib/actions/integrations.ts # web/src/lib/actions/kpis.ts # web/src/lib/actions/prompt-suggestions.ts # web/src/lib/actions/prompt.ts # web/src/lib/actions/read-only.test.ts # web/src/lib/actions/reports.ts # web/src/lib/actions/shopping-openai-index.ts # web/src/lib/actions/signals.ts # web/src/lib/api-failure.test.ts # web/src/lib/api-failure.ts # web/src/lib/billing/plan-purchase.test.ts # web/src/lib/billing/subscription-access.test.ts # web/src/lib/billing/subscription-access.ts # web/src/lib/mcp/server.ts # web/src/lib/mcp/subscription-gate.test.ts # web/src/lib/subscription-guard-coverage.test.ts # web/src/lib/subscription-guard.test.ts # web/src/lib/subscription-guard.ts
The preview reads the app's .dark class from its parent page and follows it live; standalone it follows the system setting. Its colours moved to variables with a dark palette close to the app's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ck comes first Merging main left createTopics, createTopic and updateTopic with two plan checks each: main's, moved ahead of the name check, and the demo's, which hands the brand over. Each now checks once, first, with its brand where it has one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…page ⌘ or Ctrl with ⇧O (new chat), K (search), J (side panel) or \ (menu) reach the preview while the app around it has the focus: the page hands them to the frame, which answers them as it does inside. The frame takes the focus when it opens, and on a Mac the preview shows ⌘ for Ctrl. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…core # Conflicts: # server/src/lib/action-center/execution/run.js # server/src/lib/action-center/execution/run.test.js # supabase/schema.sql
…n's new tables sweepCompetitorTimeline (learning C3, on main) chose brands by their organization's plan only, so a demo brand's sample answers would have had their cited pages read every night. It now leaves demo brands out, as the other sweeps do. The demo coverage list names the brand tables main added: cited_page_features, competitor_page_events and competitor_timeline_scans (pending a demo follow-up) and chat_conversations (with Chat). Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # supabase/schema.sql
Chat's precedence (ansvisor#1776) left readBrandIsDemo false until the demo chain added brands.is_demo, with a type check that stops compiling once the column exists. It now reads the column, as the server's demo guard does, so a tool that changes or spends on the demo brand is refused with demo_brand; a brand that isn't found isn't one, and a failed read throws. Co-Authored-By: Claude Opus 5.5 <[email protected]>
POST /brands/:id/detect-site-type (ansvisor#1761, on main) reads the brand's home page and may ask AI for its kind. The demo guard's coverage test fails on a write route in neither list, so it is now guarded by the brand in its path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
chat_user_prefs (00400) and chat_auto_choices (00401) are a person's own rows, not a brand's: the write guard's coverage test fails on a writable table in no list, so both are named as no brand's rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # web/src/lib/actions/brand.ts # web/src/lib/actions/prompt.test.ts # web/src/lib/actions/prompt.ts # web/src/lib/subscription-guard.ts
|
Merged main forward through #1737's updated branch (conflicts in Typecheck and the conflicted files' tests pass (plus |
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good, with follow-ups: the demo opens read-only for a workspace without a plan, and a plan still starts only through Stripe Checkout. Nothing here grants one. This part changes nothing I'd block on. take-1738 (35f11f56) is this head with take-1737 merged in (part 4's fixes), so later parts carry them. Merging with main needs four conflicts resolved (below).
What I checked:
- Starting a plan. One caller is left:
useStartCheckout→POST /api/stripe/checkout. Its newmode(buy|trial) is required.- The trial goes only to an organization with no
stripe_subscription_idwhose Stripe customer never had a subscription (hasUsedTrial), else 409trial_unavailable. - A code with the trial is refused (
promo_with_trial). - Both modes take a card (
payment_method_collection: 'always'). - The first-month code is looked up in Stripe again, not taken from the client. If Stripe no longer takes it, the plan opens at its price with Checkout's own code box.
- The organization is still checked against the caller, admins only, and never beside a live subscription.
- The plan itself is written only by the webhook and the success route, from Stripe's subscription, as before.
- The trial goes only to an organization with no
- The demo's plan.
effectivePlanForBrandraises Starter to Growth on the demo brand only for what's read: the plan context, the Positions column's engines. Every write still goes throughassertWritable({ brandId }), which refuses the demo brand withDemoBrandErrorwhatever the plan. Behind that are the API's guard and 00381. - A workspace that never subscribed. With a demo brand, its admin gets
read_onlyinstead of the redirect to the plan step (evaluateSubscriptionAccess). Writes stay refused (assertWritablereads the subscription, not the plan;toPlanIdmapsfreeto Starter for limits only). - Hiding.
hideDemoBrandAfterPurchaseruns only oncheckout.session.completedand the success route, only for an active or trialing subscription, and only on a demo brand still shown. It never deletes it, and it never throws into the purchase. The layout leaves a hidden demo brand out of the brand list. - Sign-up.
wantsDemoAheadbuilds the demo ahead only for an admin of an organization without a plan and without a demo brand. Anything it can't read says no. - Server actions. Those that write with the service role (
startDraftFromAction) passbrandIdtoassertWritable. The rest write as the person, so 00381 refuses them in the database. - Embeds. One new one,
profiles → organizations!profiles_organization_id_fkey(hinted; two FKs). The rest are plain column reads. - Tests. On
take-1738, the web tests in every area this PR touches pass: 168 files, 1,305 tests.tscis clean.
Merge (with main 3b7611c): conflicts in
web/src/lib/actions/brand.ts: keep main'ssiteTypein the return type and this PR'sassertWritable({ onboarding: true, brandId }).web/src/lib/actions/prompt.tsandprompt.test.ts: main now reads the plan through the brand's embed. Keep it and addis_demo:.select(\organization_id, is_demo, organizations!brands_organization_id_fkey(${ORG_PLAN_COLUMNS})`), theneffectivePlanForBrand(planFromOrgRow(org ?? null), brand.is_demo === true). KeepgetOrgPlanand add theeffectivePlanForBrandimport. The test mock returns bothis_demoandorganizations`.web/src/lib/subscription-guard.ts: keep both lines (RoleRequiredErrorandDemoBrandError).- Plus
run.js/run.test.js/schema.sqlfrom the earlier parts.
Resolved that way, tsc and the web tests above pass on the merged tree, except two checks that main pins on purpose. chat/precedence-context.test.ts stops compiling once brands.is_demo is in the types: wire readBrandIsDemo to it in the same merge (part 1's types). mcp/demo-gate.test.ts is part 6's.
Follow-ups:
- Clients open across the deploy POST to checkout without
modeand get a 400 until they reload. A default ofbuywhenmodeis missing would cover the first hour. - Buy now no longer comes with the trial. A first subscription used to get the 14 days automatically, and now it gets them only by choosing the trial. That's intended in the docs; worth a line in the release note.
- Copy that will age: "Soon (next week)" for Chat in the band, the preview and the docs.
Summary
Demo brand, part 5 of 7 (web). The demo brand in the product: who gets it, how it looks, and how every action on it turns into the plan dialog. It also brings the two ways to start a plan (buy now, or the free trial) to every place a plan starts.
Who gets it
DemoSetupDialog,lib/demo/setup-steps.ts).hasDemoBrandinevaluateSubscriptionAccess).checkout.session.completedand on the return from Checkout, whichever comes first, and only when a subscription starts. Admins and managers show or hide it again from the brand menu.How it looks
POST /api/demoonce whether the demo is current, and refreshes the page if it was rebuilt.effectivePlanIdForBrand). Its locked tabs, engines and reports open. Writes still open the plan dialog. Enterprise and self-hosted keep their own plan.web/public/demo/chat, 820 KB with the logos, in an iframe), with Brewline Coffee as the tracked brand.useUpgradeGate, the same gate as read-only.web/public/demo/logos).Nothing runs on it
useUpgradeGatetreats the demo brand as locked, whatever the plan. Its dialog makes the demo's offer: the free trial or 50% off the first month for a workspace that never subscribed, buying now for one whose plan ended. With a plan active, it points back to the own brand.assertWritable({ brandId }), which refuses a demo brand withDemoBrandError(46 calls in 21 files). The brand and the plan are read in one round trip, with main's namedorganizations!profiles_organization_id_fkeyrelationship.subscription-guard-coverage.test.tsfails on a new brand write that doesn't hand its brand over.demo_brand.api-failurereadsdemo_brandas a plan refusal, so a call no button caught still opens the dialog.Two ways to start a plan, both with a card
components/billing/plan-start.tsx). Onboarding says what is ready to track for the own brand.POST /api/stripe/checkoutnow takesmode: 'buy' | 'trial'. A trial with a promo code is refused (400). A trial for an organization, or a Stripe customer, that already had a subscription is refused too (409trial_unavailable); the client then turns to buying.NEXT_PUBLIC_FIRST_MONTH_OFFER=offturns the offer off everywhere; the code must also be ended in Stripe..env.exampledocuments it.Fixes in this branch
loaded, never persisted). Until then pages show their skeleton and the bands and Add Brand wait. Leaving the dashboard clears it.freeplan reads as Starter (toPlanId).createTopics,createTopicandupdateTopichad two plan checks each; now each has one, first, with its brand (6699a7e).Merge notes (main merged in, nothing on main undone)
MenuAccessProvider, the welcome redirect,visibleNavand the work-areas step. The demo's providers wrap around them. Onboarding's plan step is step 7 (PLAN_STEP) after "What do you work on?".useUpgradeGate,assertWritable,api-failure) instead of adding a second one.Deploy: server first (00380, 00381,
/api/demo), then the web. No migration in this part.Related issue
None (demo brand).
Stacked on #1737 (demo brand, part 4: guard).
Type of change
feat— New featurefix— Bug fix (first-load flash, free plan as Starter, double plan check)How to test
Locally, with parts 1–5, the dev database,
NEXT_PUBLIC_IS_CLOUD=trueand the demo account ([email protected]):For the maintainer (Stripe, test mode): Checkout can't be tried without Stripe keys locally. Please try both modes: Buy now monthly with SAVE50 (does the 50% land on the first invoice?) and the 14-day trial (card taken, no code, $0 today). Then check that the demo brand is hidden after either.
Checklist
yarn typecheckpasses. ESLint on the 261 files the main merge touched: 0 errors (2 warnings, in files identical to main). Prettier: clean.lib/demo,components/billing,providers,settings,layout,lib/mcp,lib/billing, hooks and stores (98 files, 1,083 tests) pass. The Library page test timed out once under load and passes alone (63 tests).🤖 Generated with Claude Code