diff --git a/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx b/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx index 3aae94fd..1e46cb18 100644 --- a/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx +++ b/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx @@ -49,7 +49,7 @@ import { saveMinimizedShot } from '../desktop/minimizedShots'; import { removeBrowserCardCleanly } from '@/shared/browserTeardown'; import { createSelector } from '@reduxjs/toolkit'; import { useAppDispatch, useAppSelector } from '@/shared/hooks'; -import { handleApproval } from '@/shared/state/agentsSlice'; +import { handleApproval, expandSession } from '@/shared/state/agentsSlice'; import { useClaudeTokens } from '@/shared/styles/ThemeContext'; import { registerWebview, @@ -828,6 +828,9 @@ const BrowserCard: React.FC = ({ const dockTarget = slotHit?.getAttribute('data-browser-slot') || chatHit?.getAttribute('data-select-id') || null; if (dockTarget) { dispatch(setBrowserDocked({ browserId, dockedTo: dockTarget })); + // Chats live as collapsed pills by default; docking into a pill used to park the card at + // -100000 instantly (it just vanished). Open the chat so the drop visibly lands in the slot. + dispatch(expandSession(dockTarget)); } else if (dockedTo) { dispatch(setBrowserDocked({ browserId, dockedTo: null })); } diff --git a/frontend/src/app/pages/Dashboard/cards/DashboardViewCard.tsx b/frontend/src/app/pages/Dashboard/cards/DashboardViewCard.tsx index 4db1dbb0..045a8383 100644 --- a/frontend/src/app/pages/Dashboard/cards/DashboardViewCard.tsx +++ b/frontend/src/app/pages/Dashboard/cards/DashboardViewCard.tsx @@ -17,6 +17,7 @@ import KeyboardArrowUpRounded from '@mui/icons-material/KeyboardArrowUpRounded'; import { Output, SERVE_BASE } from '@/shared/state/outputsSlice'; import { setViewCardPosition, setViewDocked, setViewCardSize, setActiveViewCardId, recordClosedCard, addViewCard, setTiledCard, clearTiledCard, toggleMinimizeCard, activateViewCardPreview } from '@/shared/state/dashboardLayoutSlice'; import { removeViewCardCleanly } from '@/shared/viewTeardown'; +import { expandSession } from '@/shared/state/agentsSlice'; import WindowControls from './WindowControls'; import { openCardContextMenu } from '../desktop/CardContextMenu'; import { useDragEndBackstops } from '../hooks/interaction/useDragEndBackstops'; @@ -431,6 +432,8 @@ const DashboardViewCard: React.FC = ({ const dockTarget = slotHit?.getAttribute('data-browser-slot') || chatHit?.getAttribute('data-select-id') || null; if (dockTarget) { dispatch(setViewDocked({ cardKey, dockedTo: dockTarget })); + // Same as BrowserCard: docking into a collapsed pill must open the chat, not vanish the app. + dispatch(expandSession(dockTarget)); } else if (dockedTo) { dispatch(setViewDocked({ cardKey, dockedTo: null })); }