From 5a3c8f47f09387516663bec88ca2f319df9031dc Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sun, 6 Apr 2025 16:35:25 -0700 Subject: [PATCH] refresh all button --- .../Lump/BlockSettingsTopToolbar.tsx | 56 +++-- .../platform/AssistantSelect.tsx | 222 ++++++++++-------- 2 files changed, 150 insertions(+), 128 deletions(-) diff --git a/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx b/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx index 64a477cbb..405182086 100644 --- a/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx +++ b/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx @@ -97,32 +97,36 @@ export function BlockSettingsTopToolbar() { return (
-
- -
-
- {sections.map((section) => ( - - setSelectedSection( - selectedSection === section.id ? null : section.id, - ) - } - /> - ))} +
+
+ +
+
+ {sections.map((section) => ( + + setSelectedSection( + selectedSection === section.id ? null : section.id, + ) + } + /> + ))} +
diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx index 7796aff8d..4a81a2265 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx @@ -1,4 +1,5 @@ import { + ArrowPathRoundedSquareIcon, ArrowTopRightOnSquareIcon, BuildingOfficeIcon, ChevronDownIcon, @@ -153,7 +154,7 @@ const AssistantSelectOption = ({ export default function AssistantSelect() { const dispatch = useAppDispatch(); const buttonRef = useRef(null); - const { selectedProfile } = useAuth(); + const { selectedProfile, refreshProfiles } = useAuth(); const currentOrg = useAppSelector(selectCurrentOrg); const ideMessenger = useContext(IdeMessengerContext); const { isToolbarExpanded } = useLump(); @@ -189,8 +190,7 @@ export default function AssistantSelect() { if (now - lastToggleTime >= DEBOUNCE_MS) { lastToggleTime = now; - const profileIds = - currentOrg?.profiles.map((profile) => profile.id) ?? []; + const profileIds = profiles?.map((profile) => profile.id) ?? []; // In case of 1 or 0 profiles just does nothing if (profileIds.length < 2) { return; @@ -242,118 +242,136 @@ export default function AssistantSelect() { } return ( - -
- -
-
- -
- - {selectedProfile.title} - -
-
- - - -
- {profiles?.map((profile, idx) => { - return ( - - ); - })} -
- -
-
- - login(false)} + <> + +
+ +
+
+ +
+ + {selectedProfile.title} + +
+
+ + + +
+ {profiles?.map((profile, idx) => { + return ( + + ); + })} +
+ +
+ +
+ login(false)} + > +
+ + New Assistant +
+
+
+ { + e.stopPropagation(); + refreshProfiles(); + buttonRef.current?.click(); + }} + /> +
+
+ +
+ +
- - New Assistant -
- - -
- -
- - {getMetaKeyLabel()} ⇧ ' to toggle - -
navigate(ROUTES.CONFIG)} - > - {currentOrg?.iconUrl ? ( - - ) : ( - - )} - {currentOrg?.name || "Personal"} + {getMetaKeyLabel()} ⇧ ' to toggle +
navigate(ROUTES.CONFIG)} + > + {currentOrg?.iconUrl ? ( + + ) : ( + + )} + + {currentOrg?.name || "Personal"} + +
-
- - -
- + + +
+ + + Refresh orgs/assistants + + ); }