From 45e84f9968faa981bcb0c7fae97e69992d1c0394 Mon Sep 17 00:00:00 2001 From: Zane <75694352+zanesq@users.noreply.github.com> Date: Tue, 10 Feb 2026 17:06:25 -0800 Subject: [PATCH] fix extension selector syncing issues (#7133) --- ui/desktop/src/components/GooseSidebar/AppSidebar.tsx | 6 ++++-- .../bottom_menu/BottomMenuExtensionSelection.tsx | 10 ---------- ui/desktop/src/hooks/useChatStream.ts | 1 + ui/desktop/src/sessions.ts | 3 --- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/ui/desktop/src/components/GooseSidebar/AppSidebar.tsx b/ui/desktop/src/components/GooseSidebar/AppSidebar.tsx index 65a58cea..b80fd519 100644 --- a/ui/desktop/src/components/GooseSidebar/AppSidebar.tsx +++ b/ui/desktop/src/components/GooseSidebar/AppSidebar.tsx @@ -437,14 +437,16 @@ const AppSidebar: React.FC = ({ currentPath }) => { } else { isCreatingSessionRef.current = true; try { - await startNewSession('', setView, getInitialWorkingDir()); + await startNewSession('', setView, getInitialWorkingDir(), { + allExtensions: configContext.extensionsList, + }); } finally { setTimeout(() => { isCreatingSessionRef.current = false; }, 1000); } } - }, [setView, clearUnread]); + }, [setView, clearUnread, configContext.extensionsList]); useEffect(() => { const handleTriggerNewChat = () => { diff --git a/ui/desktop/src/components/bottom_menu/BottomMenuExtensionSelection.tsx b/ui/desktop/src/components/bottom_menu/BottomMenuExtensionSelection.tsx index d4368ac6..46812108 100644 --- a/ui/desktop/src/components/bottom_menu/BottomMenuExtensionSelection.tsx +++ b/ui/desktop/src/components/bottom_menu/BottomMenuExtensionSelection.tsx @@ -34,24 +34,14 @@ export const BottomMenuExtensionSelection = ({ sessionId }: BottomMenuExtensionS const isHubView = !sessionId; useEffect(() => { - const handleSessionLoaded = () => { - setTimeout(() => { - setRefreshTrigger((prev) => prev + 1); - }, 500); - }; - const handleExtensionsLoaded = () => { setRefreshTrigger((prev) => prev + 1); }; - window.addEventListener(AppEvents.SESSION_CREATED, handleSessionLoaded); window.addEventListener(AppEvents.SESSION_EXTENSIONS_LOADED, handleExtensionsLoaded); - window.addEventListener(AppEvents.MESSAGE_STREAM_FINISHED, handleSessionLoaded); return () => { - window.removeEventListener(AppEvents.SESSION_CREATED, handleSessionLoaded); window.removeEventListener(AppEvents.SESSION_EXTENSIONS_LOADED, handleExtensionsLoaded); - window.removeEventListener(AppEvents.MESSAGE_STREAM_FINISHED, handleSessionLoaded); }; }, []); diff --git a/ui/desktop/src/hooks/useChatStream.ts b/ui/desktop/src/hooks/useChatStream.ts index 21499e26..aa0d1497 100644 --- a/ui/desktop/src/hooks/useChatStream.ts +++ b/ui/desktop/src/hooks/useChatStream.ts @@ -460,6 +460,7 @@ export function useChatStream({ const extensionResults = resumeData?.extension_results; showExtensionLoadResults(extensionResults); + window.dispatchEvent(new CustomEvent(AppEvents.SESSION_EXTENSIONS_LOADED)); dispatch({ type: 'SESSION_LOADED', diff --git a/ui/desktop/src/sessions.ts b/ui/desktop/src/sessions.ts index 13c01096..9d9dcf98 100644 --- a/ui/desktop/src/sessions.ts +++ b/ui/desktop/src/sessions.ts @@ -84,9 +84,6 @@ export async function startNewSession( ): Promise { const session = await createSession(workingDir, options); window.dispatchEvent(new CustomEvent(AppEvents.SESSION_CREATED, { detail: { session } })); - window.dispatchEvent( - new CustomEvent(AppEvents.SESSION_EXTENSIONS_LOADED, { detail: { session } }) - ); const initialMessage = initialText ? { msg: initialText, images: [] } : undefined;