diff --git a/workspaces/augment/plugins/augment/src/components/AugmentPage/ChatView.tsx b/workspaces/augment/plugins/augment/src/components/AugmentPage/ChatView.tsx index 09a537af4d..bdbfb1c45f 100644 --- a/workspaces/augment/plugins/augment/src/components/AugmentPage/ChatView.tsx +++ b/workspaces/augment/plugins/augment/src/components/AugmentPage/ChatView.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useState, useCallback, useEffect, type Ref } from 'react'; +import { useState, useCallback, useEffect, useRef, type Ref } from 'react'; import Box from '@mui/material/Box'; import LinearProgress from '@mui/material/LinearProgress'; import Alert from '@mui/material/Alert'; @@ -97,6 +97,8 @@ export function ChatView({ const [currentAgent, setCurrentAgent] = useState(); const [showMarketplace, setShowMarketplace] = useState(true); const [marketplaceRefreshKey, setMarketplaceRefreshKey] = useState(0); + const [switchToMyAgents, setSwitchToMyAgents] = useState(0); + const justCreatedRef = useRef(false); // Agent creation state (all dialogs live in the front door) const [intentDialogOpen, setIntentDialogOpen] = useState(false); @@ -201,6 +203,10 @@ export function ChatView({ const handleWizardBack = useCallback(() => { setWizardOpen(false); setWizardDeployMethod(undefined); + if (justCreatedRef.current) { + justCreatedRef.current = false; + return; + } setIntentDialogOpen(true); }, []); @@ -236,12 +242,14 @@ export function ChatView({ }, []); const handleAgentCreated = useCallback(() => { + justCreatedRef.current = true; setWizardOpen(false); setWizardDeployMethod(undefined); setCreateSuccess( 'Agent created successfully! It will appear in your agents list.', ); setMarketplaceRefreshKey(k => k + 1); + setSwitchToMyAgents(k => k + 1); }, []); // --- Tool Creation Flow --- @@ -322,6 +330,7 @@ export function ChatView({ onOpenCommandCenter={handleSwitchToAdmin} onOpenGuidedTour={handleOpenGuidedTour} refreshKey={marketplaceRefreshKey} + switchToMyAgentsKey={switchToMyAgents} /> )} diff --git a/workspaces/augment/plugins/augment/src/components/Marketplace/MarketplacePage.tsx b/workspaces/augment/plugins/augment/src/components/Marketplace/MarketplacePage.tsx index 9e0331e134..245c47b53f 100644 --- a/workspaces/augment/plugins/augment/src/components/Marketplace/MarketplacePage.tsx +++ b/workspaces/augment/plugins/augment/src/components/Marketplace/MarketplacePage.tsx @@ -50,6 +50,8 @@ interface MarketplacePageProps { onOpenCommandCenter?: () => void; onOpenGuidedTour?: () => void; refreshKey?: number; + /** When this key changes, automatically switch to the My Agents tab */ + switchToMyAgentsKey?: number; } /** @@ -66,6 +68,7 @@ export function MarketplacePage({ onOpenCommandCenter, onOpenGuidedTour, refreshKey, + switchToMyAgentsKey, }: MarketplacePageProps) { const theme = useTheme(); const isDark = theme.palette.mode === 'dark'; @@ -120,6 +123,12 @@ export function MarketplacePage({ }; }, [api, refreshKey]); + useEffect(() => { + if (switchToMyAgentsKey && switchToMyAgentsKey > 0) { + setActiveTab('my-agents'); + } + }, [switchToMyAgentsKey]); + const frameworks = useMemo(() => { const set = new Set(); agents.forEach(a => {