Skip to content

The agent that grows with you

fix(desktop): force the enforced zone's tab strip visible — repairs the "only Bots shows, Sessions unreachable" regression

Teknium898b42363960
diff --git a/apps/desktop/src/components/pane-shell/tree/dock-enforce.test.ts b/apps/desktop/src/components/pane-shell/tree/dock-enforce.test.ts
index 21a03e431f4..df6b5116e0d 100644
--- a/apps/desktop/src/components/pane-shell/tree/dock-enforce.test.ts
+++ b/apps/desktop/src/components/pane-shell/tree/dock-enforce.test.ts
@@ -165,4 +165,52 @@ describe('enforced dock (stacked Bots pane → sessions-zone tab, every boot)',
expect(group.panes).toEqual(['sessions', 'hermes-bots:pane'])
})
+
+ it('forces the tab strip visible when already co-located but hidden with bots active (community "only Bots shows" regression)', async () => {
+ // The Aug 2026 field reports: sessions+bots already share one group, the
+ // strip is hidden (headerHidden), and bots holds the active tab — the
+ // sessions pane exists but is unreachable. The re-home path never runs
+ // (nothing to move), so the enforce must repair reachability directly.
+ const hiddenStackedTree = {
+ type: 'split',
+ id: 'root',
+ orientation: 'row',
+ weights: [1, 3],
+ children: [
+ {
+ type: 'group',
+ id: 'g-left',
+ panes: ['sessions', 'hermes-bots:pane'],
+ active: 'hermes-bots:pane',
+ headerHidden: true
+ },
+ { type: 'group', id: 'g-main', panes: ['workspace'], active: 'workspace' }
+ ]
+ }
+
+ window.localStorage.setItem(TREE_KEY, JSON.stringify(hiddenStackedTree))
+
+ const tree = await import('@/components/pane-shell/tree/store')
+ const model = await import('@/components/pane-shell/tree/model')
+ const { registry } = await import('@/contrib/registry')
+
+ registry.register({ id: 'workspace', area: 'panes', title: 'chat', data: { placement: 'main' }, render: () => null })
+ registry.register({ id: 'sessions', area: 'panes', title: 'sessions', data: { placement: 'left' }, render: () => null })
+ registry.register({
+ id: 'hermes-bots:pane',
+ area: 'panes',
+ title: 'Bots',
+ data: { placement: 'left', dock: { pane: 'sessions', pos: 'center', enforce: true } },
+ render: () => null
+ })
+
+ tree.watchContributedPanes()
+
+ const group = model.findGroupOfPane(tree.$layoutTree.get()!, 'hermes-bots:pane')!
+
+ // Both panes stay put — but the strip is forced visible so SESSIONS is
+ // reachable again. The active tab is NOT stolen mid-boot.
+ expect(group.panes).toEqual(['sessions', 'hermes-bots:pane'])
+ expect(group.headerHidden).not.toBe(true)
+ })
})
diff --git a/apps/desktop/src/components/pane-shell/tree/store.ts b/apps/desktop/src/components/pane-shell/tree/store.ts
index d6c85ce8561..d91242a65d9 100644
--- a/apps/desktop/src/components/pane-shell/tree/store.ts
+++ b/apps/desktop/src/components/pane-shell/tree/store.ts
@@ -1160,8 +1160,20 @@ function enforceDockedPanes(
const from = findGroupOfPane(next, pane.id)
const anchor = findGroupOfPane(next, dock.pane)
- // Already stacked with its anchor, or the anchor isn't in the tree.
- if (!from || !anchor || from.id === anchor.id) {
+ if (!from || !anchor) {
+ continue
+ }
+
+ if (from.id === anchor.id) {
+ // Already stacked with its anchor — but an enforced tab must be
+ // REACHABLE, not just co-located. Community regression (Aug 2026):
+ // persisted trees where the enforced pane was center-stacked with the
+ // strip hidden and itself active left the ANCHOR invisible with no
+ // strip to switch back ("my ui only shows bots now... cant find the
+ // sessions"). An enforced zone always shows its strip.
+ if (anchor.headerHidden === true) {
+ next = setGroupHeaderHiddenOp(next, anchor.id, false) ?? next
+ }
continue
}