Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

fix: setup panel matches composer width

ogsamrat2e541e928b40
diff --git a/apps/app/src/react-app/domains/session/surface/sandbox-setup-panel.tsx b/apps/app/src/react-app/domains/session/surface/sandbox-setup-panel.tsx
index 315cf909..8468ceef 100644
--- a/apps/app/src/react-app/domains/session/surface/sandbox-setup-panel.tsx
+++ b/apps/app/src/react-app/domains/session/surface/sandbox-setup-panel.tsx
@@ -33,6 +33,9 @@ export function SandboxSetupPanel(props: Props) {
return <Panel key={props.workspaceId} client={props.client} workspaceId={props.workspaceId} sessionId={props.sessionId ?? null} chatRunning={props.chatRunning ?? false} onOpenSettings={props.onOpenSettings} />;
}
+/** As wide as the composer below it (its max-w-[800px] mx-auto), a little inset on narrow chats. */
+const WIDTH = "mx-auto mb-2 w-[calc(100%-1.5rem)] max-w-[800px]";
+
const TONE: Record<SandboxSetupView["tone"], string> = {
busy: "text-dls-secondary",
attention: "text-warning",
@@ -88,6 +91,12 @@ function Panel(props: { client: LinuxSandboxClient; workspaceId: string; session
const [justReady, setJustReady] = useState(false);
const shown = useRef(false);
const box: OmniRushWorkspaceBox | null = sandbox.box;
+ // A turn started or ended: look again (a reopened chat is known to stay on this computer after its first prompt here).
+ const { reload } = sandbox;
+ const required = box?.required === true;
+ useEffect(() => {
+ if (required && props.sessionId) void reload();
+ }, [props.chatRunning, props.sessionId, required, reload]);
// Shown while not ready, then "ready" for a few seconds.
useEffect(() => {
if (!box?.required || !box.on) return;
@@ -105,7 +114,7 @@ function Panel(props: { client: LinuxSandboxClient; workspaceId: string; session
if (!box) return null;
if (box.required && box.chatKept && props.sessionId) {
return (
- <div className="mx-3 mb-2 flex items-center gap-2 rounded-xl border border-dls-border bg-dls-surface px-3 py-2 text-xs text-dls-secondary" data-testid="sandbox-kept-chat">
+ <div className={`${WIDTH} flex items-center gap-2 rounded-xl border border-dls-border bg-dls-surface px-3 py-2 text-xs text-dls-secondary`} data-testid="sandbox-kept-chat">
<Monitor aria-hidden className="size-4 shrink-0" />
<span className="min-w-0 flex-1">{box.requiredText?.keptOldChat}</span>
</div>
@@ -126,7 +135,7 @@ function Panel(props: { client: LinuxSandboxClient; workspaceId: string; session
if (view.kind === "line" || view.kind === "ready") {
return (
- <div className="mx-3 mb-2 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-xl border border-dls-border bg-dls-surface px-3 py-2" data-testid="sandbox-setup-panel" data-kind={view.kind}>
+ <div className={`${WIDTH} flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-xl border border-dls-border bg-dls-surface px-3 py-2`} data-testid="sandbox-setup-panel" data-kind={view.kind}>
<ToneIcon tone={view.tone} />
<div className="min-w-0 flex-1 text-xs">
<span className="font-medium text-dls-text" role="status">{view.title}</span>
@@ -138,7 +147,7 @@ function Panel(props: { client: LinuxSandboxClient; workspaceId: string; session
}
return (
- <section className="mx-3 mb-2 rounded-2xl border border-dls-border bg-dls-surface" aria-labelledby="sandbox-setup-title" data-testid="sandbox-setup-panel" data-kind={view.kind} data-need={box.setup?.need ?? box.state}>
+ <section className={`${WIDTH} rounded-2xl border border-dls-border bg-dls-surface`} aria-labelledby="sandbox-setup-title" data-testid="sandbox-setup-panel" data-kind={view.kind} data-need={box.setup?.need ?? box.state}>
<div className="flex items-start gap-3 px-4 pt-3.5 pb-3">
<ToneIcon tone={view.tone} />
<div className="min-w-0 flex-1">
diff --git a/apps/app/src/react-app/domains/settings/linux-sandbox.ts b/apps/app/src/react-app/domains/settings/linux-sandbox.ts
index 0345ecfb..2cc858ff 100644
--- a/apps/app/src/react-app/domains/settings/linux-sandbox.ts
+++ b/apps/app/src/react-app/domains/settings/linux-sandbox.ts
@@ -324,6 +324,8 @@ export function useLinuxSandbox(client: LinuxSandboxClient | null, workspaceId:
}, [change, client, workspaceId]);
const refresh = useCallback(() => load(true), [load]);
+ /** Look again without the full backend check (a chat's turn started or ended). */
+ const reload = useCallback(() => load(false), [load]);
/** One setup step of the setup screen (Allow, Set up, Restart now, Not now, Check again). */
const setup = useCallback((action: OmniRushWorkspaceBoxSetupAction) => {
@@ -332,7 +334,7 @@ export function useLinuxSandbox(client: LinuxSandboxClient | null, workspaceId:
return change("setup", () => run(workspaceId, action), action === "win_restart" ? "Windows could not be restarted from here. Restart it from the Start menu." : "The setup step did not finish.", () => void setup(action));
}, [change, client, workspaceId]);
- return { box, pending, problem, notice, setEnabled, setBackend, retry, reset, refresh, setup };
+ return { box, pending, problem, notice, setEnabled, setBackend, retry, reset, refresh, reload, setup };
}
export type LinuxSandboxState = ReturnType<typeof useLinuxSandbox>;
diff --git a/apps/app/src/react-app/domains/settings/sandbox-setup.ts b/apps/app/src/react-app/domains/settings/sandbox-setup.ts
index 2cfdc6d6..8cee1b96 100644
--- a/apps/app/src/react-app/domains/settings/sandbox-setup.ts
+++ b/apps/app/src/react-app/domains/settings/sandbox-setup.ts
@@ -43,7 +43,7 @@ export type SandboxSetupView = {
fallbackLine: string | null;
};
-const RUNS_HERE = "Chats on this computer run here meanwhile.";
+const RUNS_HERE = "Chats run on this computer meanwhile.";
const FIRMWARE_STEPS = [
"Restart the computer and open its BIOS/UEFI settings (often F2, F10, Del or Esc right at start; on Windows also Settings › System › Recovery › Advanced startup › UEFI Firmware Settings).",
diff --git a/apps/app/tests/sandbox-setup.test.tsx b/apps/app/tests/sandbox-setup.test.tsx
index ef92aa3e..bb62cf9d 100644
--- a/apps/app/tests/sandbox-setup.test.tsx
+++ b/apps/app/tests/sandbox-setup.test.tsx
@@ -64,7 +64,7 @@ describe("sandbox setup panel: what it shows", () => {
const view = sandboxSetupView(box({ setup: setup({ need: "linux_allow", result: { ok: false, message: "The password prompt was dismissed; nothing changed.", at: 1 } }) }));
expect(view).toMatchObject({ kind: "action", title: "Allow the sandbox on this computer", result: { ok: false } });
expect(view?.buttons.map((b) => b.action)).toEqual(["linux_allow", "decline"]);
- expect(view?.fallbackLine).toBe("Chats on this computer run here meanwhile.");
+ expect(view?.fallbackLine).toBe("Chats run on this computer meanwhile.");
});
test("Windows: Set up (one restart), then the explicit consent; Restart needed waits for a running chat", () => {
@@ -87,14 +87,14 @@ describe("sandbox setup panel: what it shows", () => {
const view = sandboxSetupView(box({ platform: "win32", setup: setup({ need: "cannot_run", why }) }));
expect(view?.title).toBe(title);
expect(view?.buttons.map((b) => b.action)).toEqual(["check"]);
- expect(view?.fallbackLine).toBe("Chats on this computer run here meanwhile.");
+ expect(view?.fallbackLine).toBe("Chats run on this computer meanwhile.");
}
expect(WSL_TROUBLESHOOTING_URL).toBe("https://learn.microsoft.com/windows/wsl/troubleshooting");
});
test("cannot run, no known why: one calm line (the shared text); declined: postponed with Set up now", () => {
const line = sandboxSetupView(box({ setup: setup({ need: "cannot_run", line: "The sandbox can't run on this computer: unprivileged user namespaces are off." }) }));
- expect(line).toMatchObject({ kind: "line", title: "The sandbox can't run on this computer: unprivileged user namespaces are off.", detail: "Chats on this computer run here meanwhile." });
+ expect(line).toMatchObject({ kind: "line", title: "The sandbox can't run on this computer: unprivileged user namespaces are off.", detail: "Chats run on this computer meanwhile." });
const declined = sandboxSetupView(box({ setup: setup({ need: "linux_allow", declined: true }) }));
expect(declined).toMatchObject({ kind: "line", title: "Sandbox setup postponed" });
expect(declined?.buttons.map((b) => b.label)).toEqual(["Set up now"]);