diff --git a/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx b/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx index f6abe9e85..a561d2e1c 100644 --- a/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx +++ b/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx @@ -98,38 +98,38 @@ export function BlockSettingsTopToolbar(props: BlockSettingsTopToolbarProps) { }; return ( -
-
- -
-
- {sections.map((section) => ( - - props.setSelectedSection( - props.selectedSection === section.id ? null : section.id, - ) - } - /> - ))} +
+
+
+ +
+
+ {sections.map((section) => ( + + props.setSelectedSection( + props.selectedSection === section.id ? null : section.id, + ) + } + /> + ))} +
-
- -
+
); } diff --git a/gui/src/components/modelSelection/ModeSelect.tsx b/gui/src/components/modelSelection/ModeSelect.tsx index b2bb16410..196ee2e52 100644 --- a/gui/src/components/modelSelection/ModeSelect.tsx +++ b/gui/src/components/modelSelection/ModeSelect.tsx @@ -8,7 +8,7 @@ import { } from "@heroicons/react/24/outline"; import { MessageModes } from "core"; import { modelSupportsTools } from "core/llm/autodetect"; -import { useEffect } from "react"; +import { useEffect, useMemo } from "react"; import styled from "styled-components"; import { defaultBorderRadius, lightGray, vscInputBackground } from ".."; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; @@ -19,6 +19,7 @@ import { setMode, } from "../../redux/slices/sessionSlice"; import { getFontSize, getMetaKeyLabel, isJetBrains } from "../../util"; +import Shortcut from "../gui/Shortcut"; import { Listbox, ListboxButton, @@ -66,7 +67,13 @@ function ModeSelect() { const mode = useAppSelector(selectCurrentMode); const selectedModel = useAppSelector(selectDefaultModel); const agentModeSupported = selectedModel && modelSupportsTools(selectedModel); - const jetbrains = isJetBrains(); + + const jetbrains = useMemo(() => { + return isJetBrains(); + }, []); + const metaKeyLabel = useMemo(() => { + return getMetaKeyLabel(); + }, []); const getModeIcon = (mode: MessageModes) => { switch (mode) { @@ -151,8 +158,8 @@ function ModeSelect() { )}
- {getMetaKeyLabel()} - . for next mode + {metaKeyLabel} + . for next mode
diff --git a/gui/src/components/modelSelection/ModelSelect.tsx b/gui/src/components/modelSelection/ModelSelect.tsx index f3edc6937..25f80ffb8 100644 --- a/gui/src/components/modelSelection/ModelSelect.tsx +++ b/gui/src/components/modelSelection/ModelSelect.tsx @@ -21,7 +21,6 @@ import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice"; import { fontSize, isMetaEquivalentKeyPressed } from "../../util"; import Shortcut from "../gui/Shortcut"; import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from "../ui"; -import { Divider } from "./platform/shared"; interface ModelOptionProps { option: Option; @@ -283,8 +282,7 @@ function ModelSelect() {
- - +
{selectedProfile?.profileType === "local" && ( <> )} - - +
meta ' to toggle model diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx index 26b19e0d4..76ac06c4e 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx @@ -4,20 +4,25 @@ import { useContext, useEffect, useRef } from "react"; import { useAuth } from "../../../context/Auth"; import { IdeMessengerContext } from "../../../context/IdeMessenger"; import { cycleProfile } from "../../../redux"; -import { useAppDispatch } from "../../../redux/hooks"; +import { useAppDispatch, useAppSelector } from "../../../redux/hooks"; import { fontSize, isMetaEquivalentKeyPressed } from "../../../util"; -import { Popover, PopoverButton, PopoverPanel, Transition } from "../../ui"; +import { Listbox, ListboxButton, ListboxOptions, Transition } from "../../ui"; import AssistantIcon from "./AssistantIcon"; import { AssistantSelectOptions } from "./AssistantSelectOptions"; function AssistantSelectButton(props: { selectedProfile: ProfileDescription }) { + const isLumpToolbarExpanded = useAppSelector( + (state) => state.ui.isBlockSettingsToolbarExpanded, + ); return (
- +
- + {props.selectedProfile.title} Create your first assistant @@ -77,19 +82,19 @@ export default function AssistantSelect() { } return ( - +
- - + - + { if (buttonRef.current) { @@ -97,9 +102,9 @@ export default function AssistantSelect() { } }} /> - +
-
+ ); } diff --git a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx b/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx index c7b9caa80..d22f64cc7 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx @@ -9,8 +9,40 @@ import { selectProfileThunk } from "../../../redux"; import { useAppDispatch } from "../../../redux/hooks"; import { getFontSize, getMetaKeyLabel, isLocalProfile } from "../../../util"; import { ROUTES } from "../../../util/navigation"; +import { ToolTip } from "../../gui/Tooltip"; +import { ListboxOption } from "../../ui"; import AssistantIcon from "./AssistantIcon"; -import { Divider, Option, OptionDiv } from "./shared"; + +import { + ArrowTopRightOnSquareIcon, + Cog6ToothIcon, + ExclamationTriangleIcon, +} from "@heroicons/react/24/outline"; + +// const IconBase = styled.div<{ $hovered: boolean }>` + +// `; + +// const StyledCog6ToothIcon = styled(IconBase).attrs({ as: Cog6ToothIcon })``; +// const StyledArrowTopRightOnSquareIcon = styled(IconBase).attrs({ +// as: ArrowTopRightOnSquareIcon, +// })``; +// const StyledExclamationTriangleIcon = styled(IconBase).attrs({ +// as: ExclamationTriangleIcon, +// })``; + +// width: 1.2em; +// height: 1.2em; +// cursor: pointer; +// padding: 4px; +// border-radius: ${defaultBorderRadius}; +// opacity: ${(props) => (props.$hovered ? 0.75 : 0)}; +// visibility: ${(props) => (props.$hovered ? "visible" : "hidden")}; + +// &:hover { +// opacity: 1; +// background-color: ${lightGray}33; +// } interface AssistantSelectOptionsProps { onClose: () => void; @@ -51,42 +83,82 @@ export function AssistantSelectOptions({
{profiles.map((profile, idx) => { + const disabled = !!profile.errors?.length; + const showConfigure = isLocalProfile(profile); + // const [hovered, setHovered] = useState(false); + + function handleOptionClick(e: any) { + if (disabled) { + e.preventDefault(); + e.stopPropagation(); + } + dispatch(selectProfileThunk(profile.id)); + onClose(); + } + return ( -