ty's feedback
This commit is contained in:
parent
a1d18e4cc8
commit
3fa83b766e
12 changed files with 289 additions and 327 deletions
|
|
@ -26,13 +26,13 @@ export function SelectedAssistantButton({
|
|||
return (
|
||||
<ListboxButton
|
||||
data-testid="assistant-select-button"
|
||||
className={`text-description border-none bg-transparent !py-1.5 hover:brightness-125 ${isSidebar ? "w-full justify-start" : "gap-1.5"} ${buttonPadding}`}
|
||||
className={`text-description border-none bg-transparent !py-1.5 hover:brightness-110 overflow-hidden ${isSidebar ? "w-full justify-start" : "gap-1.5"} ${buttonPadding}`}
|
||||
style={buttonStyle}
|
||||
>
|
||||
<div
|
||||
className={`flex flex-row items-center ${isSidebar ? "w-full justify-between" : "gap-1.5"}`}
|
||||
>
|
||||
<div className="flex flex-row items-center gap-2">
|
||||
<div className="flex flex-row items-center gap-2 min-w-0 flex-1">
|
||||
{selectedProfile === null ? (
|
||||
"Create your first agent"
|
||||
) : configLoading ? (
|
||||
|
|
@ -49,7 +49,7 @@ export function SelectedAssistantButton({
|
|||
<>
|
||||
<AssistantIcon assistant={selectedProfile} size={iconSize} />
|
||||
<span
|
||||
className={`select-none truncate ${isSidebar ? "hidden lg:block" : ""}`}
|
||||
className={`select-none truncate ${isSidebar && "hidden md:block"}`}
|
||||
>
|
||||
{selectedProfile.title}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {
|
||||
ArrowPathIcon,
|
||||
ArrowRightStartOnRectangleIcon,
|
||||
Cog6ToothIcon,
|
||||
PencilIcon,
|
||||
PlusIcon,
|
||||
|
|
@ -277,6 +278,23 @@ export function AssistantAndOrgListbox({
|
|||
<span className="text-2xs">Reload config</span>
|
||||
</div>
|
||||
</Button>
|
||||
{session && (
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
logout();
|
||||
close();
|
||||
}}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="text-description hover:bg-input my-0 w-full justify-start py-1.5 pl-1 text-left"
|
||||
>
|
||||
<div className="flex w-full items-center">
|
||||
<ArrowRightStartOnRectangleIcon className="ml-1.5 mr-2 h-3.5 w-3.5 flex-shrink-0" />
|
||||
<span className="text-2xs">Log out</span>
|
||||
</div>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
<Divider className="!mt-0" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export function HistoryTableRow({
|
|||
onMouseEnter={() => setHovered(true)}
|
||||
onMouseLeave={() => setHovered(false)}
|
||||
data-testid={`history-row-${index}`}
|
||||
className="border-description-muted relative mb-2 box-border flex w-full cursor-pointer overflow-hidden rounded-lg border border-solid p-3"
|
||||
className="relative mb-2 box-border flex w-full cursor-pointer overflow-hidden rounded-lg p-3 hover:bg-input"
|
||||
onClick={async () => {
|
||||
await dispatch(exitEdit({}));
|
||||
if (sessionMetadata.sessionId !== currentSessionId) {
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ export function History() {
|
|||
return (
|
||||
<div
|
||||
style={{ fontSize: getFontSize() }}
|
||||
className="flex flex-1 flex-col overflow-auto px-1"
|
||||
className="flex flex-1 flex-col overflow-auto px-1 overflow-x-hidden"
|
||||
>
|
||||
<div className="relative my-2 mt-4 flex justify-center space-x-2">
|
||||
<input
|
||||
|
|
@ -170,7 +170,7 @@ export function History() {
|
|||
)}
|
||||
</div>
|
||||
|
||||
<div className="thin-scrollbar flex flex-1 flex-col overflow-y-auto">
|
||||
<div className="thin-scrollbar flex flex-1 flex-col overflow-y-auto w-full">
|
||||
{filteredAndSortedSessions.length === 0 && (
|
||||
<div className="m-3 text-center">
|
||||
{isSessionMetadataLoading ? (
|
||||
|
|
@ -185,7 +185,7 @@ export function History() {
|
|||
</div>
|
||||
)}
|
||||
|
||||
<table className="flex flex-1 flex-col">
|
||||
<table className="flex flex-1 flex-col w-full">
|
||||
<tbody className="">
|
||||
{sessionGroups.map((group, groupIndex) => (
|
||||
<Fragment key={group.label}>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ function Alert({
|
|||
return (
|
||||
<div
|
||||
className={cn(
|
||||
`flex flex-row items-center ${background} border-[0.5px] ${border} border-solid shadow-sm ${alertSizes[size]}`,
|
||||
`flex flex-row items-start ${background} border-[0.5px] ${border} border-solid shadow-sm ${alertSizes[size]}`,
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
|
|
|
|||
|
|
@ -55,28 +55,30 @@ export function BlockSettingsTopToolbar() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-1 items-center justify-between gap-1.5">
|
||||
{!shouldShowError && (
|
||||
<ToolTip delayShow={700} content="View configuration errors">
|
||||
<div
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onClick={() => navigate(CONFIG_ROUTES.AGENTS)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.preventDefault();
|
||||
navigate(CONFIG_ROUTES.AGENTS);
|
||||
}
|
||||
}}
|
||||
data-testid="block-settings-toolbar-icon-error"
|
||||
className="relative flex cursor-pointer select-none items-center rounded-full px-1.5 py-1 sm:px-1.5"
|
||||
>
|
||||
<ExclamationTriangleIcon
|
||||
className="text-warning h-[13px] w-[13px] flex-shrink-0"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</div>
|
||||
</ToolTip>
|
||||
)}
|
||||
<div>
|
||||
{shouldShowError && (
|
||||
<ToolTip delayShow={700} content="View configuration errors">
|
||||
<div
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onClick={() => navigate(CONFIG_ROUTES.AGENTS)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.preventDefault();
|
||||
navigate(CONFIG_ROUTES.AGENTS);
|
||||
}
|
||||
}}
|
||||
data-testid="block-settings-toolbar-icon-error"
|
||||
className="relative flex cursor-pointer select-none items-center rounded-full px-1.5 py-1 sm:px-1.5"
|
||||
>
|
||||
<ExclamationTriangleIcon
|
||||
className="text-warning h-[13px] w-[13px] flex-shrink-0"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</div>
|
||||
</ToolTip>
|
||||
)}
|
||||
</div>
|
||||
<ToolTip
|
||||
place="top"
|
||||
content={isUsingFreeTrial ? "View free trial usage" : "Select Agent"}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ const buttonVariants = {
|
|||
"border border-solid border-description text-foreground bg-transparent hover:enabled:bg-input",
|
||||
ghost:
|
||||
"border-none text-foreground bg-inherit hover:enabled:brightness-125 hover:enabled:bg-input",
|
||||
icon: "border border-solid border-description text-description bg-transparent hover:enabled:text-foreground hover:enabled:bg-input hover:enabled:border-description rounded-full p-0",
|
||||
icon: "border border-solid border-description text-description bg-transparent hover:enabled:text-foreground hover:enabled:bg-input hover:enabled:border-description rounded-full p-0 flex items-center justify-center",
|
||||
};
|
||||
|
||||
const buttonSizes = {
|
||||
|
|
@ -27,8 +27,8 @@ const buttonSizes = {
|
|||
};
|
||||
|
||||
const iconButtonSizes = {
|
||||
sm: "h-4 w-4",
|
||||
lg: "h-6 w-6",
|
||||
sm: "h-3.5 w-3.5",
|
||||
lg: "h-5 w-5",
|
||||
};
|
||||
|
||||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
|
|
|
|||
|
|
@ -34,12 +34,8 @@ export function ConfigHeader({
|
|||
</div>
|
||||
{onAddClick && (
|
||||
<ToolTip content={addButtonTooltip}>
|
||||
<Button
|
||||
onClick={onAddClick}
|
||||
variant="icon"
|
||||
size={isSmall ? "sm" : undefined}
|
||||
>
|
||||
<PlusIcon className="h-3.5 w-3.5" />
|
||||
<Button onClick={onAddClick} variant="icon">
|
||||
<PlusIcon className="h-3 w-3" />
|
||||
</Button>
|
||||
</ToolTip>
|
||||
)}
|
||||
|
|
|
|||
68
gui/src/pages/config/components/ModelRoleRow.tsx
Normal file
68
gui/src/pages/config/components/ModelRoleRow.tsx
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
import { ModelRole } from "@continuedev/config-yaml";
|
||||
import { Cog6ToothIcon } from "@heroicons/react/24/outline";
|
||||
import { ModelDescription } from "core";
|
||||
import { ReactNode } from "react";
|
||||
import { ToolTip } from "../../../components/gui/Tooltip";
|
||||
import { Button } from "../../../components/ui";
|
||||
import ModelRoleSelector from "./ModelRoleSelector";
|
||||
|
||||
interface ModelRoleRowProps {
|
||||
role: ModelRole;
|
||||
displayName: string;
|
||||
description: string | ReactNode;
|
||||
models: ModelDescription[];
|
||||
selectedModel: ModelDescription | undefined;
|
||||
onSelect: (model: ModelDescription | null) => void;
|
||||
onConfigure: (model: ModelDescription | null) => void;
|
||||
setupURL: string;
|
||||
shortcut?: ReactNode;
|
||||
}
|
||||
|
||||
export function ModelRoleRow({
|
||||
role,
|
||||
displayName,
|
||||
description,
|
||||
models,
|
||||
selectedModel,
|
||||
onSelect,
|
||||
onConfigure,
|
||||
setupURL,
|
||||
shortcut,
|
||||
}: ModelRoleRowProps) {
|
||||
return (
|
||||
<div className="py-6 first:pt-0 last:pb-0">
|
||||
<div className="mb-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-base font-medium">{displayName}</span>
|
||||
{shortcut && shortcut}
|
||||
</div>
|
||||
<p className="text-description-muted mt-1 text-xs">{description}</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1">
|
||||
<ModelRoleSelector
|
||||
displayName={displayName}
|
||||
description={description}
|
||||
models={models}
|
||||
selectedModel={selectedModel ?? null}
|
||||
onSelect={onSelect}
|
||||
setupURL={setupURL}
|
||||
hideTitle={true}
|
||||
/>
|
||||
</div>
|
||||
{selectedModel && (
|
||||
<ToolTip content="Configure">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => onConfigure(selectedModel)}
|
||||
className="text-description-muted hover:enabled:text-foreground my-0 h-6 w-6 p-0"
|
||||
>
|
||||
<Cog6ToothIcon className="h-4 w-4 flex-shrink-0" />
|
||||
</Button>
|
||||
</ToolTip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -26,14 +26,8 @@ function CodebaseSubSection() {
|
|||
<Card>
|
||||
<div className="py-2">
|
||||
{config.disableIndexing ? (
|
||||
<div className="pb-2 pt-2">
|
||||
<p className="py-1 text-center font-semibold">
|
||||
Indexing is disabled
|
||||
</p>
|
||||
<p className="text-lightgray cursor-pointer text-center text-xs">
|
||||
Open settings and toggle <code>Enable Indexing</code> to
|
||||
re-enable
|
||||
</p>
|
||||
<div className="p-1">
|
||||
<p className="text-center font-semibold">Indexing is disabled</p>
|
||||
</div>
|
||||
) : (
|
||||
<IndexingProgress />
|
||||
|
|
@ -61,27 +55,25 @@ function EnableIndexingSetting() {
|
|||
currentOrg?.policy?.allowCodebaseIndexing === false;
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<div className="flex flex-col gap-4">
|
||||
<UserSetting
|
||||
title="Enable indexing"
|
||||
type="toggle"
|
||||
description={
|
||||
<>
|
||||
Allows indexing of your codebase for search and context
|
||||
understanding.
|
||||
<br />
|
||||
<br />
|
||||
Note that indexing can consume significant system resources,
|
||||
especially on larger codebases.
|
||||
</>
|
||||
}
|
||||
value={!disableIndexing}
|
||||
disabled={disableIndexingToggle}
|
||||
onChange={(value) => handleUpdate({ disableIndexing: !value })}
|
||||
/>
|
||||
</div>
|
||||
</Card>
|
||||
<div className="flex flex-col gap-4">
|
||||
<UserSetting
|
||||
title="Enable indexing"
|
||||
type="toggle"
|
||||
description={
|
||||
<div className="text-foreground">
|
||||
Allows indexing of your codebase for search and context
|
||||
understanding.
|
||||
<br />
|
||||
<br />
|
||||
Note that indexing can consume significant system resources,
|
||||
especially on larger codebases.
|
||||
</div>
|
||||
}
|
||||
value={!disableIndexing}
|
||||
disabled={disableIndexingToggle}
|
||||
onChange={(value) => handleUpdate({ disableIndexing: !value })}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -94,32 +86,33 @@ export function IndexingSettingsSection() {
|
|||
<ConfigHeader title="Indexing" />
|
||||
|
||||
<Alert type="warning" className="mb-6">
|
||||
<div>
|
||||
<div className="text-sm font-medium">
|
||||
Indexing has been deprecated
|
||||
</div>
|
||||
<div className="mt-1">
|
||||
Learn more about{" "}
|
||||
<a
|
||||
href="https://docs.continue.dev/guides/codebase-documentation-awareness"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-inherit underline hover:brightness-125"
|
||||
>
|
||||
making your agent aware of your codebase and documentation
|
||||
</a>
|
||||
<div className="space-y-4">
|
||||
<div>
|
||||
<div className="text-sm font-medium">
|
||||
Indexing has been deprecated
|
||||
</div>
|
||||
<div className="mt-1">
|
||||
Learn how to{" "}
|
||||
<a
|
||||
href="https://docs.continue.dev/guides/codebase-documentation-awareness"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-inherit underline hover:brightness-125"
|
||||
>
|
||||
make your agent aware of your codebase and documentation
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<EnableIndexingSetting />
|
||||
</div>
|
||||
</Alert>
|
||||
|
||||
<div className="mb-6">
|
||||
<EnableIndexingSetting />
|
||||
</div>
|
||||
|
||||
<div className={`space-y-8 ${disableIndexing ? "opacity-50" : ""}`}>
|
||||
<CodebaseSubSection />
|
||||
<DocsSection />
|
||||
</div>
|
||||
{!disableIndexing && (
|
||||
<div className="space-y-8">
|
||||
<CodebaseSubSection />
|
||||
<DocsSection />
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
import { ModelRole } from "@continuedev/config-yaml";
|
||||
import { Cog6ToothIcon } from "@heroicons/react/24/outline";
|
||||
import { ModelDescription } from "core";
|
||||
import { useContext, useState } from "react";
|
||||
import { ToolTip } from "../../../components/gui/Tooltip";
|
||||
import { Button, Card, Divider, Toggle } from "../../../components/ui";
|
||||
import Shortcut from "../../../components/gui/Shortcut";
|
||||
import { Card, Divider, Toggle } from "../../../components/ui";
|
||||
import { useAuth } from "../../../context/Auth";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { AddModelForm } from "../../../forms/AddModelForm";
|
||||
import { useAppDispatch, useAppSelector } from "../../../redux/hooks";
|
||||
import { setDialogMessage, setShowDialog } from "../../../redux/slices/uiSlice";
|
||||
import { updateSelectedModelByRole } from "../../../redux/thunks/updateSelectedModelByRole";
|
||||
import { isJetBrains } from "../../../util";
|
||||
import { getMetaKeyLabel, isJetBrains } from "../../../util";
|
||||
import { ConfigHeader } from "../components/ConfigHeader";
|
||||
import ModelRoleSelector from "../components/ModelRoleSelector";
|
||||
import { ModelRoleRow } from "../components/ModelRoleRow";
|
||||
|
||||
export function ModelsSection() {
|
||||
const { selectedProfile } = useAuth();
|
||||
|
|
@ -21,6 +20,7 @@ export function ModelsSection() {
|
|||
|
||||
const config = useAppSelector((state) => state.config.config);
|
||||
const jetbrains = isJetBrains();
|
||||
const metaKey = getMetaKeyLabel();
|
||||
const [showAdditionalRoles, setShowAdditionalRoles] = useState(false);
|
||||
|
||||
function handleRoleUpdate(role: ModelRole, model: ModelDescription | null) {
|
||||
|
|
@ -79,79 +79,95 @@ export function ModelsSection() {
|
|||
/>
|
||||
|
||||
<Card>
|
||||
<div className="py-6 first:pt-0 last:pb-0">
|
||||
<div className="mb-2">
|
||||
<span className="text-base font-medium">Chat</span>
|
||||
<p className="mt-1 text-sm text-gray-500">
|
||||
Used in the chat interface
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1">
|
||||
<ModelRoleSelector
|
||||
displayName="Chat"
|
||||
description="Used in the chat interface"
|
||||
models={config.modelsByRole.chat}
|
||||
selectedModel={config.selectedModelByRole.chat}
|
||||
onSelect={(model) => handleRoleUpdate("chat", model)}
|
||||
setupURL="https://docs.continue.dev/chat/model-setup"
|
||||
hideTitle={true}
|
||||
/>
|
||||
</div>
|
||||
{config.selectedModelByRole.chat && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
handleConfigureModel(config.selectedModelByRole.chat)
|
||||
}
|
||||
className="text-description-muted hover:enabled:text-foreground my-0 h-6 w-6 p-0"
|
||||
<ModelRoleRow
|
||||
role="chat"
|
||||
displayName="Chat"
|
||||
shortcut={
|
||||
<span className="text-2xs text-description-muted">
|
||||
(<Shortcut>{`cmd ${jetbrains ? "J" : "L"}`}</Shortcut>)
|
||||
</span>
|
||||
}
|
||||
description={
|
||||
<span>
|
||||
Used in Chat, Plan, Agent mode (
|
||||
<a
|
||||
href="https://docs.continue.dev/features/chat/quick-start hover:text-inherit"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-inherit underline hover:brightness-125"
|
||||
>
|
||||
<Cog6ToothIcon className="h-4 w-4 flex-shrink-0" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
Learn more
|
||||
</a>
|
||||
)
|
||||
</span>
|
||||
}
|
||||
models={config.modelsByRole.chat}
|
||||
selectedModel={config.selectedModelByRole.chat ?? undefined}
|
||||
onSelect={(model) => handleRoleUpdate("chat", model)}
|
||||
onConfigure={handleConfigureModel}
|
||||
setupURL="https://docs.continue.dev/chat/model-setup"
|
||||
/>
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className="py-6 first:pt-0 last:pb-0">
|
||||
<div className="mb-2">
|
||||
<span className="text-base font-medium">Autocomplete</span>
|
||||
<p className="mt-1 text-sm text-gray-500">
|
||||
Used to generate code completion suggestions
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1">
|
||||
<ModelRoleSelector
|
||||
displayName="Autocomplete"
|
||||
description="Used to generate code completion suggestions"
|
||||
models={config.modelsByRole.autocomplete}
|
||||
selectedModel={config.selectedModelByRole.autocomplete}
|
||||
onSelect={(model) => handleRoleUpdate("autocomplete", model)}
|
||||
setupURL="https://docs.continue.dev/autocomplete/model-setup"
|
||||
hideTitle={true}
|
||||
/>
|
||||
</div>
|
||||
{config.selectedModelByRole.autocomplete && (
|
||||
<ToolTip content="Configure">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
handleConfigureModel(
|
||||
config.selectedModelByRole.autocomplete,
|
||||
)
|
||||
}
|
||||
className="text-description-muted hover:enabled:text-foreground my-0 h-6 w-6 p-0"
|
||||
>
|
||||
<Cog6ToothIcon className="h-4 w-4 flex-shrink-0" />
|
||||
</Button>
|
||||
</ToolTip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<ModelRoleRow
|
||||
role="autocomplete"
|
||||
displayName="Autocomplete"
|
||||
description={
|
||||
<span>
|
||||
Used in inline code completions as you type (
|
||||
<a
|
||||
href="https://docs.continue.dev/features/autocomplete/quick-start"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-inherit underline hover:brightness-125"
|
||||
>
|
||||
Learn more
|
||||
</a>
|
||||
)
|
||||
</span>
|
||||
}
|
||||
models={config.modelsByRole.autocomplete}
|
||||
selectedModel={config.selectedModelByRole.autocomplete ?? undefined}
|
||||
onSelect={(model) => handleRoleUpdate("autocomplete", model)}
|
||||
onConfigure={handleConfigureModel}
|
||||
setupURL="https://docs.continue.dev/autocomplete/model-setup"
|
||||
/>
|
||||
|
||||
{/* Jetbrains has a model selector inline */}
|
||||
{!jetbrains && (
|
||||
<>
|
||||
<Divider />
|
||||
<ModelRoleRow
|
||||
role="edit"
|
||||
displayName="Edit"
|
||||
shortcut={
|
||||
<span className="text-2xs text-description-muted">
|
||||
(<Shortcut>cmd I</Shortcut>)
|
||||
</span>
|
||||
}
|
||||
description={
|
||||
<span>
|
||||
Used to transform a selected section of code (
|
||||
<a
|
||||
href="https://docs.continue.dev/features/edit/quick-start"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-inherit underline hover:brightness-125"
|
||||
>
|
||||
Learn more
|
||||
</a>
|
||||
)
|
||||
</span>
|
||||
}
|
||||
models={config.modelsByRole.edit}
|
||||
selectedModel={config.selectedModelByRole.edit ?? undefined}
|
||||
onSelect={(model) => handleRoleUpdate("edit", model)}
|
||||
onConfigure={handleConfigureModel}
|
||||
setupURL="https://docs.continue.dev/edit/model-setup"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
|
|
@ -159,167 +175,45 @@ export function ModelsSection() {
|
|||
isOpen={showAdditionalRoles}
|
||||
onToggle={() => setShowAdditionalRoles(!showAdditionalRoles)}
|
||||
title="Additional model roles"
|
||||
subtitle="Edit, Apply, Embed, Rerank"
|
||||
subtitle="Apply, Embed, Rerank"
|
||||
>
|
||||
<div className="flex flex-col gap-6">
|
||||
{/* Jetbrains has a model selector inline */}
|
||||
{!jetbrains && (
|
||||
<>
|
||||
<div>
|
||||
<div className="mb-2">
|
||||
<span className="text-base font-medium">Edit</span>
|
||||
<p className="mt-1 text-sm text-gray-500">
|
||||
Used for inline edits
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1">
|
||||
<ModelRoleSelector
|
||||
displayName="Edit"
|
||||
description="Used for inline edits"
|
||||
models={config.modelsByRole.edit}
|
||||
selectedModel={config.selectedModelByRole.edit}
|
||||
onSelect={(model) => handleRoleUpdate("edit", model)}
|
||||
setupURL="https://docs.continue.dev/edit/model-setup"
|
||||
hideTitle={true}
|
||||
/>
|
||||
</div>
|
||||
{config.selectedModelByRole.edit && (
|
||||
<ToolTip content="Configure">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
handleConfigureModel(
|
||||
config.selectedModelByRole.edit,
|
||||
)
|
||||
}
|
||||
className="text-description-muted hover:enabled:text-foreground my-0 h-6 w-6 p-0"
|
||||
>
|
||||
<Cog6ToothIcon className="h-4 w-4 flex-shrink-0" />
|
||||
</Button>
|
||||
</ToolTip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
</>
|
||||
)}
|
||||
|
||||
<div>
|
||||
<div className="mb-2">
|
||||
<span className="text-base font-medium">Apply</span>
|
||||
<p className="mt-1 text-sm text-gray-500">
|
||||
Used to apply generated codeblocks to files
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1">
|
||||
<ModelRoleSelector
|
||||
displayName="Apply"
|
||||
description="Used to apply generated codeblocks to files"
|
||||
models={config.modelsByRole.apply}
|
||||
selectedModel={config.selectedModelByRole.apply}
|
||||
onSelect={(model) => handleRoleUpdate("apply", model)}
|
||||
setupURL="https://docs.continue.dev/customize/model-roles/apply"
|
||||
hideTitle={true}
|
||||
/>
|
||||
</div>
|
||||
{config.selectedModelByRole.apply && (
|
||||
<ToolTip content="Configure">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
handleConfigureModel(config.selectedModelByRole.apply)
|
||||
}
|
||||
className="text-description-muted hover:enabled:text-foreground my-0 h-6 w-6 p-0"
|
||||
>
|
||||
<Cog6ToothIcon className="h-4 w-4 flex-shrink-0" />
|
||||
</Button>
|
||||
</ToolTip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
<ModelRoleRow
|
||||
role="apply"
|
||||
displayName="Apply"
|
||||
description="Used to apply generated codeblocks to files"
|
||||
models={config.modelsByRole.apply}
|
||||
selectedModel={config.selectedModelByRole.apply ?? undefined}
|
||||
onSelect={(model) => handleRoleUpdate("apply", model)}
|
||||
onConfigure={handleConfigureModel}
|
||||
setupURL="https://docs.continue.dev/customize/model-roles/apply"
|
||||
/>
|
||||
|
||||
<Divider />
|
||||
|
||||
<div>
|
||||
<div className="mb-2">
|
||||
<span className="text-base font-medium">Embed</span>
|
||||
<p className="mt-1 text-sm text-gray-500">
|
||||
Used to generate and query embeddings for the @codebase and
|
||||
@docs context providers
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1">
|
||||
<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)}
|
||||
setupURL="https://docs.continue.dev/customize/model-roles/embeddings"
|
||||
hideTitle={true}
|
||||
/>
|
||||
</div>
|
||||
{config.selectedModelByRole.embed && (
|
||||
<ToolTip content="Configure">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
handleConfigureModel(config.selectedModelByRole.embed)
|
||||
}
|
||||
className="text-description-muted hover:enabled:text-foreground my-0 h-6 w-6 p-0"
|
||||
>
|
||||
<Cog6ToothIcon className="h-4 w-4 flex-shrink-0" />
|
||||
</Button>
|
||||
</ToolTip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<ModelRoleRow
|
||||
role="embed"
|
||||
displayName="Embed"
|
||||
description="Used to generate and query embeddings for the @codebase and @docs context providers"
|
||||
models={config.modelsByRole.embed}
|
||||
selectedModel={config.selectedModelByRole.embed ?? undefined}
|
||||
onSelect={(model) => handleRoleUpdate("embed", model)}
|
||||
onConfigure={handleConfigureModel}
|
||||
setupURL="https://docs.continue.dev/customize/model-roles/embeddings"
|
||||
/>
|
||||
|
||||
<Divider />
|
||||
|
||||
<div>
|
||||
<div className="mb-2">
|
||||
<span className="text-base font-medium">Rerank</span>
|
||||
<p className="mt-1 text-sm text-gray-500">
|
||||
Used for reranking results from the @codebase and @docs
|
||||
context providers
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1">
|
||||
<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)}
|
||||
setupURL="https://docs.continue.dev/customize/model-roles/reranking"
|
||||
hideTitle={true}
|
||||
/>
|
||||
</div>
|
||||
{config.selectedModelByRole.rerank && (
|
||||
<ToolTip content="Configure">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
handleConfigureModel(config.selectedModelByRole.rerank)
|
||||
}
|
||||
className="text-description-muted hover:enabled:text-foreground my-0 h-6 w-6 p-0"
|
||||
>
|
||||
<Cog6ToothIcon className="h-4 w-4 flex-shrink-0" />
|
||||
</Button>
|
||||
</ToolTip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<ModelRoleRow
|
||||
role="rerank"
|
||||
displayName="Rerank"
|
||||
description="Used for reranking results from the @codebase and @docs context providers"
|
||||
models={config.modelsByRole.rerank}
|
||||
selectedModel={config.selectedModelByRole.rerank ?? undefined}
|
||||
onSelect={(model) => handleRoleUpdate("rerank", model)}
|
||||
onConfigure={handleConfigureModel}
|
||||
setupURL="https://docs.continue.dev/customize/model-roles/reranking"
|
||||
/>
|
||||
</div>
|
||||
</Toggle>
|
||||
</Card>
|
||||
|
|
|
|||
|
|
@ -13,14 +13,6 @@ import { IdeMessengerContext } from "../../../../context/IdeMessenger";
|
|||
import { createMockStore } from "../../../../util/test/mockStore";
|
||||
import DocsIndexingStatus from "./DocsIndexingStatus";
|
||||
|
||||
const mockLumpContext = {
|
||||
hideLump: vi.fn(),
|
||||
showLump: vi.fn(),
|
||||
};
|
||||
|
||||
vi.mock("../../LumpContext", () => ({
|
||||
useLump: () => mockLumpContext,
|
||||
}));
|
||||
|
||||
describe("DocsIndexingStatus", () => {
|
||||
const mockDocConfig: SiteIndexingConfig = {
|
||||
|
|
@ -211,7 +203,6 @@ describe("DocsIndexingStatus", () => {
|
|||
"openUrl",
|
||||
"https://example.com/docs",
|
||||
);
|
||||
expect(mockLumpContext.hideLump).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("fetches indexed pages when status becomes complete", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue