From b0ab2e163a50d4e6c36507eba955a6067fde6abc Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Fri, 4 Sep 2026 14:33:04 -0500 Subject: [PATCH] test(desktop): pin that a multi-tab zone can still hide its strip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resolver's own suite only ever asserted `never` against a LONE pane, so the whole-stack stranding check passed every existing case while Hide tabs was dead in the one zone users keep tabs in. Adds the missing count: an explicit `never` is honored once a closeable tile has a neighbor to cycle to, and those same stacks still paint their strip on auto (the rung resolves before `mode`, so a stack it stops claiming has to reach the auto rule). Verified as a tripwire — reverting the resolver fails the first case. --- .../tree/renderer/strip-visibility.test.ts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/strip-visibility.test.ts b/apps/desktop/src/components/pane-shell/tree/renderer/strip-visibility.test.ts index e1cd93563c..668c85bf62 100644 --- a/apps/desktop/src/components/pane-shell/tree/renderer/strip-visibility.test.ts +++ b/apps/desktop/src/components/pane-shell/tree/renderer/strip-visibility.test.ts @@ -37,7 +37,7 @@ describe('the stored choice', () => { // force-visible rule, so hiding a zone that held only a closeable tile left a // surface with no tab, no ✕ and no menu — the "how do I get it back" reports. describe('no dead zone', () => { - it('keeps the strip for a closeable tile even when the zone says never', () => { + it('keeps the strip for a lone closeable tile even when the zone says never', () => { expect(resolveTabStripVisible({ mode: 'never', shown: [tile()] })).toBe(true) }) @@ -60,6 +60,26 @@ describe('no dead zone', () => { }) }) +// The regression the rung above caused on its way to holding that invariant. +// The stranding check ran over the whole stack, so ONE closeable tile anywhere +// in a zone pinned the strip on at any tab count — and main is where tabs +// accumulate. Hide tabs (menu row AND ⌘⌥T) silently did nothing there, which +// reads as "hide tabs is broken", not as a stranding bug. +describe('hiding a stack that has other handles', () => { + it('honors never once a closeable tile has a neighbor to cycle to', () => { + expect(resolveTabStripVisible({ mode: 'never', shown: [workspace(), tile()] })).toBe(false) + expect(resolveTabStripVisible({ mode: 'never', shown: [tile(), tile()] })).toBe(false) + expect(resolveTabStripVisible({ mode: 'never', shown: [workspace(), tile(), tile()] })).toBe(false) + }) + + it('leaves those same stacks alone on auto', () => { + // The stranding rung is resolved before `mode`, so a stack it no longer + // claims must still reach the auto rule and keep its strip. + expect(resolveTabStripVisible({ shown: [workspace(), tile()] })).toBe(true) + expect(resolveTabStripVisible({ shown: [tile(), tile()] })).toBe(true) + }) +}) + // A full-page view is not a tab-able surface, and it lifts itself the moment // the chat comes back — so it outranks even the stranding rule and, unlike // `mode`, is never written to the tree.