Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

add blur regression test for drag listener detach\n\nProves that a `blur` event mid-drag cleanly detaches the `pointermove`\nlistener: after `blur`, moving the pointer must not change the sidebar\nwidth.\n

shanudf727c7983ed
diff --git a/app/src/components/layout/shell/RootShellLayout.test.tsx b/app/src/components/layout/shell/RootShellLayout.test.tsx
index cee1b01bad..7c9fdcabb6 100644
--- a/app/src/components/layout/shell/RootShellLayout.test.tsx
+++ b/app/src/components/layout/shell/RootShellLayout.test.tsx
@@ -127,6 +127,19 @@ describe('RootShellLayout — redux-controlled geometry', () => {
expect(panel(store).sidebarWidth).toBe(340);
});
+ it('detaches drag listeners when the window loses focus mid-drag', () => {
+ renderShell({}, withLayout(true, 300));
+ const divider = screen.getByTestId('root-shell-divider');
+
+ fireEvent.pointerDown(divider, { clientX: 500 });
+ // Window loses focus before the pointer is released.
+ fireEvent.blur(window);
+ // Subsequent pointer moves must not affect layout — listeners are detached.
+ fireEvent.pointerMove(window, { clientX: 580 });
+
+ expect(screen.getByTestId('root-shell-sidebar').style.width).toBe('300px');
+ });
+
it('narrows the column to the icon width when collapsed, rather than unmounting it', () => {
const { store } = renderShell({}, withLayout(false, 300));