From 4305aa613eaeb3c748614c0c1d32d41955de52d5 Mon Sep 17 00:00:00 2001 From: muzimu217 <1278844978@qq.com> Date: Fri, 2 Oct 2026 23:48:13 -0700 Subject: [PATCH 1/2] fix(e2e): repair settings-scroll script (url assets + dev-surface gating) The settings-scroll E2E has been unrunnable since the live-voice worklet landed: its bare-esbuild bundle chokes on the ?url import in live-call-controller.ts. Add the same local-url-assets plugin the other E2E bundles (composer-paste, transcript-render) already use. After unblocking the build, the fixture's import.meta.env.DEV=false define hides developmentOnly settings surfaces (Cloud sync) even with developer mode on, failing the must-appear assertion. Run the fixture with DEV semantics, matching how those surfaces are gated; the developer-only gate (absent without developer mode) is unchanged and still asserted. Verified locally: SETTINGS_SCROLL ok:true with light/dark themes, update preference, and pt-BR locale checks passing. --- scripts/e2e-settings-scroll.mjs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/e2e-settings-scroll.mjs b/scripts/e2e-settings-scroll.mjs index 5c932b4bbf..8b938aab24 100644 --- a/scripts/e2e-settings-scroll.mjs +++ b/scripts/e2e-settings-scroll.mjs @@ -10,17 +10,29 @@ import { repositoryRoot, resolveElectronBinary } from "./e2e/boot.mjs"; const root = repositoryRoot(); const { build } = createRequire(join(root, "packages/agent-runtime/package.json"))("esbuild"); +const urlAssets = { + name: "local-url-assets", + setup(build) { + build.onResolve({ filter: /\?url$/ }, ({ path, resolveDir }) => ({ + path: join(resolveDir, path.slice(0, -4)), namespace: "local-url-asset", + })); + build.onLoad({ filter: /.*/, namespace: "local-url-asset" }, async ({ path }) => ({ + contents: await readFile(path), loader: "file", + })); + }, +}; const temp = await mkdtemp(join(tmpdir(), "pi-settings-scroll-")); try { await build({ entryPoints: [join(root, "scripts/e2e/settings-scroll.jsx")], outfile: join(temp, "renderer.js"), bundle: true, platform: "browser", format: "esm", jsx: "automatic", - define: { "process.env.NODE_ENV": '"production"', "import.meta.env.DEV": "false" }, + define: { "process.env.NODE_ENV": '"production"', "import.meta.env.DEV": "true" }, alias: { "@pi-desktop/i18n": join(root, "packages/i18n/src/index.ts"), react: join(root, "apps/desktop/node_modules/react"), "react-dom": join(root, "apps/desktop/node_modules/react-dom"), i18next: join(root, "apps/desktop/node_modules/i18next"), "react-i18next": join(root, "apps/desktop/node_modules/react-i18next") }, nodePaths: [join(root, "apps/desktop/node_modules")], + plugins: [urlAssets], }); const renderer = join(root, "apps/desktop/out/renderer"); const html = await readFile(join(renderer, "index.html"), "utf8"); From 210943c3d971f9c499a2965f6d94c388b8e3abff Mon Sep 17 00:00:00 2001 From: vastsa Date: Sat, 3 Oct 2026 23:35:04 +0800 Subject: [PATCH 2/2] fix(e2e): resolve settings i18n subpaths The settings fixture imports locale-info and locale modules through the package subpath exports. Point esbuild at the source directory so these imports resolve alongside the root entry. --- scripts/e2e-settings-scroll.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/e2e-settings-scroll.mjs b/scripts/e2e-settings-scroll.mjs index 8b938aab24..f3cf78a98e 100644 --- a/scripts/e2e-settings-scroll.mjs +++ b/scripts/e2e-settings-scroll.mjs @@ -26,7 +26,7 @@ try { await build({ entryPoints: [join(root, "scripts/e2e/settings-scroll.jsx")], outfile: join(temp, "renderer.js"), bundle: true, platform: "browser", format: "esm", jsx: "automatic", define: { "process.env.NODE_ENV": '"production"', "import.meta.env.DEV": "true" }, - alias: { "@pi-desktop/i18n": join(root, "packages/i18n/src/index.ts"), + alias: { "@pi-desktop/i18n": join(root, "packages/i18n/src"), react: join(root, "apps/desktop/node_modules/react"), "react-dom": join(root, "apps/desktop/node_modules/react-dom"), i18next: join(root, "apps/desktop/node_modules/i18next"),