Skip to content

Free trial popover #5926

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

Merged
merged 9 commits into from
Jun 2, 2025
Merged

Free trial popover #5926

merged 9 commits into from
Jun 2, 2025

Conversation

sestinj
Copy link
Contributor

@sestinj sestinj commented May 31, 2025

Description

Make it more clear to users that they are using the free trial, and how to proceed past it

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Tests

tbd

Copy link

cubic-dev-ai bot commented May 31, 2025

Your cubic subscription is currently inactive. Please reactivate your subscription to receive AI reviews and use cubic.

Copy link

netlify bot commented May 31, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 2c58a33
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/683e0e50a6731a0008fa3517

@sestinj sestinj marked this pull request as ready for review May 31, 2025 21:41
@sestinj sestinj requested a review from a team as a code owner May 31, 2025 21:41
@sestinj sestinj requested review from Patrick-Erichsen and removed request for a team May 31, 2025 21:41
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label May 31, 2025
@Patrick-Erichsen
Copy link
Collaborator

Patrick-Erichsen commented Jun 2, 2025

It feels like putting this in the notch is both easy to miss and kind of noisy. What about in <Chat /> on new sessions? We could make this less annoying by putting in a collapsible toggle that is expanded by default

image
 <div className="xs:inline hidden">
                  <NewSessionButton
                    onClick={async () => {
                      await dispatch(
                        loadLastSession({
                          saveCurrentSession: true,
                        }),
                      );
                    }}
                    className="flex items-center gap-2"
                  >
                    <ArrowLeftIcon className="h-3 w-3" />
                    <span className="text-xs">Last Session</span>
                  </NewSessionButton>
                  <FreeTrialButton
                    freeTrialStatus={{
                      optedInToFreeTrial: true,
                      chatCount: 1000,
                      autocompleteCount: 1000,
                      chatLimit: 1000,
                      autocompleteLimit: 1000,
                    }}
                  />
                </div>

@Patrick-Erichsen
Copy link
Collaborator

Patrick-Erichsen commented Jun 2, 2025

On the flip side I can also see having it in <Chat /> being noisy in a different way, so if we do keep it in the notch my only feedback is on copy.

You are currently using a free trial the Models Add-On, which allows you to use a variety of frontier models for a flat monthly fee.

Read more about usage limits and what models are included [here](https://hub.continue.dev/pricing).


const { profiles, session, login, selectedProfile, refreshProfiles } =
useAuth();

// If using free trial, show the FreeTrialButton instead
const isUsingFreeTrial = usesFreeTrialApiKey(config);
if (isUsingFreeTrial) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would move this logic into a ternary in the parent component, gui/src/components/mainInput/Lump/LumpToolbar/BlockSettingsTopToolbar.tsx


useEffect(() => {
ideMessenger
.request("controlPlane/getFreeTrialStatus", undefined)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should try to use async/await instead of callback chaining. Assuming this was AI generated code, could be a good rule 👀

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Jun 2, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 2, 2025
@Patrick-Erichsen Patrick-Erichsen merged commit 49a6a07 into main Jun 2, 2025
35 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Jun 2, 2025
@Patrick-Erichsen Patrick-Erichsen deleted the nate/free-trial-assistant-select branch June 2, 2025 21:13
@github-actions github-actions bot locked and limited conversation to collaborators Jun 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants