From e7af8e695847571745337c366364cdb9c315d296 Mon Sep 17 00:00:00 2001 From: AstroHan Date: Sun, 6 Sep 2026 13:53:37 +0800 Subject: [PATCH 1/2] test(desktop): record the sixth session-workbar E2E in the budget #4694 added 'right workbar visibility belongs to each Session and survives reload' to session-workbar.spec.ts without updating e2e-budget.json, so check:e2e-budget fails on main (5 recorded, 6 present). Its CI ran on a base that predated #4877's budget check. The test needs Electron: the per-Session collapse bit has to survive a renderer reload, which the budget policy lists explicitly. Record it and name the mechanism. Generated-by: Claude Code --- apps/desktop/e2e-budget.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/desktop/e2e-budget.json b/apps/desktop/e2e-budget.json index 383cff4e3c..bdc49d7bde 100644 --- a/apps/desktop/e2e-budget.json +++ b/apps/desktop/e2e-budget.json @@ -30,8 +30,8 @@ "electron": "needs a second real Session (Host round trip) to switch to; the focus and draft-restore halves alone would not earn a window" }, "session-workbar.spec.ts": { - "tests": 5, - "electron": "Git changes re-read on window focus, terminal PTY ownership across Sessions, Side Chat's fork lifecycle, and a first send that has to reach the Host; the composer-usage test is renderer-only and rides along on those windows until app-shell.tsx's composer-to-workbar wiring has a story host" + "tests": 6, + "electron": "Git changes re-read on window focus, terminal PTY ownership across Sessions, Side Chat's fork lifecycle, a first send that has to reach the Host, and per-Session collapse persisted across a renderer reload; the composer-usage test is renderer-only and rides along on those windows until app-shell.tsx's composer-to-workbar wiring has a story host" }, "settings.spec.ts": { "tests": 4, From 47a19b6ebf8fc87f003e9c59d3abecb3dac4ee34 Mon Sep 17 00:00:00 2001 From: AstroHan Date: Sun, 6 Sep 2026 13:58:30 +0800 Subject: [PATCH 2/2] test(desktop): build the workbar story on the per-Session layout state #4694 replaced WorkbarLayoutState.rightCollapsed with activeSessionId + collapsedBySession; #4877 landed a story that builds the old shape. Both were green on their own bases, so main's typecheck fails on stories/app-shell.stories.tsx. Build the story on the new state and read the collapse bit through isSessionWorkbarCollapsed, as the controller does. Generated-by: Claude Code --- apps/desktop/stories/app-shell.stories.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/desktop/stories/app-shell.stories.tsx b/apps/desktop/stories/app-shell.stories.tsx index 0fb8135c2e..660cbe41a3 100644 --- a/apps/desktop/stories/app-shell.stories.tsx +++ b/apps/desktop/stories/app-shell.stories.tsx @@ -42,6 +42,7 @@ import { WorkbarSurface } from '../src/renderer/features/workbar/stories'; import { createFakeWorkbarServices, createSessionWorkbarPanelsState, + isSessionWorkbarCollapsed, reduceWorkbarLayout, SESSION_BOTTOM_PANEL_DEFAULT_HEIGHT, SESSION_WORKBAR_DEFAULT_WIDTH, @@ -2971,7 +2972,8 @@ export const RailStaysOnTheVisiblePrompt: Story = { const workbarLayoutWithOneFace: WorkbarLayoutState = reduceWorkbarLayout( { panels: createSessionWorkbarPanelsState(), - rightCollapsed: true, + activeSessionId: 'session-active', + collapsedBySession: {}, bottomOpen: false, rightWidth: SESSION_WORKBAR_DEFAULT_WIDTH, bottomHeight: SESSION_BOTTOM_PANEL_DEFAULT_HEIGHT, @@ -2983,12 +2985,13 @@ function WorkbarInShell() { const [layout, dispatch] = useReducer(reduceWorkbarLayout, workbarLayoutWithOneFace); const collapseRight = (collapsed: boolean) => dispatch({ type: 'collapse', placement: 'right', collapsed }); + const rightCollapsed = isSessionWorkbarCollapsed(layout); return ( collapseRight(!layout.rightCollapsed)} + workbarCollapsed={rightCollapsed} + onToggleWorkbar={() => collapseRight(!rightCollapsed)} detailChildren={