feat: smaller headings, use assistant name
This commit is contained in:
parent
71eb67d2ab
commit
85804ff9e5
9 changed files with 141 additions and 107 deletions
4
extensions/vscode/package-lock.json
generated
4
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/fetch": "^1.0.3",
|
||||
|
|
|
|||
|
|
@ -4,15 +4,23 @@ export interface PageHeaderProps {
|
|||
onTitleClick?: () => void;
|
||||
title?: string;
|
||||
rightContent?: React.ReactNode;
|
||||
showBorder?: boolean; // Added this prop
|
||||
}
|
||||
|
||||
export default function PageHeader({
|
||||
onTitleClick,
|
||||
title,
|
||||
rightContent,
|
||||
showBorder,
|
||||
}: PageHeaderProps) {
|
||||
return (
|
||||
<div className="bg-vsc-background sticky top-0 z-20 m-0 flex items-center justify-between border-b-zinc-700 bg-inherit py-0.5">
|
||||
<div
|
||||
className={`bg-vsc-background sticky top-0 z-20 m-0 flex items-center justify-between bg-inherit py-0.5 ${
|
||||
showBorder
|
||||
? "border-0 border-b-[1px] border-solid border-b-zinc-700"
|
||||
: ""
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
{title && (
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -36,6 +36,30 @@ const StyledMarkdown = styled.div<{
|
|||
whiteSpace: string;
|
||||
bgColor: string;
|
||||
}>`
|
||||
h1 {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.15em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.05em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: ${(props) => props.whiteSpace};
|
||||
background-color: ${vscEditorBackground};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import { getFontSize, isMetaEquivalentKeyPressed } from "../../../util";
|
|||
import PopoverTransition from "../../mainInput/InputToolbar/PopoverTransition";
|
||||
import AssistantIcon from "./AssistantIcon";
|
||||
import { AssistantSelectOptions } from "./AssistantSelectOptions";
|
||||
import { getProfileDisplayText } from "./utils";
|
||||
|
||||
function AssistantSelectButton(props: { selectedProfile: ProfileDescription }) {
|
||||
return (
|
||||
|
|
@ -18,9 +17,7 @@ function AssistantSelectButton(props: { selectedProfile: ProfileDescription }) {
|
|||
<div className="mr-1 h-4 w-4 flex-shrink-0">
|
||||
<AssistantIcon assistant={props.selectedProfile} />
|
||||
</div>
|
||||
<span className="truncate">
|
||||
{getProfileDisplayText(props.selectedProfile)}
|
||||
</span>
|
||||
<span className="truncate">{props.selectedProfile.title}</span>
|
||||
<ChevronDownIcon className="h-3 w-3 flex-shrink-0" aria-hidden="true" />
|
||||
</div>
|
||||
);
|
||||
|
|
@ -29,7 +26,7 @@ function AssistantSelectButton(props: { selectedProfile: ProfileDescription }) {
|
|||
export default function AssistantSelect() {
|
||||
const dispatch = useAppDispatch();
|
||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||
const { selectedProfile, selectedOrganization, profiles } = useAuth();
|
||||
const { selectedProfile, selectedOrganization } = useAuth();
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -87,7 +84,7 @@ export default function AssistantSelect() {
|
|||
</Popover.Button>
|
||||
|
||||
<PopoverTransition>
|
||||
<Popover.Panel className="bg-vsc-input-background absolute right-0 top-full z-[1000] mr-1 mt-1 flex max-w-[90vw] cursor-default flex-row overflow-hidden rounded-md border border-gray-400 p-0">
|
||||
<Popover.Panel className="bg-vsc-input-background absolute right-0 top-full z-[1000] mr-1 mt-1 flex min-w-[200px] max-w-[90vw] cursor-default flex-row overflow-hidden rounded-md border-2 border-zinc-600 p-0">
|
||||
<AssistantSelectOptions
|
||||
onClose={() => {
|
||||
if (buttonRef.current) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import { getFontSize, getMetaKeyLabel, isLocalProfile } from "../../../util";
|
|||
import { ROUTES } from "../../../util/navigation";
|
||||
import AssistantIcon from "./AssistantIcon";
|
||||
import { Divider, Option, OptionDiv } from "./shared";
|
||||
import { getProfileDisplayText } from "./utils";
|
||||
|
||||
interface AssistantSelectOptionsProps {
|
||||
onClose: () => void;
|
||||
|
|
@ -49,8 +48,8 @@ export function AssistantSelectOptions({
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="border-lightgray flex min-w-0 flex-col overflow-x-hidden pt-0">
|
||||
<div className={`max-h-[300px]`}>
|
||||
<div className="border-lightgray flex w-full flex-col overflow-x-hidden pt-0">
|
||||
<div className={`max-h-[300px] w-full`}>
|
||||
{profiles.map((profile, idx) => {
|
||||
return (
|
||||
<Option
|
||||
|
|
@ -69,7 +68,7 @@ export function AssistantSelectOptions({
|
|||
onClose();
|
||||
}}
|
||||
>
|
||||
<div className="flex min-w-0 items-center">
|
||||
<div className="flex w-full items-center">
|
||||
<div className="mr-2 h-4 w-4 flex-shrink-0">
|
||||
<AssistantIcon assistant={profile} />
|
||||
</div>
|
||||
|
|
@ -77,7 +76,7 @@ export function AssistantSelectOptions({
|
|||
className="flex-1 truncate"
|
||||
style={{ fontSize: getFontSize() - 2 }}
|
||||
>
|
||||
{getProfileDisplayText(profile)}
|
||||
{profile.title}
|
||||
</span>
|
||||
</div>
|
||||
</Option>
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
import { ProfileDescription } from "core/config/ProfileLifecycleManager";
|
||||
import { isLocalProfile } from "../../../util";
|
||||
|
||||
export function getProfileDisplayText(profile: ProfileDescription): string {
|
||||
return isLocalProfile(profile) ? profile.title : profile.fullSlug.packageSlug;
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ function MorePage() {
|
|||
|
||||
return (
|
||||
<div className="overflow-y-scroll">
|
||||
<PageHeader onTitleClick={() => navigate("/")} title="Chat" />
|
||||
<PageHeader showBorder onTitleClick={() => navigate("/")} title="Chat" />
|
||||
|
||||
<div className="gap-2 divide-x-0 divide-y-2 divide-solid divide-zinc-700 px-4">
|
||||
<div className="py-5">
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import { ModelRole } from "@continuedev/config-yaml";
|
||||
import { Listbox, Transition } from "@headlessui/react";
|
||||
import {
|
||||
ArrowTopRightOnSquareIcon,
|
||||
CheckIcon,
|
||||
ChevronUpDownIcon,
|
||||
PlusCircleIcon,
|
||||
UserCircleIcon,
|
||||
XMarkIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { ModelDescription } from "core";
|
||||
|
|
@ -177,12 +179,12 @@ function ConfigPage() {
|
|||
|
||||
return (
|
||||
<div className="overflow-y-scroll">
|
||||
<PageHeader onTitleClick={() => navigate("/")} title="Chat" />
|
||||
<PageHeader showBorder onTitleClick={() => navigate("/")} title="Chat" />
|
||||
|
||||
<div className="divide-x-0 divide-y-2 divide-solid divide-zinc-700 px-4">
|
||||
<div className="divide-x-0 divide-y-2 divide-solid divide-zinc-700 px-4 pt-4">
|
||||
{(session || hubEnabled || controlServerBetaEnabled) && (
|
||||
<div className="flex flex-col">
|
||||
<div className="flex max-w-[400px] flex-col gap-4 py-4">
|
||||
<div className="flex max-w-[400px] flex-col gap-4 pb-4">
|
||||
<h2 className="mb-1 mt-0">Account</h2>
|
||||
{!session ? (
|
||||
<div className="flex flex-col gap-2">
|
||||
|
|
@ -193,26 +195,19 @@ function ConfigPage() {
|
|||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col gap-4">
|
||||
{hubEnabled ? (
|
||||
// Hub: show org selector
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<span className="text-lightgray">{`Organization`}</span>
|
||||
<ScopeSelect />
|
||||
</div>
|
||||
) : (
|
||||
// Continue for teams: show org text
|
||||
<div>You are using Continue for Teams</div>
|
||||
)}
|
||||
<div className="flex flex-row items-center gap-2">
|
||||
<span className="text-lightgray">
|
||||
<UserCircleIcon className="h-6 w-6" />
|
||||
<span>
|
||||
{session.account.label === ""
|
||||
? "Signed in"
|
||||
: `Signed in as ${session.account.label}`}
|
||||
: session.account.label}
|
||||
</span>
|
||||
<span
|
||||
onClick={logout}
|
||||
className="text-lightgray cursor-pointer underline"
|
||||
>{`Sign out`}</span>
|
||||
>
|
||||
(Sign out)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
|
@ -223,10 +218,23 @@ function ConfigPage() {
|
|||
<div className="flex flex-col">
|
||||
<div className="flex max-w-[400px] flex-col gap-4 py-6">
|
||||
<h2 className="mb-1 mt-0">Configuration</h2>
|
||||
{hubEnabled ? (
|
||||
// Hub: show org selector
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<span className="text-lightgray text-sm">{`Organization`}</span>
|
||||
<ScopeSelect />
|
||||
</div>
|
||||
) : (
|
||||
// Continue for teams: show org text
|
||||
<div>You are using Continue for Teams</div>
|
||||
)}
|
||||
|
||||
{profiles ? (
|
||||
<>
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<span className="text-lightgray">{`${hubEnabled ? "Assistant" : "Profile"}`}</span>
|
||||
<div className="flex items-center justify-between gap-1.5 text-sm">
|
||||
<span className="text-lightgray">{`${hubEnabled ? "Assistant" : "Profile"}`}</span>
|
||||
</div>
|
||||
<Listbox
|
||||
value={selectedProfile?.id}
|
||||
onChange={changeProfileId}
|
||||
|
|
@ -291,87 +299,91 @@ function ConfigPage() {
|
|||
)}
|
||||
</Listbox.Options>
|
||||
</Transition>
|
||||
|
||||
{selectedProfile && (
|
||||
<div className="mt-3 flex w-full justify-center">
|
||||
<span
|
||||
className="text-lightgray flex cursor-pointer items-center gap-1 hover:underline"
|
||||
onClick={handleOpenConfig}
|
||||
>
|
||||
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
|
||||
{selectedProfile.id === "local"
|
||||
? "View configuration"
|
||||
: hubEnabled
|
||||
? "View Assistant"
|
||||
: "View Workspace"}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</Listbox>
|
||||
</div>
|
||||
{selectedProfile && (
|
||||
<SecondaryButton onClick={handleOpenConfig}>
|
||||
{selectedProfile.id === "local"
|
||||
? "Open Config File"
|
||||
: hubEnabled
|
||||
? "Open Assistant"
|
||||
: "Open Workspace"}
|
||||
</SecondaryButton>
|
||||
)}
|
||||
{/* {hubEnabled && session && (
|
||||
<div className="flex flex-col gap-1">
|
||||
<span>{`If your hub secret values may have changed, refresh your assistants`}</span>
|
||||
<SecondaryButton onClick={refreshProfiles}>
|
||||
Refresh assistants
|
||||
</SecondaryButton>
|
||||
</div>
|
||||
)} */}
|
||||
</>
|
||||
) : (
|
||||
<div>Loading...</div>
|
||||
)}
|
||||
<div>
|
||||
<h2 className="m-0 mb-3 p-0 text-center text-sm">Model Roles</h2>
|
||||
<div className="grid grid-cols-1 gap-x-3 gap-y-2 sm:grid-cols-[auto_1fr]">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Model Roles as a separate section */}
|
||||
<div className="flex flex-col">
|
||||
<div className="flex max-w-[400px] flex-col gap-4 py-6">
|
||||
<h2 className="mb-1 mt-0">Model Roles</h2>
|
||||
<div className="grid grid-cols-1 gap-x-3 gap-y-2 sm:grid-cols-[auto_1fr]">
|
||||
<ModelRoleSelector
|
||||
displayName="Chat"
|
||||
description="Used in the chat interface"
|
||||
models={config.modelsByRole.chat}
|
||||
selectedModel={{
|
||||
title: selectedChatModel,
|
||||
provider: "mock",
|
||||
model: "mock",
|
||||
}}
|
||||
onSelect={(model) => handleChatModelSelection(model)}
|
||||
/>
|
||||
<ModelRoleSelector
|
||||
displayName="Autocomplete"
|
||||
description="Used to generate code completion suggestions"
|
||||
models={config.modelsByRole.autocomplete}
|
||||
selectedModel={config.selectedModelByRole.autocomplete}
|
||||
onSelect={(model) => handleRoleUpdate("autocomplete", model)}
|
||||
/>
|
||||
{/* Jetbrains has a model selector inline */}
|
||||
{!jetbrains && (
|
||||
<ModelRoleSelector
|
||||
displayName="Chat"
|
||||
description="Used in the chat interface"
|
||||
models={config.modelsByRole.chat}
|
||||
selectedModel={{
|
||||
title: selectedChatModel,
|
||||
provider: "mock",
|
||||
model: "mock",
|
||||
}}
|
||||
onSelect={(model) => handleChatModelSelection(model)}
|
||||
displayName="Edit"
|
||||
description="Used for inline edits"
|
||||
models={config.modelsByRole.edit}
|
||||
selectedModel={config.selectedModelByRole.edit}
|
||||
onSelect={(model) => handleRoleUpdate("edit", model)}
|
||||
/>
|
||||
<ModelRoleSelector
|
||||
displayName="Autocomplete"
|
||||
description="Used to generate code completion suggestions"
|
||||
models={config.modelsByRole.autocomplete}
|
||||
selectedModel={config.selectedModelByRole.autocomplete}
|
||||
onSelect={(model) => handleRoleUpdate("autocomplete", model)}
|
||||
/>
|
||||
{/* Jetbrains has a model selector inline */}
|
||||
{!jetbrains && (
|
||||
<ModelRoleSelector
|
||||
displayName="Edit"
|
||||
description="Used for inline edits"
|
||||
models={config.modelsByRole.edit}
|
||||
selectedModel={config.selectedModelByRole.edit}
|
||||
onSelect={(model) => handleRoleUpdate("edit", model)}
|
||||
/>
|
||||
)}
|
||||
<ModelRoleSelector
|
||||
displayName="Apply"
|
||||
description="Used to apply generated codeblocks to files"
|
||||
models={config.modelsByRole.apply}
|
||||
selectedModel={config.selectedModelByRole.apply}
|
||||
onSelect={(model) => handleRoleUpdate("apply", model)}
|
||||
/>
|
||||
<ModelRoleSelector
|
||||
displayName="Embed"
|
||||
description="Used to generate and query embeddings for the @codebase and @docs context providers"
|
||||
models={config.modelsByRole.embed}
|
||||
selectedModel={config.selectedModelByRole.embed}
|
||||
onSelect={(model) => handleRoleUpdate("embed", model)}
|
||||
/>
|
||||
<ModelRoleSelector
|
||||
displayName="Rerank"
|
||||
description="Used for reranking results from the @codebase and @docs context providers"
|
||||
models={config.modelsByRole.rerank}
|
||||
selectedModel={config.selectedModelByRole.rerank}
|
||||
onSelect={(model) => handleRoleUpdate("rerank", model)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<ModelRoleSelector
|
||||
displayName="Apply"
|
||||
description="Used to apply generated codeblocks to files"
|
||||
models={config.modelsByRole.apply}
|
||||
selectedModel={config.selectedModelByRole.apply}
|
||||
onSelect={(model) => handleRoleUpdate("apply", model)}
|
||||
/>
|
||||
<ModelRoleSelector
|
||||
displayName="Embed"
|
||||
description="Used to generate and query embeddings for the @codebase and @docs context providers"
|
||||
models={config.modelsByRole.embed}
|
||||
selectedModel={config.selectedModelByRole.embed}
|
||||
onSelect={(model) => handleRoleUpdate("embed", model)}
|
||||
/>
|
||||
<ModelRoleSelector
|
||||
displayName="Rerank"
|
||||
description="Used for reranking results from the @codebase and @docs context providers"
|
||||
models={config.modelsByRole.rerank}
|
||||
selectedModel={config.selectedModelByRole.rerank}
|
||||
onSelect={(model) => handleRoleUpdate("rerank", model)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!controlServerBetaEnabled || hubEnabled ? (
|
||||
<div className="flex flex-col">
|
||||
<div className="flex max-w-[400px] flex-col">
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export default function HistoryPage() {
|
|||
|
||||
return (
|
||||
<div className="overflow-y-scroll" style={{ fontSize: getFontSize() }}>
|
||||
<PageHeader onTitleClick={() => navigate("/")} title="Chat" />
|
||||
<PageHeader showBorder onTitleClick={() => navigate("/")} title="Chat" />
|
||||
<History />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue