diff --git a/gui/src/components/OnboardingCard/platform/tabs/main.tsx b/gui/src/components/OnboardingCard/platform/tabs/main.tsx index f6a14cb93..50e7c99c4 100644 --- a/gui/src/components/OnboardingCard/platform/tabs/main.tsx +++ b/gui/src/components/OnboardingCard/platform/tabs/main.tsx @@ -3,12 +3,16 @@ import { Button, ButtonSubtext } from "../../.."; import { useAuth } from "../../../../context/Auth"; import ContinueLogo from "../../../gui/ContinueLogo"; import { useOnboardingCard } from "../../hooks"; +import { hasPassedFTL } from "../../../../util/freeTrial"; +import { useContext } from "react"; +import { IdeMessengerContext } from "../../../../context/IdeMessenger"; export default function MainTab({ onRemainLocal, }: { onRemainLocal: () => void; }) { + const ideMessenger = useContext(IdeMessengerContext); const onboardingCard = useOnboardingCard(); const auth = useAuth(); @@ -20,30 +24,53 @@ export default function MainTab({ }); } + function openPastFreeTrialOnboarding() { + // NATE TODO - add custom onboarding process handling here + ideMessenger.post("openUrl", "app.continue.dev/onboard?freeTrialStatus=1"); + } + + const pastFreeTrialLimit = hasPassedFTL(); + return (
-

- Log in to quickly build your first custom AI code assistant -

+ {pastFreeTrialLimit ? ( + <> +

+ You've reached the free trial limit. Visit the Continue Platform to + select a Coding Assistant. +

+ + + ) : ( + <> +

+ Log in to quickly build your first custom AI code assistant +

-
- - -
- Or, remain local - -
-
-
+ + + )} + + +
+ Or, remain local + +
+
); } diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 5c3a18c9a..51d06ad7a 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -257,14 +257,23 @@ export function Chat() { posthog?.capture("ftc_reached"); } if (newCount >= FREE_TRIAL_LIMIT_REQUESTS) { + // Show this message whether using platform or not + // So that something happens if in new chat + ideMessenger.ide.showToast( + "error", + "You've reached the free trial limit. Please configure a model to continue.", + ); + // Card in chat will only show if no history - onboardingCard.open("Quickstart"); + // Also, note that platform card ignore the "Best", always opens to main tab + onboardingCard.open("Best"); // If history, show the dialog, which will automatically close if there is not history if (history.length) { dispatch(setDialogMessage()); dispatch(setShowDialog(true)); } + return; } }