diff --git a/gui/src/components/InventoryPreview.tsx b/gui/src/components/InventoryPreview.tsx index 7444656cae..b9516b9851 100644 --- a/gui/src/components/InventoryPreview.tsx +++ b/gui/src/components/InventoryPreview.tsx @@ -1,51 +1,35 @@ -import { Link, useNavigate } from "react-router-dom"; -import { useContext } from "react"; import { getLogoPath } from "@/pages/welcome/setup/ImportExtensions"; -import { IdeMessengerContext } from "@/context/IdeMessenger"; -import { ShortcutButton } from "./ui/shortcutButton"; -import { useSelector } from "react-redux"; -import { RootState } from "@/redux/store"; -import { getMetaKeyLabel } from "@/util"; -const InventoryPreview = () => { - const navigate = useNavigate(); - const ideMessenger = useContext(IdeMessengerContext); - const historyLength = useSelector((state: RootState) => state.state.history.length); - - const menuItems = [ - { - icon: "chat-default.svg", - path: "/inventory/aiderMode", - tooltip: "Inventory", - command: "pearai.toggleInventoryHome", - }, - { - icon: "creator-default.svg", - path: "/inventory/aiderMode", - tooltip: "Creator", - command: "pearai.toggleCreator", - }, - { - icon: "search-default.svg", - path: "/inventory/perplexityMode", - tooltip: "Search", - command: "pearai.toggleSearch", - }, - { - icon: "memory-default.svg", - path: "/inventory/mem0Mode", - tooltip: "Memory", - command: "pearai.toggleMem0", - } - ]; - - const openInventory = () => { - ideMessenger.post("openInventoryHome", undefined); - }; +const menuItems = [ + { + icon: "chat-default.svg", + path: "/inventory/aiderMode", + tooltip: "Inventory", + command: "pearai.toggleInventoryHome", + }, + { + icon: "creator-default.svg", + path: "/inventory/aiderMode", + tooltip: "Creator", + command: "pearai.toggleCreator", + }, + { + icon: "search-default.svg", + path: "/inventory/perplexityMode", + tooltip: "Search", + command: "pearai.toggleSearch", + }, + { + icon: "memory-default.svg", + path: "/inventory/mem0Mode", + tooltip: "Memory", + command: "pearai.toggleMem0", + } +]; +const InventoryPreview = () => { return ( -
- +
@@ -57,7 +41,7 @@ const InventoryPreview = () => { boxShadow: 'inset 0px 0px 0px 1px rgba(255, 255, 255, 0.1)' }} /> -
+
{menuItems.map((item, index) => (
{ ))}
- - {/*
- -
*/}
diff --git a/gui/src/components/ProfileSwitcher.tsx b/gui/src/components/ProfileSwitcher.tsx index 5a1eff47d6..4990a3e4b8 100644 --- a/gui/src/components/ProfileSwitcher.tsx +++ b/gui/src/components/ProfileSwitcher.tsx @@ -1,9 +1,8 @@ import { Listbox, Transition } from "@headlessui/react"; import { ChevronUpDownIcon, - Cog6ToothIcon, CogIcon, - UserCircleIcon, + UserCircleIcon } from "@heroicons/react/24/outline"; import { ProfileDescription } from "core/config/ConfigHandler"; import { Fragment, useContext, useEffect, useState } from "react"; @@ -235,7 +234,7 @@ function ProfileSwitcher(props: {}) { {/* Settings button (either opens config.json or /settings page in control plane) */} { if (selectedProfileId === "local") { ideMessenger.post("openConfigJson", undefined); @@ -254,6 +253,7 @@ function ProfileSwitcher(props: {}) { {/* Only show login if beta explicitly enabled */} {controlServerBetaEnabled && ( { const navigate = useNavigate(); @@ -23,14 +23,14 @@ const StatusBar = () => { }); return ( -
+
{/* Indexing Progress Bar */}
{/* Header Controls */} -
+
@@ -38,7 +38,7 @@ const StatusBar = () => { { navigate(location.pathname === "/help" ? "/" : "/help"); }} diff --git a/gui/src/components/modelSelection/ModelSelect.tsx b/gui/src/components/modelSelection/ModelSelect.tsx index 72edb55fff..f144c3bebb 100644 --- a/gui/src/components/modelSelection/ModelSelect.tsx +++ b/gui/src/components/modelSelection/ModelSelect.tsx @@ -1,16 +1,17 @@ +import { isAiderMode } from "@/util/bareChatMode"; import { Listbox } from "@headlessui/react"; import { - ChevronDownIcon, CubeIcon, PlusIcon, - TrashIcon, + TrashIcon } from "@heroicons/react/24/outline"; import { useContext, useEffect, useRef, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { useLocation, useNavigate } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; import styled from "styled-components"; -import { defaultBorderRadius, lightGray, vscEditorBackground } from ".."; +import { lightGray, vscEditorBackground } from ".."; import { IdeMessengerContext } from "../../context/IdeMessenger"; +import { providers } from "../../pages/AddNewModel/configs/providers"; import { defaultModelSelector } from "../../redux/selectors/modelSelectors"; import { setDefaultModel } from "../../redux/slices/stateSlice"; import { @@ -24,16 +25,13 @@ import { isMetaEquivalentKeyPressed, } from "../../util"; import ConfirmationDialog from "../dialogs/ConfirmationDialog"; -import { isAiderMode, isPerplexityMode } from "@/util/bareChatMode"; -import { providers } from "../../pages/AddNewModel/configs/providers"; const StyledListboxButton = styled(Listbox.Button)` border: solid 1px ${lightGray}30; - // background-color: ${lightGray}30; background-color: transparent; - border-radius: 4px; + border-radius: 4px; padding: 2px 4px; - display: flex; + margin: 0 2px; align-items: center; gap: 2px; user-select: none; @@ -51,7 +49,7 @@ const StyledListboxOptions = styled(Listbox.Options) <{ newSession: boolean }>` white-space: nowrap; cursor: default; z-index: 50; - border: 1px solid ${lightGray}30; + border: 1px solid ${lightGray}30; border-radius: 10px; background-color: ${vscEditorBackground}; max-height: 300px; @@ -177,7 +175,7 @@ function ModelOption({ ) : ( option.provider ? : )} {option.title} @@ -302,7 +300,7 @@ function ModelSelect() { dispatch(setDefaultModel({ title: val })); }} as="div" - className="relative inline-block" + className="flex max-w-[75%]" > {({ open }) => { useEffect(() => { @@ -313,10 +311,10 @@ function ModelSelect() { <> {defaultModel?.provider === 'pearai_server' ? ( -
+
}
) : ( @@ -350,7 +348,9 @@ function ModelSelect() { }} /> )} - {modelSelectTitle(defaultModel) || "Select model"}{" "} + + {modelSelectTitle(defaultModel) || "Select model"}{" "} + {open && ( diff --git a/gui/src/pages/gui.tsx b/gui/src/pages/gui.tsx index 07714d2cc8..b4518f9382 100644 --- a/gui/src/pages/gui.tsx +++ b/gui/src/pages/gui.tsx @@ -1,3 +1,9 @@ +import InventoryPreview from "@/components/InventoryPreview"; +import ShortcutContainer from "@/components/ShortcutContainer"; +import StatusBar from "@/components/StatusBar"; +import WarningCard from "@/components/ui/warningcard"; +import { setActiveFilePath } from "@/redux/slices/uiStateSlice"; +import { getLocalStorage, setLocalStorage } from "@/util/localStorage"; import { BackspaceIcon, ChatBubbleOvalLeftIcon, @@ -49,21 +55,13 @@ import { isMetaEquivalentKeyPressed, } from "../util"; import { FREE_TRIAL_LIMIT_REQUESTS } from "../util/freeTrial"; -import { getLocalStorage, setLocalStorage } from "@/util/localStorage"; import OnboardingTutorial from "./onboarding/OnboardingTutorial"; -import StatusBar from "@/components/StatusBar"; -import InventoryPreview from "@/components/InventoryPreview"; -import { setActiveFilePath } from "@/redux/slices/uiStateSlice"; -import WarningCard from "@/components/ui/warningcard"; -import ShortcutContainer from "@/components/ShortcutContainer"; const LENGTHY_MESSAGE_WARNING_INDEX = 14; // number of messages after which we show the warning card export const TopGuiDiv = styled.div<{ isNewSession: boolean }>` overflow-y: scroll; position: relative; - margin-top: -40px; - padding-top: 48px; scrollbar-width: none; &::-webkit-scrollbar { display: none; @@ -229,11 +227,11 @@ function GUI() { const scrollTop = topGuiDivRef.current.scrollTop; const height = inputContainerRef.current.offsetHeight; const newPadding = isNewSession ? '0px' : `${height + 20}px`; - + topGuiDivRef.current.style.paddingBottom = '0px'; topGuiDivRef.current.offsetHeight; topGuiDivRef.current.style.paddingBottom = newPadding; - + topGuiDivRef.current.scrollTop = scrollTop; } }); @@ -368,12 +366,9 @@ function GUI() { } -
-
- -
+ +
+
@@ -383,7 +378,6 @@ function GUI() { return ( - { @@ -414,7 +408,6 @@ function GUI() {
) : ( - //
)} - - - //
)}
@@ -501,8 +491,8 @@ function GUI() { })} {!active && ( - {