fix(settings): align sandbox loading layouts for old and new hosts

This commit is contained in:
Xubin Ren committed 2026-11-08 14:29:46 +08:00
1 parent 5130f42901
commit a666948509
5 files changed
+37 -12

No files matched your search

+1 -1
View File
@@ -282,7 +282,7 @@ createRoot(document.getElementById("root")!).render(<TooltipProvider>
: parameters.get("case") === "new-chat-skeleton"
? <ClientProvider client={railClient} token="fixture"><NewChatSkeletonFixture /></ClientProvider>
: parameters.get("case") === "skeleton-additions"
? <ClientProvider client={railClient} token="fixture"><SkeletonAdditionsFixture /></ClientProvider>
? <ClientProvider client={railClient} token="fixture" webuiCapabilities={parameters.has("sandboxSettings") ? ["webui.sandbox-settings.v1"] : []}><SkeletonAdditionsFixture /></ClientProvider>
: parameters.get("case") === "skeleton"
? <ClientProvider client={railClient} token="fixture"><SkeletonFixture surface={parameters.get("surface") ?? "skills"} loading={parameters.has("loading")} /></ClientProvider>
: parameters.get("case") === "tools-catalog"
@@ -45,6 +45,11 @@ const previewSettings: SettingsPayload = {
])),
};
let detailState = "loaded";
if (new URLSearchParams(location.search).has("sandboxSettings")) {
previewSettings.advanced.exec_sandbox_status = {
state: "off", reason: "", launcher: null, revision: "fixture", supported_backend: "bwrap",
};
}
export function installSkeletonPreviewApi() {
// Windows headless Chromium can report denied even after a context permission grant.
+5 -3
View File
@@ -55,8 +55,9 @@ for (const width of [390, 1440]) for (const locale of ["en", "zh-CN"]) {
});
test("settings sections preserve their loaded row layout", async ({ page }, testInfo) => {
for (const section of ["notifications", "capabilities", "runtime", "advanced", "overview", "models", "about"]) {
const extra = `&section=${section}${section === "notifications" ? "&notificationPermission=granted" : ""}`;
for (const surface of ["notifications", "capabilities", "runtime", "advanced", "sandbox", "overview", "models", "about"]) {
const section = surface === "sandbox" ? "advanced" : surface;
const extra = `&section=${section}${section === "notifications" ? "&notificationPermission=granted" : ""}${surface === "sandbox" ? "&sandboxSettings" : ""}`;
await page.goto(fixture("settings", "loaded", extra));
const target = page.locator("[data-settings-section]");
if (section === "notifications") {
@@ -72,7 +73,8 @@ for (const width of [390, 1440]) for (const locale of ["en", "zh-CN"]) {
}
if (section === "runtime") await expect(page.locator('[data-settings-section] button').filter({ hasText: locale === "en" ? "Start API server" : "启动 API 服务" })).toBeVisible();
await settle(page);
const selector = section === "overview" ? "section button.group" : section === "models" ? '[data-testid^="model-call-order-row"], .settings-footer' : section === "about" ? ".settings-list-row" : ".settings-row";
// Collapsed options remain mounted for drafts but do not occupy the visible layout.
const selector = section === "overview" ? "section button.group" : section === "models" ? '[data-testid^="model-call-order-row"], .settings-footer' : section === "about" ? ".settings-list-row" : ".settings-row:not([inert] *)";
const notificationDetails = section === "notifications" ? ", .settings-list-inset > .border-t, section > p" : "";
const proxyForm = section === "advanced" ? ", [data-shared-proxy-editor]" : "";
const loaded = await boxes(target.locator(selector + notificationDetails + proxyForm));