Skip to content

Commit 37b4702

Browse files
authored
Merge pull request #9008 from continuedev/pe/onboarding
feat: simplify hub onboarding
2 parents 7060687 + e0fa577 commit 37b4702

File tree

14 files changed

+400
-270
lines changed

14 files changed

+400
-270
lines changed

binary/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package-lock.json

Lines changed: 111 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package-lock.json

Lines changed: 67 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/vscode/src/stubs/WorkOsAuthProvider.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,6 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
206206

207207
public static useOnboardingUri: boolean = false;
208208
get redirectUri() {
209-
if (WorkOsAuthProvider.useOnboardingUri) {
210-
const url = new URL(controlPlaneEnv.APP_URL);
211-
url.pathname = `/auth/${env.uriScheme}-redirect`;
212-
return url.toString();
213-
}
214209
return this.ideRedirectUri;
215210
}
216211

gui/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gui/src/components/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const Layout = () => {
154154
dispatch(
155155
setDialogMessage(
156156
<div className="flex-1">
157-
<OnboardingCard isDialog showFreeTrialExceededAlert />
157+
<OnboardingCard isDialog />
158158
</div>,
159159
),
160160
);
Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { OnboardingModes } from "core/protocol/core";
2+
import { useEffect } from "react";
23
import { useAppSelector } from "../../redux/hooks";
34
import { getLocalStorage, setLocalStorage } from "../../util/localStorage";
4-
import Alert from "../gui/Alert";
55
import { ReusableCard } from "../ReusableCard";
6-
import { OnboardingCardLanding } from "./components/OnboardingCardLanding";
76
import { OnboardingCardTabs } from "./components/OnboardingCardTabs";
87
import { OnboardingLocalTab } from "./components/OnboardingLocalTab";
98
import { OnboardingModelsAddOnTab } from "./components/OnboardingModelsAddOnTab";
@@ -17,20 +16,23 @@ export interface OnboardingCardState {
1716

1817
interface OnboardingCardProps {
1918
isDialog?: boolean;
20-
showFreeTrialExceededAlert?: boolean;
2119
}
2220

23-
export function OnboardingCard({
24-
isDialog,
25-
showFreeTrialExceededAlert,
26-
}: OnboardingCardProps) {
21+
export function OnboardingCard({ isDialog }: OnboardingCardProps) {
2722
const { activeTab, close, setActiveTab } = useOnboardingCard();
2823
const config = useAppSelector((store) => store.config.config);
2924

3025
if (getLocalStorage("onboardingStatus") === undefined) {
3126
setLocalStorage("onboardingStatus", "Started");
3227
}
3328

29+
// Default to MODELS_ADD_ON tab if no active tab is set
30+
useEffect(() => {
31+
if (!activeTab) {
32+
setActiveTab(OnboardingModes.MODELS_ADD_ON);
33+
}
34+
}, [activeTab, setActiveTab]);
35+
3436
function renderTabContent() {
3537
switch (activeTab) {
3638
case OnboardingModes.API_KEY:
@@ -40,51 +42,21 @@ export function OnboardingCard({
4042
case OnboardingModes.MODELS_ADD_ON:
4143
return <OnboardingModelsAddOnTab />;
4244
default:
43-
return <OnboardingProvidersTab />;
45+
return <OnboardingModelsAddOnTab />;
4446
}
4547
}
4648

47-
if (activeTab) {
48-
return (
49-
<ReusableCard
50-
showCloseButton={!isDialog && !!config.modelsByRole.chat.length}
51-
onClose={close}
52-
testId="onboarding-card"
53-
>
54-
{showFreeTrialExceededAlert && (
55-
<div className="mb-3 mt-4">
56-
<Alert>
57-
<h4 className="mb-1 mt-0 text-sm font-semibold">
58-
Free trial completed
59-
</h4>
60-
<span className="text-xs">
61-
To keep using Continue, select an option below to setup your
62-
models
63-
</span>
64-
</Alert>
65-
</div>
66-
)}
67-
<OnboardingCardTabs
68-
activeTab={activeTab}
69-
onTabClick={setActiveTab}
70-
showFreeTrialExceededAlert
71-
/>
72-
{renderTabContent()}
73-
</ReusableCard>
74-
);
75-
}
49+
// Always show tabs view, defaulting to Models Add-On
50+
const currentTab = activeTab || OnboardingModes.MODELS_ADD_ON;
7651

7752
return (
7853
<ReusableCard
7954
showCloseButton={!isDialog && !!config.modelsByRole.chat.length}
8055
onClose={close}
56+
testId="onboarding-card"
8157
>
82-
<div className="flex h-full w-full items-center justify-center">
83-
<OnboardingCardLanding
84-
onSelectConfigure={() => setActiveTab(OnboardingModes.API_KEY)}
85-
isDialog={isDialog}
86-
/>
87-
</div>
58+
<OnboardingCardTabs activeTab={currentTab} onTabClick={setActiveTab} />
59+
{renderTabContent()}
8860
</ReusableCard>
8961
);
9062
}

gui/src/components/OnboardingCard/components/OnboardingCardLanding.tsx

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useContext } from "react";
22
import { Button, SecondaryButton } from "../..";
33
import { useAuth } from "../../../context/Auth";
44
import { IdeMessengerContext } from "../../../context/IdeMessenger";
5-
import { useCreditStatus } from "../../../hooks/useCredits";
65
import { useAppDispatch, useAppSelector } from "../../../redux/hooks";
76
import { selectCurrentOrg } from "../../../redux/slices/profilesSlice";
87
import { selectFirstHubProfile } from "../../../redux/thunks/selectFirstHubProfile";
@@ -45,55 +44,22 @@ export function OnboardingCardLanding({
4544
onboardingCard.close(isDialog);
4645
}
4746

48-
function openApiKeysPage() {
49-
ideMessenger.post("controlPlane/openUrl", {
50-
path: "setup-models/api-keys",
51-
orgSlug: currentOrg?.slug,
52-
});
53-
onboardingCard.close(isDialog);
54-
}
55-
56-
const { creditStatus, outOfStarterCredits } = useCreditStatus();
57-
5847
return (
5948
<div className="xs:px-0 flex w-full max-w-full flex-col items-center justify-center px-4 text-center">
6049
<div className="xs:flex hidden">
6150
<ContinueLogo height={75} />
6251
</div>
6352

64-
{outOfStarterCredits ? (
65-
<>
66-
<p className="xs:w-3/4 w-full text-sm">
67-
You've used all your starter credits! Click below to purchase
68-
credits or configure API keys
69-
</p>
70-
<SecondaryButton
71-
onClick={openApiKeysPage}
72-
className="mt-4 grid w-full grid-flow-col items-center gap-2"
73-
>
74-
Set up API keys
75-
</SecondaryButton>
76-
<Button
77-
onClick={openBillingPage}
78-
className="mt-4 grid w-full grid-flow-col items-center gap-2"
79-
>
80-
Purchase credits
81-
</Button>
82-
</>
83-
) : (
84-
<>
85-
<p className="mb-5 mt-0 w-full text-sm">
86-
Log in to get up and running with starter credits
87-
</p>
53+
<p className="mb-5 mt-0 w-full text-sm">
54+
Log in to Continue Hub to get started with AI-powered coding
55+
</p>
8856

89-
<Button
90-
onClick={onGetStarted}
91-
className="mt-4 grid w-full grid-flow-col items-center gap-2"
92-
>
93-
Log in to Continue Hub
94-
</Button>
95-
</>
96-
)}
57+
<Button
58+
onClick={onGetStarted}
59+
className="mt-4 grid w-full grid-flow-col items-center gap-2"
60+
>
61+
Log in to Continue Hub
62+
</Button>
9763

9864
<SecondaryButton onClick={onSelectConfigure} className="w-full">
9965
Or, configure your own models

gui/src/components/OnboardingCard/components/OnboardingCardTabs.tsx

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import OllamaLogo from "../../svg/OllamaLogo";
66
interface OnboardingCardTabsProps {
77
activeTab: OnboardingModes;
88
onTabClick: (tabName: OnboardingModes) => void;
9-
showFreeTrialExceededAlert?: boolean;
109
}
1110

1211
const renderTabButton = (
@@ -68,27 +67,13 @@ const renderTabButton = (
6867
export function OnboardingCardTabs({
6968
activeTab,
7069
onTabClick,
71-
showFreeTrialExceededAlert,
7270
}: OnboardingCardTabsProps) {
73-
/**
74-
* When users initially install, we only render these tabs after they've
75-
* declined the free trial, so we show the upgrade tab last since they've
76-
* indicated they want don't want to use the Hub.
77-
*
78-
* If `showFreeTrialExceededAlert` is true, they've used the Hub, so show
79-
* upgrade first.
80-
*/
81-
const tabs = showFreeTrialExceededAlert
82-
? [
83-
OnboardingModes.MODELS_ADD_ON,
84-
OnboardingModes.API_KEY,
85-
OnboardingModes.LOCAL,
86-
]
87-
: [
88-
OnboardingModes.API_KEY,
89-
OnboardingModes.LOCAL,
90-
OnboardingModes.MODELS_ADD_ON,
91-
];
71+
// Show Models Add-On (Credits) first as the primary option
72+
const tabs = [
73+
OnboardingModes.MODELS_ADD_ON,
74+
OnboardingModes.API_KEY,
75+
OnboardingModes.LOCAL,
76+
];
9277
return (
9378
<div>
9479
<div className="hidden sm:block">

0 commit comments

Comments
 (0)