From 6034217ea153fabf6edeb1bb870cbdf5cf8bc5ec Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 17 Sep 2025 18:24:06 -0700 Subject: [PATCH] feat: add block icons back to lump (#7789) * feat: add block icons back to lump * prettier * Update index.tsx --- .../AssistantOption.tsx | 21 ++++- .../OrganizationOption.tsx | 22 ++++- .../AssistantAndOrgListbox/index.tsx | 34 +------- .../LumpToolbar/BlockSettingsTopToolbar.tsx | 80 +++++++++++++++++- .../components/modelSelection/ModelSelect.tsx | 81 +++++++++++-------- gui/src/components/modelSelection/Toggle.tsx | 57 ------------- gui/src/pages/config/index.tsx | 14 +--- 7 files changed, 169 insertions(+), 140 deletions(-) delete mode 100644 gui/src/components/modelSelection/Toggle.tsx diff --git a/gui/src/components/AssistantAndOrgListbox/AssistantOption.tsx b/gui/src/components/AssistantAndOrgListbox/AssistantOption.tsx index 35ce80c7e..e811a9217 100644 --- a/gui/src/components/AssistantAndOrgListbox/AssistantOption.tsx +++ b/gui/src/components/AssistantAndOrgListbox/AssistantOption.tsx @@ -1,4 +1,7 @@ -import { ExclamationTriangleIcon } from "@heroicons/react/24/outline"; +import { + Cog6ToothIcon, + ExclamationTriangleIcon, +} from "@heroicons/react/24/outline"; import { ProfileDescription } from "core/config/ProfileLifecycleManager"; import { useContext, useMemo } from "react"; import { useNavigate } from "react-router-dom"; @@ -48,7 +51,7 @@ export function AssistantOption({ disabled={hasFatalErrors} onClick={!hasFatalErrors ? handleOptionClick : undefined} fontSizeModifier={-2} - className={selected ? "bg-list-active text-list-active-foreground" : ""} + className={`group ${selected ? "bg-list-active text-list-active-foreground" : ""}`} >
@@ -62,6 +65,20 @@ export function AssistantOption({
+ {profile.errors && profile.errors?.length > 0 && (
diff --git a/gui/src/components/AssistantAndOrgListbox/index.tsx b/gui/src/components/AssistantAndOrgListbox/index.tsx index 5629df5aa..55db674be 100644 --- a/gui/src/components/AssistantAndOrgListbox/index.tsx +++ b/gui/src/components/AssistantAndOrgListbox/index.tsx @@ -2,9 +2,7 @@ import { ArrowPathIcon, ArrowRightStartOnRectangleIcon, Cog6ToothIcon, - PencilIcon, PlusIcon, - WrenchScrewdriverIcon, } from "@heroicons/react/24/outline"; import { isOnPremSession } from "core/control-plane/AuthTypes"; import { useContext, useEffect, useRef } from "react"; @@ -155,7 +153,7 @@ export function AssistantAndOrgListbox({ className="max-h-32 -translate-x-1.5 overflow-y-auto pb-0" style={{ zIndex: 200 }} > -
+
Agents @@ -193,7 +191,7 @@ export function AssistantAndOrgListbox({ {shouldRenderOrgInfo && ( <> -
+
Organizations @@ -232,34 +230,6 @@ export function AssistantAndOrgListbox({ {/* Settings Section */} {variant !== "sidebar" && (
- -
); @@ -245,8 +259,21 @@ function ModelSelect() { /> -
- Models +
+ Models +
+ +
@@ -274,36 +301,26 @@ function ModelSelect() { {!isConfigLoading && ( <> - - {selectedProfile?.profileType === "local" && ( - - - - Add Chat model - - + <> + + + + + Add Chat model + + + )} - - - - Configure models - - -
+
{getMetaKeyLabel()}' to toggle model diff --git a/gui/src/components/modelSelection/Toggle.tsx b/gui/src/components/modelSelection/Toggle.tsx deleted file mode 100644 index 02f99e974..000000000 --- a/gui/src/components/modelSelection/Toggle.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import styled from "styled-components"; -import { - defaultBorderRadius, - lightGray, - vscInputBackground, - vscListActiveBackground, - vscListActiveForeground, -} from ".."; - -const TopDiv = styled.div` - display: flex; - align-items: center; - text-align: center; - margin: auto; - width: fit-content; - cursor: pointer; - - border: 1px solid ${lightGray}; - - background-color: ${vscInputBackground}; - border-radius: ${defaultBorderRadius}; - - &:hover { - background-color: ${lightGray}55; - } -`; - -const SubDiv = styled.div<{ selected: boolean }>` - text-align: center; - padding: 8px 12px; - border-radius: ${defaultBorderRadius}; - - transition: all 0.2s ease-in-out; - - ${(props) => - props.selected && - ` - background-color: ${vscListActiveBackground}; - color: ${vscListActiveForeground}; - `} -`; - -function Toggle(props: { - optionOne: string; - optionTwo: string; - selected: boolean; - onClick: () => void; -}) { - return ( - - {props.optionOne} - {props.optionTwo} - - ); -} - -export default Toggle; diff --git a/gui/src/pages/config/index.tsx b/gui/src/pages/config/index.tsx index 4e654566f..953184d7d 100644 --- a/gui/src/pages/config/index.tsx +++ b/gui/src/pages/config/index.tsx @@ -1,5 +1,5 @@ import { isOnPremSession } from "core/control-plane/AuthTypes"; -import React, { useEffect, useState } from "react"; +import React, { useState } from "react"; import { useNavigate, useSearchParams } from "react-router-dom"; import { AssistantAndOrgListbox } from "../../components/AssistantAndOrgListbox"; import Alert from "../../components/gui/Alert"; @@ -14,17 +14,11 @@ function ConfigPage() { useNavigationListener(); const navigate = useNavigate(); const [searchParams] = useSearchParams(); - const [activeTab, setActiveTab] = useState("settings"); + const [activeTab, setActiveTab] = useState(() => { + return searchParams.get("tab") || "settings"; + }); const { session, organizations } = useAuth(); - // Set initial tab from URL parameter - useEffect(() => { - const tab = searchParams.get("tab"); - if (tab) { - setActiveTab(tab); - } - }, [searchParams]); - const allTabs = getAllTabs(); const shouldRenderOrgInfo = session && organizations.length > 1 && !isOnPremSession(session);