-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat: rehaul onboarding for updated billing #7965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 issues found across 27 files
Prompt for AI agents (all 6 issues)
Understand the root cause of the following 6 issues and fix them.
<file name="core/protocol/passThrough.ts">
<violation number="1" location="core/protocol/passThrough.ts:86">
New message type requires corresponding IntelliJ ContinueBrowser update; missing mapping may break webview→core pass-through in IntelliJ.</violation>
</file>
<file name="extensions/cli/src/ui/FreeTrialTransitionUI.tsx">
<violation number="1" location="extensions/cli/src/ui/FreeTrialTransitionUI.tsx:179">
Updated URL to "settings/billing" conflicts with tests expecting "setup-models"; update tests or ensure route mapping to avoid failures.</violation>
</file>
<file name="gui/src/pages/gui/OutOfCreditsDialog.tsx">
<violation number="1" location="gui/src/pages/gui/OutOfCreditsDialog.tsx:22">
Use ideMessenger.request for controlPlane/openUrl and include orgSlug: undefined per project rules to ensure consistent behavior and org scoping.</violation>
</file>
<file name="gui/src/components/StarterCreditsButton.tsx">
<violation number="1" location="gui/src/components/StarterCreditsButton.tsx:59">
Progress bar uses inconsistent currency units (total=50 while values are treated as cents), causing incorrect display and percentage.</violation>
</file>
<file name="gui/src/components/OnboardingCard/components/OnboardingModelsAddOnTab.tsx">
<violation number="1" location="gui/src/components/OnboardingCard/components/OnboardingModelsAddOnTab.tsx:35">
Use ideMessenger.request for controlPlane/openUrl per project rule; replace post with await request to ensure consistency and reliable handling.</violation>
<violation number="2" location="gui/src/components/OnboardingCard/components/OnboardingModelsAddOnTab.tsx:50">
Use ideMessenger.request for controlPlane/openUrl instead of post to follow project rules; keep void to intentionally ignore the promise.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
"controlPlane/getEnvironment", | ||
"controlPlane/getFreeTrialStatus", | ||
"controlPlane/getModelsAddOnUpgradeUrl", | ||
"controlPlane/getCreditStatus", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New message type requires corresponding IntelliJ ContinueBrowser update; missing mapping may break webview→core pass-through in IntelliJ.
Prompt for AI agents
Address the following comment on core/protocol/passThrough.ts at line 86:
<comment>New message type requires corresponding IntelliJ ContinueBrowser update; missing mapping may break webview→core pass-through in IntelliJ.</comment>
<file context>
@@ -83,8 +83,7 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] =
"controlPlane/getEnvironment",
- "controlPlane/getFreeTrialStatus",
- "controlPlane/getModelsAddOnUpgradeUrl",
+ "controlPlane/getCreditStatus",
"controlPlane/openUrl",
"isItemTooBig",
</file context>
// Option 1: Open models setup page | ||
setCurrentStep("processing"); | ||
const modelsUrl = new URL("setup-models", env.appUrl).toString(); | ||
const modelsUrl = new URL("settings/billing", env.appUrl).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated URL to "settings/billing" conflicts with tests expecting "setup-models"; update tests or ensure route mapping to avoid failures.
Prompt for AI agents
Address the following comment on extensions/cli/src/ui/FreeTrialTransitionUI.tsx at line 179:
<comment>Updated URL to "settings/billing" conflicts with tests expecting "setup-models"; update tests or ensure route mapping to avoid failures.</comment>
<file context>
@@ -176,7 +176,7 @@ const FreeTrialTransitionUI: React.FC<FreeTrialTransitionUIProps> = ({
// Option 1: Open models setup page
setCurrentStep("processing");
- const modelsUrl = new URL("setup-models", env.appUrl).toString();
+ const modelsUrl = new URL("settings/billing", env.appUrl).toString();
setWasModelsSetup(true); // Track that user went through models setup
</file context>
<SecondaryButton | ||
className="flex flex-row items-center gap-2 hover:opacity-70" | ||
onClick={() => { | ||
ideMessenger.post("controlPlane/openUrl", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ideMessenger.request for controlPlane/openUrl and include orgSlug: undefined per project rules to ensure consistent behavior and org scoping.
Prompt for AI agents
Address the following comment on gui/src/pages/gui/OutOfCreditsDialog.tsx at line 22:
<comment>Use ideMessenger.request for controlPlane/openUrl and include orgSlug: undefined per project rules to ensure consistent behavior and org scoping.</comment>
<file context>
@@ -0,0 +1,34 @@
+ <SecondaryButton
+ className="flex flex-row items-center gap-2 hover:opacity-70"
+ onClick={() => {
+ ideMessenger.post("controlPlane/openUrl", {
+ path: "/settings/billing",
+ });
</file context>
<ProgressBar | ||
label="Starter credits usage" | ||
current={creditStatus.creditBalance ?? 0} | ||
total={50} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Progress bar uses inconsistent currency units (total=50 while values are treated as cents), causing incorrect display and percentage.
Prompt for AI agents
Address the following comment on gui/src/components/StarterCreditsButton.tsx at line 59:
<comment>Progress bar uses inconsistent currency units (total=50 while values are treated as cents), causing incorrect display and percentage.</comment>
<file context>
@@ -0,0 +1,211 @@
+ <ProgressBar
+ label="Starter credits usage"
+ current={creditStatus.creditBalance ?? 0}
+ total={50}
+ />
+ );
</file context>
} | ||
|
||
function openPricingPage() { | ||
void ideMessenger.post("controlPlane/openUrl", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ideMessenger.request for controlPlane/openUrl instead of post to follow project rules; keep void to intentionally ignore the promise.
Prompt for AI agents
Address the following comment on gui/src/components/OnboardingCard/components/OnboardingModelsAddOnTab.tsx at line 50:
<comment>Use ideMessenger.request for controlPlane/openUrl instead of post to follow project rules; keep void to intentionally ignore the promise.</comment>
<file context>
@@ -63,6 +46,12 @@ export function OnboardingModelsAddOnTab() {
}
+ function openPricingPage() {
+ void ideMessenger.post("controlPlane/openUrl", {
+ path: "pricing",
+ });
</file context>
void ideMessenger.post("controlPlane/openUrl", { | |
void ideMessenger.request("controlPlane/openUrl", { |
console.error("Failed to get upgrade URL"); | ||
openPricingPage(); | ||
} | ||
ideMessenger.post("controlPlane/openUrl", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ideMessenger.request for controlPlane/openUrl per project rule; replace post with await request to ensure consistency and reliable handling.
Prompt for AI agents
Address the following comment on gui/src/components/OnboardingCard/components/OnboardingModelsAddOnTab.tsx at line 35:
<comment>Use ideMessenger.request for controlPlane/openUrl per project rule; replace post with await request to ensure consistency and reliable handling.</comment>
<file context>
@@ -30,30 +30,13 @@ export function OnboardingModelsAddOnTab() {
- console.error("Failed to get upgrade URL");
- openPricingPage();
- }
+ ideMessenger.post("controlPlane/openUrl", {
+ path: "settings/billing",
+ });
</file context>
ideMessenger.post("controlPlane/openUrl", { | |
await ideMessenger.request("controlPlane/openUrl", { |
Description
this pr makes language changes necessary for updated billing + makes general improvements to onboarding flows
Summary by cubic
Revamped onboarding to use credits-based billing instead of the free trial. Adds credit status APIs and starter credits UI, updates out-of-credits handling, and removes legacy free-trial flows.
New Features
Refactors