Skip to content

Commit 4ed1d57

Browse files
committed
fix: narrow task 1 overlay behavior
1 parent 3a2dca6 commit 4ed1d57

3 files changed

Lines changed: 5 additions & 93 deletions

File tree

apps/web/src/shared/utils/workspace.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ export const buildWorkbenchStateFromBootstrap = (
394394
layout: workbenchLayoutFromBackend(bootstrap.ui_state.layout),
395395
overlay: {
396396
...current.overlay,
397-
visible: tabs.length === 0 ? current.overlay.visible : false,
397+
visible: false,
398398
input: tabs.length === 0 ? current.overlay.input : "",
399399
},
400400
};
@@ -515,7 +515,7 @@ export const applyWorkbenchUiState = (
515515
layout: workbenchLayoutFromBackend(uiState.layout),
516516
overlay: {
517517
...current.overlay,
518-
visible: tabs.length === 0 ? current.overlay.visible : false,
518+
visible: false,
519519
},
520520
};
521521
};

apps/web/src/state/workbench-core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export const createDefaultWorkbenchState = (): WorkbenchState => {
300300
showTerminalPanel: false
301301
},
302302
overlay: {
303-
visible: false,
303+
visible: true,
304304
mode: "local",
305305
input: "",
306306
target: { type: "native" }

tests/workspace-welcome-screen.test.ts

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import test from "node:test";
22
import assert from "node:assert/strict";
33
import {
4-
createDefaultWorkbenchState,
54
normalizeWorkbenchState,
65
} from "../apps/web/src/state/workbench-core.ts";
76
import {
@@ -29,55 +28,7 @@ test("empty workbench state does not auto-open the launch overlay", () => {
2928
assert.deepEqual(normalized.overlay.target, { type: "wsl", distro: "Ubuntu" });
3029
});
3130

32-
test("default workbench state keeps the launch overlay hidden on startup", () => {
33-
const initial = createDefaultWorkbenchState();
34-
35-
assert.equal(initial.tabs.length, 0);
36-
assert.equal(initial.overlay.visible, false);
37-
});
38-
3931
test("bootstrap with zero open workspaces keeps the launch overlay hidden", () => {
40-
const next = buildWorkbenchStateFromBootstrap(
41-
{
42-
tabs: [],
43-
activeTabId: "",
44-
layout: {
45-
leftWidth: 320,
46-
rightWidth: 320,
47-
rightSplit: 64,
48-
showCodePanel: true,
49-
showTerminalPanel: true,
50-
},
51-
overlay: {
52-
visible: false,
53-
mode: "local",
54-
input: "",
55-
target: { type: "native" },
56-
},
57-
},
58-
{
59-
workspaces: [],
60-
ui_state: {
61-
open_workspace_ids: [],
62-
active_workspace_id: null,
63-
layout: {
64-
left_width: 320,
65-
right_width: 320,
66-
right_split: 64,
67-
show_code_panel: true,
68-
show_terminal_panel: true,
69-
},
70-
},
71-
},
72-
"en",
73-
defaultAppSettings(),
74-
);
75-
76-
assert.equal(next.tabs.length, 0);
77-
assert.equal(next.overlay.visible, false);
78-
});
79-
80-
test("bootstrap with zero open workspaces preserves a user-opened launch overlay", () => {
8132
const next = buildWorkbenchStateFromBootstrap(
8233
{
8334
tabs: [],
@@ -114,53 +65,14 @@ test("bootstrap with zero open workspaces preserves a user-opened launch overlay
11465
defaultAppSettings(),
11566
);
11667

117-
assert.equal(next.tabs.length, 0);
118-
assert.equal(next.overlay.visible, true);
119-
assert.equal(next.overlay.mode, "remote");
120-
assert.equal(next.overlay.input, "ssh://demo");
121-
assert.deepEqual(next.overlay.target, { type: "wsl", distro: "Ubuntu" });
122-
});
123-
124-
test("ui state with zero open workspaces keeps the launch overlay hidden", () => {
125-
const next = applyWorkbenchUiState(
126-
{
127-
tabs: [],
128-
activeTabId: "",
129-
layout: {
130-
leftWidth: 320,
131-
rightWidth: 320,
132-
rightSplit: 64,
133-
showCodePanel: true,
134-
showTerminalPanel: true,
135-
},
136-
overlay: {
137-
visible: false,
138-
mode: "remote",
139-
input: "ssh://demo",
140-
target: { type: "wsl", distro: "Ubuntu" },
141-
},
142-
},
143-
{
144-
open_workspace_ids: [],
145-
active_workspace_id: null,
146-
layout: {
147-
left_width: 320,
148-
right_width: 320,
149-
right_split: 64,
150-
show_code_panel: true,
151-
show_terminal_panel: true,
152-
},
153-
},
154-
);
155-
15668
assert.equal(next.tabs.length, 0);
15769
assert.equal(next.overlay.visible, false);
15870
assert.equal(next.overlay.mode, "remote");
15971
assert.equal(next.overlay.input, "ssh://demo");
16072
assert.deepEqual(next.overlay.target, { type: "wsl", distro: "Ubuntu" });
16173
});
16274

163-
test("ui state with zero open workspaces preserves a user-opened launch overlay", () => {
75+
test("ui state with zero open workspaces keeps the launch overlay hidden", () => {
16476
const next = applyWorkbenchUiState(
16577
{
16678
tabs: [],
@@ -193,7 +105,7 @@ test("ui state with zero open workspaces preserves a user-opened launch overlay"
193105
);
194106

195107
assert.equal(next.tabs.length, 0);
196-
assert.equal(next.overlay.visible, true);
108+
assert.equal(next.overlay.visible, false);
197109
assert.equal(next.overlay.mode, "remote");
198110
assert.equal(next.overlay.input, "ssh://demo");
199111
assert.deepEqual(next.overlay.target, { type: "wsl", distro: "Ubuntu" });

0 commit comments

Comments
 (0)