diff --git a/gui/src/components/modelSelection/ModelSelect.tsx b/gui/src/components/modelSelection/ModelSelect.tsx index a2b6d72e3..00ced3d60 100644 --- a/gui/src/components/modelSelection/ModelSelect.tsx +++ b/gui/src/components/modelSelection/ModelSelect.tsx @@ -6,14 +6,17 @@ import { PlusIcon, } from "@heroicons/react/24/outline"; import { useContext, useEffect, useRef, useState } from "react"; -import { lightGray } from ".."; 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"; -import { getMetaKeyLabel, isMetaEquivalentKeyPressed } from "../../util"; +import { + fontSize, + getMetaKeyLabel, + isMetaEquivalentKeyPressed, +} from "../../util"; import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from "../ui"; interface ModelOptionProps { @@ -48,15 +51,6 @@ function ModelOption({ }: ModelOptionProps) { const ideMessenger = useContext(IdeMessengerContext); - const [hovered, setHovered] = useState(false); - - function onClickGear(e: any) { - e.stopPropagation(); - e.preventDefault(); - - ideMessenger.post("config/openProfile", { profileId: undefined }); - } - function handleOptionClick(e: any) { if (showMissingApiKeyMsg) { e.preventDefault(); @@ -69,33 +63,21 @@ function ModelOption({ key={idx} disabled={showMissingApiKeyMsg} value={option.value} - onMouseEnter={() => setHovered(true)} - onMouseLeave={() => setHovered(false)} onClick={handleOptionClick} > -
-
-
- - - {option.title} - {showMissingApiKeyMsg && ( - - (Missing API key) - - )} - -
-
- - -
+
+
+ + + {option.title} + {showMissingApiKeyMsg && ( + (Missing API key) + )} +
+
); @@ -106,6 +88,11 @@ function ModelSelect() { const isInEdit = useAppSelector((store) => store.session.isInEdit); const config = useAppSelector((state) => state.config.config); + const ideMessenger = useContext(IdeMessengerContext); + const buttonRef = useRef(null); + const [options, setOptions] = useState([]); + const [sortedOptions, setSortedOptions] = useState([]); + const { selectedProfile } = useAuth(); let selectedModel = null; let allModels = null; @@ -120,11 +107,6 @@ function ModelSelect() { allModels = config.modelsByRole.chat; } - const buttonRef = useRef(null); - const [options, setOptions] = useState([]); - const [sortedOptions, setSortedOptions] = useState([]); - const { selectedProfile } = useAuth(); - // Sort so that options without an API key are at the end useEffect(() => { const alphaSort = options.sort((a, b) => a.title.localeCompare(b.title)); @@ -230,8 +212,20 @@ function ModelSelect() { aria-hidden="true" /> - -
+ +
+ Models + + ideMessenger.post("config/openProfile", { + profileId: undefined, + }) + } + /> +
+ +
{sortedOptions.map((option, idx) => ( -
- {selectedProfile?.profileType === "local" && ( - <> - -
- - Add Chat model -
-
- - )} + {selectedProfile?.profileType === "local" && ( + +
+ + Add Chat model +
+
+ )} - - {getMetaKeyLabel()}' to toggle model - +
+ {getMetaKeyLabel()}' to toggle model
diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx index 194346045..a9a3b9e58 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx @@ -32,7 +32,6 @@ import { import type { ProfileDescription } from "core/config/ConfigHandler"; import { useNavigate } from "react-router-dom"; -import { vscCommandCenterInactiveBorder } from "../.."; import { cn } from "../../../util/cn"; import { ROUTES } from "../../../util/navigation"; import { useLump } from "../../mainInput/Lump/LumpContext"; @@ -116,7 +115,7 @@ const AssistantSelectOption = ({ {profile.errors && profile.errors?.length > 0 && ( { e.preventDefault(); e.stopPropagation(); @@ -292,7 +291,7 @@ export default function AssistantSelect() {
- Assistants + Assistants
{ @@ -328,18 +327,11 @@ export default function AssistantSelect() {
-
-
login(false)} >
-
-