Skip to content

The agent that grows with you

test(desktop): pin that a multi-tab zone can still hide its strip

Brooklyn Nicholsonb0ab2e163a50
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 e1cd93563cb..668c85bf622 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.