Merge pull request #6573 from continuedev/nate/onboarding-improvements-p1
fix: Onboarding / assistant switcher improvements
This commit is contained in:
commit
6ca9c60e66
7 changed files with 63 additions and 55 deletions
|
|
@ -15,20 +15,34 @@ export class DownloadYamlExtensionCodeLensProvider
|
|||
if (!document.uri.fsPath.includes(".continue")) {
|
||||
return [];
|
||||
}
|
||||
if (this.yamlExtensionDownloaded()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const codeLens: vscode.CodeLens = {
|
||||
const codeLenses: vscode.CodeLens[] = [];
|
||||
|
||||
// Always show documentation link
|
||||
const docCodeLens: vscode.CodeLens = {
|
||||
range: new vscode.Range(0, 0, 0, 0),
|
||||
command: {
|
||||
title: "Download YAML extension for Intellisense",
|
||||
command: "workbench.extensions.installExtension",
|
||||
arguments: ["redhat.vscode-yaml"],
|
||||
title: "📖 View Continue Reference",
|
||||
command: "vscode.open",
|
||||
arguments: [vscode.Uri.parse("https://docs.continue.dev/reference")],
|
||||
},
|
||||
isResolved: true,
|
||||
};
|
||||
codeLenses.push(docCodeLens);
|
||||
|
||||
return [codeLens];
|
||||
if (!this.yamlExtensionDownloaded()) {
|
||||
const codeLens: vscode.CodeLens = {
|
||||
range: new vscode.Range(0, 0, 0, 0),
|
||||
command: {
|
||||
title: "Download YAML extension for Intellisense",
|
||||
command: "workbench.extensions.installExtension",
|
||||
arguments: ["redhat.vscode-yaml"],
|
||||
},
|
||||
isResolved: true,
|
||||
};
|
||||
codeLenses.push(codeLens);
|
||||
}
|
||||
|
||||
return codeLenses;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,14 +20,20 @@ export function AssistantOptions({
|
|||
</div>
|
||||
|
||||
<div className="thin-scrollbar flex max-h-[300px] flex-col overflow-y-auto">
|
||||
{profiles?.map((profile, idx) => (
|
||||
<AssistantOption
|
||||
key={idx}
|
||||
profile={profile}
|
||||
onClick={onClose}
|
||||
selected={profile.id === selectedProfileId}
|
||||
/>
|
||||
))}
|
||||
{profiles?.length === 0 ? (
|
||||
<div className="text-vsc-foreground px-3 py-2 opacity-70">
|
||||
No assistants found
|
||||
</div>
|
||||
) : (
|
||||
profiles?.map((profile, idx) => (
|
||||
<AssistantOption
|
||||
key={idx}
|
||||
profile={profile}
|
||||
onClick={onClose}
|
||||
selected={profile.id === selectedProfileId}
|
||||
/>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { ListboxButton } from "../ui";
|
|||
import { AssistantIcon } from "./AssistantIcon";
|
||||
|
||||
interface SelectedAssistantButtonProps {
|
||||
selectedProfile: ProfileDescription;
|
||||
selectedProfile: ProfileDescription | null;
|
||||
}
|
||||
|
||||
export function SelectedAssistantButton({
|
||||
|
|
@ -25,7 +25,9 @@ export function SelectedAssistantButton({
|
|||
style={{ fontSize: fontSize(-3) }}
|
||||
>
|
||||
<div className="flex flex-row items-center gap-1.5">
|
||||
{configLoading ? (
|
||||
{selectedProfile === null ? (
|
||||
"Create your first assistant"
|
||||
) : configLoading ? (
|
||||
<span className="text-description flex flex-row items-center">
|
||||
<ArrowPathIcon
|
||||
className={cn(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ArrowPathIcon, PlusIcon } from "@heroicons/react/24/outline";
|
||||
import { isOnPremSession } from "core/control-plane/AuthTypes";
|
||||
import { AuthType, isOnPremSession } from "core/control-plane/AuthTypes";
|
||||
import { useContext, useEffect, useRef } from "react";
|
||||
import { useAuth } from "../../context/Auth";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
|
|
@ -98,49 +98,32 @@ export function AssistantAndOrgListbox() {
|
|||
};
|
||||
}, [currentOrg, selectedProfile]);
|
||||
|
||||
if (!selectedProfile) {
|
||||
return (
|
||||
<div
|
||||
onClick={() => {
|
||||
void ideMessenger.request("controlPlane/openUrl", {
|
||||
path: "/new?type=assistant",
|
||||
orgSlug: currentOrg?.slug,
|
||||
});
|
||||
}}
|
||||
className="text-description flex cursor-pointer select-none items-center gap-1"
|
||||
style={{ fontSize: smallFont }}
|
||||
>
|
||||
<PlusIcon className="h-3 w-3 flex-shrink-0 select-none" />
|
||||
<span
|
||||
className={`line-clamp-1 select-none break-all ${isToolbarExpanded ? "xs:hidden sm:line-clamp-1" : ""}`}
|
||||
>
|
||||
Create your first assistant
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Listbox>
|
||||
<div className="relative" ref={listboxRef}>
|
||||
<SelectedAssistantButton selectedProfile={selectedProfile} />
|
||||
<Transition>
|
||||
<ListboxOptions className="-translate-x-1.5 pb-0">
|
||||
{shouldRenderOrgInfo && (
|
||||
<div className="border-border border-x-0 border-t-0 border-solid px-2 py-3">
|
||||
<div className="flex flex-col gap-2 pb-1 pl-1">
|
||||
<div className="border-border border-x-0 border-t-0 border-solid px-2 py-3">
|
||||
<div className="flex flex-col gap-2 pb-1 pl-1">
|
||||
{session && session?.AUTH_TYPE !== AuthType.OnPrem && (
|
||||
<span className="text-description-muted flex items-center pb-1">
|
||||
{session.account.id}
|
||||
{session?.account.id}
|
||||
</span>
|
||||
<label className="text-vsc-foreground font-semibold">
|
||||
Organization
|
||||
</label>
|
||||
<ScopeSelect />
|
||||
</div>
|
||||
)}
|
||||
{shouldRenderOrgInfo && (
|
||||
<>
|
||||
<label className="text-vsc-foreground font-semibold">
|
||||
Organization
|
||||
</label>
|
||||
<ScopeSelect />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<AssistantOptions
|
||||
selectedProfileId={selectedProfile.id}
|
||||
selectedProfileId={selectedProfile?.id}
|
||||
onClose={close}
|
||||
/>
|
||||
|
||||
|
|
@ -176,7 +159,7 @@ export function AssistantAndOrgListbox() {
|
|||
configLoading && "animate-spin-slow",
|
||||
)}
|
||||
/>
|
||||
Reload config
|
||||
Reload assistants
|
||||
</span>
|
||||
</ListboxOption>
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ export function OnboardingCardLanding({
|
|||
// A new assistant is created when the account is created
|
||||
// We want to switch to this immediately
|
||||
void dispatch(selectFirstHubProfile());
|
||||
|
||||
ideMessenger.post("showTutorial", undefined);
|
||||
ideMessenger.post("showToast", ["info", "🎉 Welcome to Continue!"]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
<>
|
||||
<div
|
||||
onClick={props.onClick}
|
||||
className={`find-widget-skip bg-vsc-input-background flex select-none flex-row items-center justify-between gap-1 pt-1 ${props.hidden ? "pointer-events-none h-0 cursor-default opacity-0" : "pointer-events-auto cursor-text opacity-100"}`}
|
||||
className={`find-widget-skip bg-vsc-input-background flex select-none flex-row items-center justify-between gap-1 pt-1 ${props.hidden ? "pointer-events-none h-0 cursor-default opacity-0" : "pointer-events-auto mt-2 cursor-text opacity-100"}`}
|
||||
style={{
|
||||
fontSize: smallFont,
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export function getPlaceholderText(
|
|||
}
|
||||
|
||||
return historyLength === 0
|
||||
? "Ask anything, '/' for prompts, '@' to add context"
|
||||
? "Ask anything, '@' to add context"
|
||||
: "Ask a follow-up";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue