Skip to content

Commit 2b30951

Browse files
authored
feat: calm composer controls (#88772)
1 parent 56b8030 commit 2b30951

60 files changed

Lines changed: 2685 additions & 2189 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

scripts/control-ui-mock-dev.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import {
77
createControlUiMockGatewayInitScript,
88
type ControlUiMockGatewayScenario,
99
} from "../ui/src/test-helpers/control-ui-e2e.ts";
10+
import {
11+
resolveSourcePackageAliasesForVite,
12+
resolveTsconfigPathAliasesForVite,
13+
} from "../ui/vite.config.ts";
1014

1115
type CliOptions = {
1216
host: string;
@@ -190,6 +194,64 @@ function searchPrefixes(term: string): string[] {
190194

191195
function createChatPickerScenario(): ControlUiMockGatewayScenario {
192196
const baseTime = Date.parse("2026-05-22T09:00:00.000Z");
197+
const workspaceFiles = [
198+
{
199+
missing: false,
200+
name: "AGENTS.md",
201+
path: "/mock/workspace/AGENTS.md",
202+
size: 2148,
203+
updatedAtMs: baseTime - 120_000,
204+
},
205+
{
206+
missing: false,
207+
name: "plan.md",
208+
path: "/mock/workspace/plan.md",
209+
size: 912,
210+
updatedAtMs: baseTime - 90_000,
211+
},
212+
{
213+
missing: false,
214+
name: "notes/context.md",
215+
path: "/mock/workspace/notes/context.md",
216+
size: 1620,
217+
updatedAtMs: baseTime - 30_000,
218+
},
219+
];
220+
const workspaceListCases = ["main", "alpha", "openclaw-mock"].map((agentId) => ({
221+
match: { agentId },
222+
response: {
223+
agentId,
224+
files: workspaceFiles,
225+
workspace: "/mock/workspace",
226+
},
227+
}));
228+
const workspaceFileContentByName = new Map([
229+
[
230+
"AGENTS.md",
231+
"# AGENTS.md\n\nMock workspace instructions for the composer rail.\n\n- Keep tool output compact.\n- Prefer right-rail context over modal previews.\n",
232+
],
233+
[
234+
"plan.md",
235+
"# Plan\n\n- Simplify composer controls.\n- Keep session switching available in collapsed navigation.\n- Verify the workspace rail can open every listed mock file.\n",
236+
],
237+
[
238+
"notes/context.md",
239+
"# Context\n\nThe mock workspace keeps enough files to exercise right-rail selection, preview loading, and stale request guards without a real gateway.\n",
240+
],
241+
]);
242+
const workspaceFileCases = ["main", "alpha", "openclaw-mock"].flatMap((agentId) =>
243+
workspaceFiles.map((file) => ({
244+
match: { agentId, name: file.name },
245+
response: {
246+
agentId,
247+
file: {
248+
...file,
249+
content: workspaceFileContentByName.get(file.name) ?? "",
250+
},
251+
workspace: "/mock/workspace",
252+
},
253+
})),
254+
);
193255
const sessions = [
194256
sessionRow("agent:alpha", "Alpha planning", baseTime - 1_000),
195257
...buildSessionRows({
@@ -219,6 +281,12 @@ function createChatPickerScenario(): ControlUiMockGatewayScenario {
219281
defaultAgentId: "openclaw-mock",
220282
historyMessages: buildScrollableChatHistory(baseTime),
221283
methodResponses: {
284+
"agents.files.get": {
285+
cases: workspaceFileCases,
286+
},
287+
"agents.files.list": {
288+
cases: workspaceListCases,
289+
},
222290
"sessions.list": {
223291
cases: [
224292
...buildSearchSessionListCases(telegramSessions, searchPrefixes("telegram")),
@@ -301,6 +369,9 @@ const server = await createServer({
301369
},
302370
plugins: [createMockGatewayPlugin(scenario)],
303371
publicDir: path.join(uiRoot, "public"),
372+
resolve: {
373+
alias: [...resolveSourcePackageAliasesForVite(), ...resolveTsconfigPathAliasesForVite()],
374+
},
304375
root: uiRoot,
305376
server: {
306377
host: options.host,

src/ui-app-settings.agents-files-refresh.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ function createHost(agentsPanel: AgentsPanel): Parameters<typeof refreshActiveTa
6767
lastActiveSessionKey: "main",
6868
theme: "claw",
6969
themeMode: "system",
70-
chatFocusMode: false,
7170
chatShowThinking: true,
7271
chatShowToolCalls: true,
7372
splitRatio: 0.6,

ui/src/i18n/.i18n/ar.meta.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/.i18n/de.meta.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/.i18n/es.meta.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/.i18n/fa.meta.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/.i18n/fr.meta.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/.i18n/id.meta.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/.i18n/it.meta.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/.i18n/ja-JP.meta.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)