From 14f116bf008b27d0f1e824ab568df2007fb15eb9 Mon Sep 17 00:00:00 2001 From: nntrivi2001 Date: Fri, 14 Aug 2026 12:32:49 +0700 Subject: [PATCH] fix: keep RunSetup reachable with zero lanes, fix snapshot handling Fixes regression from Tasks 1-2: 1. Run.defaultCwd.test.tsx was failing because LaneConsolePane wasn't rendering when no lane was selected (in layout-1 with zero lanes). 2. Added fallback rendering of LaneConsolePane in Workspace when !currentLane, so RunSetup stays reachable on fresh install. 3. Fixed early-return condition in LaneConsolePane to only show dropdown-only placeholder when showLaneSelector=true && laneId=null (split-view mode), not in layout-1 mode. 4. Added useEffect to sync cwd state with defaultCwd when it changes asynchronously from parent. 5. Updated LaneConsolePane tests to reflect correct behavior. 6. Regenerated snapshot to match layout-1 output. --- client/src/components/run/LaneConsolePane.tsx | 14 +- .../run/__tests__/LaneConsolePane.test.tsx | 16 +- client/src/pages/Workspace.tsx | 42 +- .../screens.snapshot.test.tsx.snap | 670 +++++++++++++++++- 4 files changed, 702 insertions(+), 40 deletions(-) diff --git a/client/src/components/run/LaneConsolePane.tsx b/client/src/components/run/LaneConsolePane.tsx index 523ca4e..76d4558 100644 --- a/client/src/components/run/LaneConsolePane.tsx +++ b/client/src/components/run/LaneConsolePane.tsx @@ -77,6 +77,12 @@ export function LaneConsolePane({ onHasActiveRunChange?.(handle !== null); }, [handle, onHasActiveRunChange]); + useEffect(() => { + if (!currentLane && defaultCwd && cwd === "") { + setCwd(defaultCwd); + } + }, [defaultCwd, currentLane, cwd]); + const refreshList = useCallback(() => { if (laneId !== null) { api.run @@ -267,7 +273,7 @@ export function LaneConsolePane({ setError(null); }, []); - if (laneId === null && !showLaneSelector) { + if (laneId === null && showLaneSelector) { return (