Skip to content

fix(web): let an org with no plan link itself to the org that pays - #1958

Closed
Makisuo wants to merge 1 commit into
mainfrom
fix/billing-link-without-plan
Closed

Makisuo wants to merge 1 commit into
mainfrom
fix/billing-link-without-plan

Conversation

@Makisuo

@Makisuo Makisuo commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Linking an org to a billing org (#1935) happens on the member org's Settings → Billing page. But an org with no plan is redirected to the plan picker on every route except onboarding, so it can never reach that page. Every real member org is in that state.

Change

  • The plan gate lets /settings?tab=billing render without a plan. Other settings tabs still go to the plan picker.
  • The plan picker (onboarding step and /select-plan) shows "Billed through another organization? Link it in billing settings" under the pricing cards.

Tests

  • plan-gate.test.ts: a plan-less org reaches billing settings (no redirect, no splash) while other settings tabs still redirect.
  • Onboarding tests (93) and the web typecheck pass.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • New Features
    • Added a link to billing settings for organizations billed through another organization, shown during plan selection and team onboarding.
  • Bug Fixes
    • Organizations without a plan can now access billing settings without being redirected or shown a loading splash. Other settings routes remain subject to plan requirements.

…lf to the org that pays

The plan gate sent every route but onboarding to the plan picker, so an org with no plan never saw "Bill through another organization". Billing settings now renders without a plan, and the plan picker links to it.
@maple-review-bot

maple-review-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 9/10 · safe to merge
A two-line route exemption in the plan gate, pinned by a new plan-gate test; only the new link copy itself is untested.
no findings · tests partial −1 · risk medium

Lets an org with no plan open Settings → Billing through the plan gate, and points both plan pickers at that page with a "billed through another organization" link. The exemption is narrow and tested; safe to merge.

  • isAllowedWithoutPlan exempts Settings with tab=billing from the plan redirect
  • billThroughAnotherOrgLink adds the billing-settings link under both plan pickers
What was checked
  • Exemption is keyed on _tag === "Settings" && tab === "billing"; every other settings tab still redirects (plan-gate.ts:74)
  • The billing tab is visible to any Clerk viewer (page/settings/nav.ts:103), so syncTab does not rewrite the URL and bounce the org back to /settings
  • followRedirects reads the gate off model.route (update.ts:676), so the query-string tab the exemption keys on is the one the user navigated to

124a68f · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Walkthrough

Organizations without a plan can access billing settings. The Quick Start and Select Plan views now include a link to billing settings.

Changes: Plan-free billing access

Layer / File(s) Summary
Allow billing settings without a plan
apps/web/src/page/onboarding/plan-gate.ts, apps/web/src/page/onboarding/plan-gate.test.ts
The no-plan route gate allows the billing settings tab. Tests check that billing settings do not redirect or show the loading splash, while the members settings route redirects.
Render billing links in plan views
apps/web/src/page/onboarding/bill-through-link.ts, apps/web/src/page/onboarding/quick-start-team-view.ts, apps/web/src/page/onboarding/select-plan.ts
A shared helper renders a link to billing settings. Both plan views render the link after their pricing content.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: jeremyfunk

Merge Risk: Minimal · up to 124a6

Organizations without a plan can now reach billing settings to link to the organization that pays, and the plan picker points them there. After linking, access is restored through the refreshed plan state. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: allowing an organization without a plan to link to the organization that pays through billing settings.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 5 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Makisuo

Makisuo commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

Not needed: the plan-less orgs were linked by hand instead.

@Makisuo Makisuo closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant