diff --git a/core/config/default.ts b/core/config/default.ts index 2501f20d5..1719cdc09 100644 --- a/core/config/default.ts +++ b/core/config/default.ts @@ -1,19 +1,5 @@ import { ConfigYaml } from "@continuedev/config-yaml"; -export const defaultContextProvidersVsCode: NonNullable< - ConfigYaml["context"] ->[number][] = [ - { provider: "code" }, - { provider: "docs" }, - { provider: "diff" }, - { provider: "terminal" }, - { provider: "problems" }, -]; - -export const defaultContextProvidersJetBrains: NonNullable< - ConfigYaml["context"] ->[number][] = [{ provider: "diff" }]; - export const defaultConfig: ConfigYaml = { name: "Local Agent", version: "1.0.0", diff --git a/gui/src/App.tsx b/gui/src/App.tsx index 6fc120707..c237b9327 100644 --- a/gui/src/App.tsx +++ b/gui/src/App.tsx @@ -31,7 +31,7 @@ const router = createMemoryRouter([ element: , }, { - path: "/stats", + path: ROUTES.STATS, element: , }, { diff --git a/gui/src/components/AssistantAndOrgListbox/AssistantIcon.tsx b/gui/src/components/AssistantAndOrgListbox/AssistantIcon.tsx index dded31b92..19aa0c418 100644 --- a/gui/src/components/AssistantAndOrgListbox/AssistantIcon.tsx +++ b/gui/src/components/AssistantAndOrgListbox/AssistantIcon.tsx @@ -5,17 +5,24 @@ import { BotIcon } from "../svg/BotIcon"; export interface AssistantIconProps { assistant: ProfileDescription; - size?: number; + size?: string; } -export function AssistantIcon({ assistant }: AssistantIconProps) { +export function AssistantIcon({ + assistant, + size = "h-4 w-4", +}: AssistantIconProps) { if (isLocalProfile(assistant)) { - return ; + return ; } else if (assistant.iconUrl) { return ( - + ); } else { - return ; + return ; } } diff --git a/gui/src/components/AssistantAndOrgListbox/AssistantOption.tsx b/gui/src/components/AssistantAndOrgListbox/AssistantOption.tsx index 183edd3ae..35ce80c7e 100644 --- a/gui/src/components/AssistantAndOrgListbox/AssistantOption.tsx +++ b/gui/src/components/AssistantAndOrgListbox/AssistantOption.tsx @@ -1,16 +1,13 @@ -import { - ExclamationTriangleIcon, -} from "@heroicons/react/24/outline"; +import { ExclamationTriangleIcon } from "@heroicons/react/24/outline"; import { ProfileDescription } from "core/config/ProfileLifecycleManager"; import { useContext, useMemo } from "react"; import { useNavigate } from "react-router-dom"; -import { ToolTip } from "../gui/Tooltip"; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useAppDispatch } from "../../redux/hooks"; import { setSelectedProfile } from "../../redux/slices/profilesSlice"; -import { isLocalProfile } from "../../util"; -import { ROUTES } from "../../util/navigation"; -import { ListboxOption, useFontSize } from "../ui"; +import { CONFIG_ROUTES } from "../../util/navigation"; +import { ToolTip } from "../gui/Tooltip"; +import { Button, ListboxOption, useFontSize } from "../ui"; import { AssistantIcon } from "./AssistantIcon"; interface AssistantOptionProps { @@ -42,16 +39,9 @@ export function AssistantOption({ id: profile.id, }); - // If the agent has errors, navigate to the agents config page - if (profile.errors && profile.errors.length > 0) { - navigate("/config?tab=agents"); - } - onClick(); } - - return ( {profile.errors && profile.errors?.length > 0 && ( - + )} diff --git a/gui/src/components/AssistantAndOrgListbox/OrganizationOption.tsx b/gui/src/components/AssistantAndOrgListbox/OrganizationOption.tsx index a0a308093..80c42583d 100644 --- a/gui/src/components/AssistantAndOrgListbox/OrganizationOption.tsx +++ b/gui/src/components/AssistantAndOrgListbox/OrganizationOption.tsx @@ -1,5 +1,9 @@ import { CheckIcon } from "@heroicons/react/24/outline"; -import { BuildingOfficeIcon, UserCircleIcon, UserIcon } from "@heroicons/react/24/solid"; +import { + BuildingOfficeIcon, + UserCircleIcon, + UserIcon, +} from "@heroicons/react/24/solid"; import { useContext } from "react"; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; @@ -74,11 +78,9 @@ export function OrganizationOption({
- {isSelected && ( - - )} + {isSelected && }
); -} \ No newline at end of file +} diff --git a/gui/src/components/AssistantAndOrgListbox/OrganizationOptions.tsx b/gui/src/components/AssistantAndOrgListbox/OrganizationOptions.tsx index c892aa706..d374870d4 100644 --- a/gui/src/components/AssistantAndOrgListbox/OrganizationOptions.tsx +++ b/gui/src/components/AssistantAndOrgListbox/OrganizationOptions.tsx @@ -11,12 +11,8 @@ export function OrganizationOptions({ onClose }: OrganizationOptionsProps) { return (
{organizations.map((org) => ( - + ))}
); -} \ No newline at end of file +} diff --git a/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx b/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx index 2e02aeb0b..a1d17dbe7 100644 --- a/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx +++ b/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx @@ -18,19 +18,19 @@ export function SelectedAssistantButton({ }: SelectedAssistantButtonProps) { const configLoading = useAppSelector((store) => store.config.loading); - const isLarge = variant === "sidebar"; - const iconSize = isLarge ? "h-4 w-4" : "h-3 w-3"; - const buttonPadding = isLarge ? "px-2 py-2" : "px-0 py-0"; - const buttonStyle = isLarge ? {} : { fontSize: fontSize(-3) }; + const isSidebar = variant === "sidebar"; + const iconSize = isSidebar ? "h-4 w-4" : "h-3 w-3"; + const buttonPadding = isSidebar ? "px-2 py-2" : "px-0 py-0"; + const buttonStyle = isSidebar ? {} : { fontSize: fontSize(-3) }; return (
{selectedProfile === null ? ( @@ -47,11 +47,9 @@ export function SelectedAssistantButton({ ) : ( <> -
- -
+ {selectedProfile.title} @@ -59,7 +57,7 @@ export function SelectedAssistantButton({ )}
diff --git a/gui/src/components/AssistantAndOrgListbox/index.tsx b/gui/src/components/AssistantAndOrgListbox/index.tsx index f789d1910..237eabfb2 100644 --- a/gui/src/components/AssistantAndOrgListbox/index.tsx +++ b/gui/src/components/AssistantAndOrgListbox/index.tsx @@ -17,6 +17,7 @@ import { } from "../../redux/slices/profilesSlice"; import { getMetaKeyLabel, isMetaEquivalentKeyPressed } from "../../util"; import { cn } from "../../util/cn"; +import { CONFIG_ROUTES } from "../../util/navigation"; import { Button, Listbox, @@ -80,27 +81,22 @@ export function AssistantAndOrgListbox({ } function onAgentsConfig() { - navigate("/config?tab=agents"); + navigate(CONFIG_ROUTES.AGENTS); close(); } function onOrganizationsConfig() { - navigate("/config?tab=organizations"); + navigate(CONFIG_ROUTES.ORGANIZATIONS); close(); } function onRulesConfig() { - navigate("/config?tab=rules"); + navigate(CONFIG_ROUTES.RULES); close(); } function onToolsConfig() { - navigate("/config?tab=tools"); - close(); - } - - function onLogout() { - logout(); + navigate(CONFIG_ROUTES.TOOLS); close(); } @@ -241,7 +237,7 @@ export function AssistantAndOrgListbox({ }} variant="ghost" size="sm" - className="text-description hover:bg-input my-0 w-full justify-start py-2 pl-1 text-left" + className="text-description hover:bg-input my-0 w-full justify-start py-1.5 pl-1 text-left" >
@@ -255,13 +251,32 @@ export function AssistantAndOrgListbox({ }} variant="ghost" size="sm" - className="text-description hover:bg-input my-0 w-full justify-start py-2 pl-1 text-left" + className="text-description hover:bg-input my-0 w-full justify-start py-1.5 pl-1 text-left" >
Tools
+
@@ -269,26 +284,10 @@ export function AssistantAndOrgListbox({ {/* Bottom Actions */}
-
+
{getMetaKeyLabel()} ⇧ ' to toggle agent -
diff --git a/gui/src/components/History/HistoryTableRow.tsx b/gui/src/components/History/HistoryTableRow.tsx index 0143b1488..1cb104a0c 100644 --- a/gui/src/components/History/HistoryTableRow.tsx +++ b/gui/src/components/History/HistoryTableRow.tsx @@ -65,7 +65,7 @@ export function HistoryTableRow({ onMouseEnter={() => setHovered(true)} onMouseLeave={() => setHovered(false)} data-testid={`history-row-${index}`} - className="border-border relative mb-2 box-border flex w-full cursor-pointer overflow-hidden rounded-lg border border-solid p-3" + className="border-description-muted relative mb-2 box-border flex w-full cursor-pointer overflow-hidden rounded-lg border border-solid p-3" onClick={async () => { await dispatch(exitEdit({})); if (sessionMetadata.sessionId !== currentSessionId) { @@ -117,7 +117,7 @@ export function HistoryTableRow({ {hovered && !editing && ( - + { diff --git a/gui/src/components/InfoHover.tsx b/gui/src/components/InfoHover.tsx index f54e6ad69..79d8eb136 100644 --- a/gui/src/components/InfoHover.tsx +++ b/gui/src/components/InfoHover.tsx @@ -3,6 +3,14 @@ import { ToolTip } from "./gui/Tooltip"; const DEFAULT_SIZE = "5"; +const sizeMap = { + "3": "h-3 w-3", + "4": "h-4 w-4", + "5": "h-5 w-5", + "6": "h-6 w-6", + "8": "h-8 w-8", +} as const; + const InfoHover = ({ msg, size, @@ -12,11 +20,13 @@ const InfoHover = ({ msg: string; size?: string; }) => { + const sizeClasses = + sizeMap[size as keyof typeof sizeMap] || + sizeMap[DEFAULT_SIZE as keyof typeof sizeMap]; + return ( - + ); }; diff --git a/gui/src/components/PageHeader.tsx b/gui/src/components/PageHeader.tsx index 74dcc2880..93d5a941f 100644 --- a/gui/src/components/PageHeader.tsx +++ b/gui/src/components/PageHeader.tsx @@ -6,9 +6,15 @@ export interface PageHeaderProps { showBorder?: boolean; } -export function PageHeader({ onTitleClick, title }: PageHeaderProps) { +export function PageHeader({ + onTitleClick, + title, + showBorder = true, +}: PageHeaderProps) { return ( -
+
{ @@ -20,7 +20,7 @@ export const FatalErrorIndicator = () => { const configLoading = useAppSelector((state) => state.config.loading); const showConfigPage = () => { - navigate("/config?tab=agents"); + navigate(CONFIG_ROUTES.AGENTS); }; const { selectedProfile } = useAuth(); @@ -64,10 +64,7 @@ export const FatalErrorIndicator = () => { Reload
)} -
+
View
diff --git a/gui/src/components/gui/Alert.tsx b/gui/src/components/gui/Alert.tsx index 108054a59..1dfcf0986 100644 --- a/gui/src/components/gui/Alert.tsx +++ b/gui/src/components/gui/Alert.tsx @@ -70,7 +70,13 @@ const spacingSizes = { lg: "ml-2", }; -function Alert({ type = "info", size = "lg", className, children, ...props }: AlertProps) { +function Alert({ + type = "info", + size = "lg", + className, + children, + ...props +}: AlertProps) { const { Icon, background, border, text, iconColor } = ALERT_CONFIGS[type]; return ( diff --git a/gui/src/components/gui/NumberInput.tsx b/gui/src/components/gui/NumberInput.tsx index 16e70ba6f..4db9596c9 100644 --- a/gui/src/components/gui/NumberInput.tsx +++ b/gui/src/components/gui/NumberInput.tsx @@ -5,6 +5,7 @@ interface NumberInputProps { onChange: (value: number) => void; max: number; min: number; + disabled?: boolean; } const NumberInput: React.FC = ({ @@ -12,26 +13,26 @@ const NumberInput: React.FC = ({ onChange, max, min, + disabled = false, }) => { const [inputValue, setInputValue] = useState(value.toString()); const handleIncrement = () => { - if (value < max) { - const newValue = value + 1; - onChange(newValue); - setInputValue(newValue.toString()); - } + if (disabled || value >= max) return; + const newValue = value + 1; + onChange(newValue); + setInputValue(newValue.toString()); }; const handleDecrement = () => { - if (value > min) { - const newValue = value - 1; - onChange(newValue); - setInputValue(newValue.toString()); - } + if (disabled || value <= min) return; + const newValue = value - 1; + onChange(newValue); + setInputValue(newValue.toString()); }; const handleInputChange = (e: React.ChangeEvent) => { + if (disabled) return; const newInputValue = e.target.value; setInputValue(newInputValue); @@ -51,13 +52,16 @@ const NumberInput: React.FC = ({ }; return ( -
+
= ({ diff --git a/gui/src/components/gui/Select.tsx b/gui/src/components/gui/Select.tsx index 6c04a571a..cb0338eb0 100644 --- a/gui/src/components/gui/Select.tsx +++ b/gui/src/components/gui/Select.tsx @@ -10,6 +10,7 @@ import { vscForeground, vscInputBackground, } from ".."; +import { cn } from "../../util/cn"; // appearance: none; // -webkit-appearance: none; @@ -23,9 +24,9 @@ import { // // gui/src/components/gui/Select.tsx // import React from 'react'; -export const Select: React.FC> = ( - props, -) => ( +export const Select: React.FC< + React.SelectHTMLAttributes +> = ({ className, ...props }) => (
> = ( >