From b6041240d1ec55b2279a24b4691cbc7ee71b4e00 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 3 Sep 2026 00:21:36 -0700 Subject: [PATCH] test(desktop): trim Bot Chat pane-focus regression to the two invariant cases Salvage follow-up to #101639 (@helix4u): keep the re-adopt-after-overlay and miss-propagation cases, drop the hidden-pane and healthy-path controls. --- .../src/store/session-pane-focus.test.ts | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/apps/desktop/src/store/session-pane-focus.test.ts b/apps/desktop/src/store/session-pane-focus.test.ts index 92b190a375..0c0b2688b1 100644 --- a/apps/desktop/src/store/session-pane-focus.test.ts +++ b/apps/desktop/src/store/session-pane-focus.test.ts @@ -7,7 +7,6 @@ async function setup() { const session = await import('@/store/session') const states = await import('@/store/session-states') const { paneMirror } = await import('@/app/chat/pane-mirror') - const { openSession } = await import('@/app/open-session') registry.register({ area: 'panes', @@ -39,7 +38,7 @@ async function setup() { states.openSessionTile('canonical-chat', 'center', 'workspace', undefined, scope) - return { model, openSession, scope, session, states, tree } + return { model, scope, session, states, tree } } describe('focusing a saved Bot Chat requires a visible pane', () => { @@ -71,18 +70,6 @@ describe('focusing a saved Bot Chat requires a visible pane', () => { expect(states.sessionTileOwnerRoute('canonical-chat')).toEqual(scope.ownerRoute) }) - it('fronts and un-minimizes a hidden chat instead of leaving its sibling active', () => { - const { model, scope, states, tree } = ctx - tree.$layoutTree.set(model.group(['workspace', paneId], { active: 'workspace', id: 'main', minimized: true })) - tree.setTreePaneHidden(paneId, true) - - expect(states.focusWorkspaceOwnerSessionTile(scope.workspaceOwnerKey, undefined, ['canonical-chat'])).toBe( - 'canonical-chat' - ) - expect(tree.isPaneVisible(paneId)).toBe(true) - expect(model.findGroupOfPane(tree.$layoutTree.get()!, paneId)?.active).toBe(paneId) - }) - it('reports a miss through both helpers if the layout cannot place the saved tab', () => { const { scope, session, states, tree } = ctx tree.$layoutTree.set(null) @@ -92,14 +79,4 @@ describe('focusing a saved Bot Chat requires a visible pane', () => { expect(session.$selectedStoredSessionId.get()).toBe('previous-chat') expect(states.$sessionTiles.get().map(tile => tile.storedSessionId)).toEqual(['canonical-chat']) }) - - it('keeps an existing tab in place and does not navigate or duplicate it', () => { - const { openSession, scope, states, tree } = ctx - const navigate = vi.fn() - openSession('canonical-chat', navigate, 'in-place', scope) - - expect(tree.isPaneVisible(paneId)).toBe(true) - expect(navigate).not.toHaveBeenCalled() - expect(states.$sessionTiles.get().map(tile => tile.storedSessionId)).toEqual(['canonical-chat']) - }) })