Skip to content

The agent that grows with you

fix(desktop): stop lighting drop zones a session can't land in

Brooklyn Nicholsone128f1c13116
diff --git a/apps/desktop/src/app/chat/session-drag.test.ts b/apps/desktop/src/app/chat/session-drag.test.ts
index 5e4b7955ee5..c0a642b2799 100644
--- a/apps/desktop/src/app/chat/session-drag.test.ts
+++ b/apps/desktop/src/app/chat/session-drag.test.ts
@@ -110,4 +110,19 @@ describe('session drop targeting across stacked tabs', () => {
expect(requestComposerInsertRefs).not.toHaveBeenCalled()
expect(openSessionTile).not.toHaveBeenCalled()
})
+
+ // Standing side chrome hosts no main tile, so a session has nowhere to land
+ // there. That refusal is load-bearing twice over: the sidebar row runs the
+ // reorder off the SAME press, so the deny is what leaves the list to it,
+ // and ZoneDropOverlay keys off the same test to stay dark over those zones
+ // instead of outlining a drop that would only be refused.
+ it('commits nothing over the sidebar, leaving the region to the reorder', () => {
+ mountStackedTabs()
+ $layoutTree.set(group(['sessions'], { id: 'g1' }))
+
+ dragTo(document.getElementById('row')!, 120, 400)
+
+ expect(requestComposerInsertRefs).not.toHaveBeenCalled()
+ expect(openSessionTile).not.toHaveBeenCalled()
+ })
})
diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.tsx b/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.tsx
index e356aacac04..d22dd513e66 100644
--- a/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.tsx
+++ b/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.tsx
@@ -50,6 +50,7 @@ import {
closeTreeTabsToRight,
collapseTreePane,
isCollapsePane,
+ isMainStripPane,
isSessionStripPane,
noteActiveTreeGroup,
reloadTreePane,
@@ -768,11 +769,20 @@ function ZoneDropOverlay({ node }: { node: GroupNode }) {
}
// A session drag (sidebar row) reuses this exact overlay — over ANY zone
- // now (stack into its tabs / split its edges); only a CHAT zone's center is
- // a link-to-chat (the composer overlay owns that visual).
+ // that hosts a MAIN tile (stack into its tabs / split its edges); only a
+ // CHAT zone's center is a link-to-chat (the composer overlay owns that
+ // visual). Standing side chrome — the sidebar, files, terminal — hosts no
+ // main tile, so a session can't land there: those zones stay DARK rather
+ // than painting an idle outline the drop would only refuse. Same test
+ // `tileZoneHost` (session-drag.ts) resolves the drop with, so what lights
+ // up and what commits cannot disagree.
const sessionDrag = dragging === SESSION_TILE_DRAG
const chatZone = node.panes.some(isSessionStripPane)
+ if (sessionDrag && !chatZone && !node.panes.some(isMainStripPane)) {
+ return null
+ }
+
const isDragSource = node.panes.includes(dragging)
// The source zone, when it holds only the dragged pane, has nothing to drop.