You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PlanUsageSettings detected hasBetterPlanElsewhere and showed a callout but offered no way to actually switch to the org with the better plan. The page also called client.switchOrganization directly from the renderer, bypassing the main-process auth service.
Changes
Add a "Switch to {org}" button to the hasBetterPlanElsewhere callout
Route every renderer org switch through useSwitchOrgMutation so AuthService.switchOrg is the single canonical path
Refetch the seat with autoProvision: true after the switch so the Pro card reflects the new active org
Show a red error callout when the switch fails, with a ?? "Pro org" fallback when the API omits the org name
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more
The notes analyze plan usage flow, organization switching, and billing link behavior.
Ran code and verified through T-Rex
Comments Outside Diff (1)
apps/code/src/renderer/features/settings/components/sections/PlanUsageSettings.tsx, line 380 (link)
Block duplicate switches
The billing Open button is disabled only when billingUrl is missing, so it can still be clicked while an organization switch is already in flight. That starts another switchOrg mutation while the first one is resetting session state and refreshing auth-scoped queries. Disable the billing buttons while switchOrgMutation.isPending, matching the guard used by the existing project switcher, to avoid concurrent session resets.
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
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.
Problem
PlanUsageSettingsdetectedhasBetterPlanElsewhereand showed a callout but offered no way to actually switch to the org with the better plan. The page also calledclient.switchOrganizationdirectly from the renderer, bypassing the main-process auth service.Changes
hasBetterPlanElsewherecalloutuseSwitchOrgMutationsoAuthService.switchOrgis the single canonical pathautoProvision: trueafter the switch so the Pro card reflects the new active org?? "Pro org"fallback when the API omits the org nameHow did you test this?
manually
Publish to changelog?
no