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.
This commit is contained in:
@@ -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 (
|
||||
<div data-testid="pane-empty" className="flex min-h-0 flex-1 flex-col gap-2 p-4">
|
||||
<select
|
||||
@@ -354,9 +360,9 @@ export function LaneConsolePane({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!handle && laneId !== null ? (
|
||||
{!handle ? (
|
||||
<RunSetup
|
||||
laneId={laneId}
|
||||
laneId={laneId ?? 0}
|
||||
prompt={prompt}
|
||||
onPromptChange={setPrompt}
|
||||
cwd={cwd}
|
||||
@@ -378,8 +384,6 @@ export function LaneConsolePane({
|
||||
runHistory={runHistory}
|
||||
onResumeFromHistory={onResumeFromHistory}
|
||||
/>
|
||||
) : !handle && laneId === null ? (
|
||||
<p className="text-sm text-fg-muted">{tLanes("splitView.pickLane")}</p>
|
||||
) : (
|
||||
<div className="flex-1 min-h-0 flex flex-col">
|
||||
<TerminalView
|
||||
|
||||
Reference in New Issue
Block a user