Skip to content

Conversation

sestinj
Copy link
Contributor

@sestinj sestinj commented Sep 25, 2025

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

    • Credit status endpoint and client: controlPlane/getCreditStatus → ide/credits with CreditStatus fields.
    • Starter credits UI: new button and hook to view usage, refresh, and go to billing/API keys.
    • Out-of-credits handling in chat: detects zero credits and shows an OutOfCreditsDialog.
    • CLI onboarding now links to settings/billing.
  • Refactors

    • Renamed usesFreeTrialApiKey to usesCreditsBasedApiKey and updated tests.
    • Protocol changes: replaced getFreeTrialStatus; removed getModelsAddOnUpgradeUrl.
    • Removed free-trial components and local storage (FreeTrialButton, progress bar, ModelsAddOnLimitDialog, ftc).
    • Updated onboarding copy and routes; “Upgrade” tab is now “Credits”.

@sestinj sestinj requested a review from a team as a code owner September 25, 2025 03:10
@sestinj sestinj requested review from RomneyDa and removed request for a team September 25, 2025 03:10
@sestinj sestinj marked this pull request as draft September 25, 2025 03:10
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Sep 25, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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 &quot;settings/billing&quot; conflicts with tests expecting &quot;setup-models&quot;; 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",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 25, 2025

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)[] =
     &quot;controlPlane/getEnvironment&quot;,
-    &quot;controlPlane/getFreeTrialStatus&quot;,
-    &quot;controlPlane/getModelsAddOnUpgradeUrl&quot;,
+    &quot;controlPlane/getCreditStatus&quot;,
     &quot;controlPlane/openUrl&quot;,
     &quot;isItemTooBig&quot;,
</file context>
Fix with Cubic

<SecondaryButton
className="flex flex-row items-center gap-2 hover:opacity-70"
onClick={() => {
ideMessenger.post("controlPlane/openUrl", {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 25, 2025

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 @@
+          &lt;SecondaryButton
+            className=&quot;flex flex-row items-center gap-2 hover:opacity-70&quot;
+            onClick={() =&gt; {
+              ideMessenger.post(&quot;controlPlane/openUrl&quot;, {
+                path: &quot;/settings/billing&quot;,
+              });
</file context>
Fix with Cubic

@sestinj sestinj marked this pull request as ready for review October 11, 2025 04:46
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 26 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="gui/src/components/StarterCreditsButton.tsx">

<violation number="1" location="gui/src/components/StarterCreditsButton.tsx:58">
The &quot;Starter credits usage&quot; bar is driven by the remaining balance (`creditBalance`), so users see 100% usage when their balance is full and 0% when it is depleted. Please compute usage as total minus balance before passing it to the progress bar.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

return (
<ProgressBar
label="Starter credits usage"
current={creditStatus.creditBalance ?? 0}
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Starter credits usage" bar is driven by the remaining balance (creditBalance), so users see 100% usage when their balance is full and 0% when it is depleted. Please compute usage as total minus balance before passing it to the progress bar.

Prompt for AI agents
Address the following comment on gui/src/components/StarterCreditsButton.tsx at line 58:

<comment>The &quot;Starter credits usage&quot; bar is driven by the remaining balance (`creditBalance`), so users see 100% usage when their balance is full and 0% when it is depleted. Please compute usage as total minus balance before passing it to the progress bar.</comment>

<file context>
@@ -0,0 +1,211 @@
+  return (
+    &lt;ProgressBar
+      label=&quot;Starter credits usage&quot;
+      current={creditStatus.creditBalance ?? 0}
+      total={50}
+    /&gt;
</file context>
Fix with Cubic

sestinj and others added 2 commits October 11, 2025 08:59
…ddOnTab.tsx

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…ddOnTab.tsx

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant