fix(desktop): restore hidden tab bar from sidebar row menu - #81638
fix(desktop): restore hidden tab bar from sidebar row menu#8163812312ewqdq wants to merge 1 commit into
Conversation
|
Ran into the same trap from a different direction, and your diagnosis matches mine exactly — the hide takes the strip, and the strip is the only host of the zone menu. One gap worth flagging: I've opened #84458 for that case: a top-edge reveal strip on the zone itself, so it doesn't depend on any other surface existing. It's the gesture I think they're complementary rather than competing — yours gives the chat case a discoverable menu item, mine gives every other zone class an affordance. But if maintainers would rather have one mechanism, mine is zone-agnostic and would cover the workspace too; happy to adapt or fold it in whichever way is preferred. |
What does this PR do?
The main tab's context menu offers "Hide tab bar" — but once the bar is hidden, that menu disappears with it, and the session tile swallows right-clicks on the chat body (
stopPropagationin session-tile.tsx), so the zone menu's "Show header" is unreachable too. The only escape was Ctrl+T (a new tab force-pins the header back on), which is undiscoverable.This PR adds the symmetrical restore: the sidebar session row menu (kebab ⋮ + right-click — always reachable, independent of the tab bar) shows "Show tab bar" whenever the workspace zone's header is explicitly hidden, and clicking it flips
headerHiddenback off.Why the sidebar: it is the only menu surface that does not depend on the tab bar existing. The menu item reads
isWorkspaceTabBarHidden()lazily at menu-open time (.get(), no$layoutTreerender subscription — that is a documented perf red line, see tree-group.tsx), and only surfaces for an explicit hide (headerHidden === true); a lone pane's auto-hide default is not treated as user state to restore.Related Issue
No existing issue filed — this is a trapped-state bug found while using the desktop app. Happy to file one if maintainers prefer.
Type of Change
Changes Made
apps/desktop/src/components/pane-shell/tree/store.ts— addisWorkspaceTabBarHidden()(read-only,.get()-based) andshowWorkspaceTabBar()(symmetrical restore viasetTreeGroupHeaderHidden(false)).apps/desktop/src/app/chat/sidebar/session-actions-menu.tsx— render "Show tab bar" item (iconeye) in the session menu when the workspace header is explicitly hidden; callsshowWorkspaceTabBar().apps/desktop/src/i18n/{types,en,zh,ar}.ts— addshowTabBarstring (en/zh/ar translated; ja/zh-hant fall back to English viadefineLocale).apps/desktop/src/app/chat/sidebar/session-actions-menu.test.tsx— 2 new tests: item appears only while hidden + click restores; absent while visible.How to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass (n/a — renderer-only change)Documentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AVerification (local, Windows 11)
npm run test:ui -- src/app/chat/sidebar/session-actions-menu.test.tsx→ 3/3 passnpx tsc -p . --noEmit→ no errorsnpx eslinton changed files → no issuesnpx prettier --checkon changed files → all formattedorigin/main(no conflicts; upstream did not touch these files)Known limitations
ja/zh-hantlocales lack the new key and fall back to English viadefineLocalemerge (consistent with howhideTabBaris handled there today).showWorkspaceTabBar()when already visible is a guarded no-op.