[eric] dock: dropping a browser/app on a collapsed chat pill expands the chat (used to park the card at -100000 = looked like the drop did nothing)

This commit is contained in:
ciregenz
2026-07-28 17:12:04 -07:00
parent ab102bb857
commit c8de032306
2 changed files with 7 additions and 1 deletions
@@ -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<Props> = ({
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 }));
}
@@ -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<Props> = ({
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 }));
}