Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(dialogs): keep long content and close controls within bounds (#703)

Lanca8092884a0f
diff --git a/apps/desktop/src/components/ExtensionPromptDialog.tsx b/apps/desktop/src/components/ExtensionPromptDialog.tsx
index 8bb2a5e0f..27747279f 100644
--- a/apps/desktop/src/components/ExtensionPromptDialog.tsx
+++ b/apps/desktop/src/components/ExtensionPromptDialog.tsx
@@ -127,7 +127,7 @@ function ExtensionPromptDialog({
onClick={(event) => event.stopPropagation()}
>
<div className="session-rename-dialog-head">
- <div>
+ <div className="session-rename-dialog-heading">
<h2 id={`${dialogId}-title`} className="session-rename-dialog-title">
<IconPlug size={16} aria-hidden />
{title}
diff --git a/apps/desktop/src/components/SessionRenameDialog.tsx b/apps/desktop/src/components/SessionRenameDialog.tsx
index d60a42745..a5094c5b7 100644
--- a/apps/desktop/src/components/SessionRenameDialog.tsx
+++ b/apps/desktop/src/components/SessionRenameDialog.tsx
@@ -120,7 +120,7 @@ function RenameDialog({
onClick={(event) => event.stopPropagation()}
>
<div className="session-rename-dialog-head">
- <div>
+ <div className="session-rename-dialog-heading">
<h2 id={`${dialogId}-title`} className="session-rename-dialog-title">
<IconPencil size={16} aria-hidden />
{title}
diff --git a/apps/desktop/src/styles/plugins.css b/apps/desktop/src/styles/plugins.css
index c68facdb2..141580c9a 100644
--- a/apps/desktop/src/styles/plugins.css
+++ b/apps/desktop/src/styles/plugins.css
@@ -1787,6 +1787,7 @@
}
.plugins-modal-title {
+ overflow-wrap: anywhere;
margin: 0;
color: var(--ds-text-primary);
font-size: var(--text-base-plus);
@@ -1795,6 +1796,7 @@
}
.plugins-modal-subtitle {
+ overflow-wrap: anywhere;
margin: 3px 0 0;
color: var(--ds-text-muted);
font-size: var(--text-sm-plus);
@@ -1970,6 +1972,7 @@
}
.plugins-install-outcome {
+ overflow-wrap: anywhere;
margin: 0;
color: var(--ds-text-primary);
font-size: var(--text-md);
diff --git a/apps/desktop/src/styles/projects.css b/apps/desktop/src/styles/projects.css
index 50df7032b..795489653 100644
--- a/apps/desktop/src/styles/projects.css
+++ b/apps/desktop/src/styles/projects.css
@@ -824,6 +824,7 @@
}
.project-delete-dialog-body {
+ overflow-wrap: anywhere;
display: flex;
flex-direction: column;
gap: 8px;
diff --git a/apps/desktop/src/styles/sessions.css b/apps/desktop/src/styles/sessions.css
index 0ec8c58c1..f16edc069 100644
--- a/apps/desktop/src/styles/sessions.css
+++ b/apps/desktop/src/styles/sessions.css
@@ -587,7 +587,14 @@
line-height: var(--leading-heading);
}
+.session-rename-dialog-heading {
+ min-width: 0;
+ flex: 1;
+ overflow-wrap: anywhere;
+}
+
.session-rename-dialog-title svg {
+ flex-shrink: 0;
color: var(--ds-text-muted);
}
diff --git a/apps/desktop/src/styles/settings.css b/apps/desktop/src/styles/settings.css
index 2e34d2ea8..23d4f77d0 100644
--- a/apps/desktop/src/styles/settings.css
+++ b/apps/desktop/src/styles/settings.css
@@ -2390,7 +2390,13 @@
text-overflow: ellipsis;
}
+.extension-prompt-dialog {
+ max-height: calc(100dvh - 48px);
+ overflow-y: auto;
+}
+
.extension-prompt-message {
+ overflow-wrap: anywhere;
margin: 0 0 12px;
color: var(--ds-text-primary);
font-size: var(--text-sm);
@@ -2405,6 +2411,7 @@
}
.extension-prompt-option {
+ overflow-wrap: anywhere;
display: flex;
align-items: center;
gap: 8px;
@@ -2415,12 +2422,15 @@
cursor: pointer;
}
+.extension-prompt-option input {
+ flex-shrink: 0;
+}
+
.extension-prompt-source-path {
display: block;
margin-top: 2px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+ overflow-wrap: anywhere;
+ white-space: normal;
font-size: var(--text-3xs);
}
diff --git a/apps/desktop/test/fixtures/dialog-overflow-runner.cjs b/apps/desktop/test/fixtures/dialog-overflow-runner.cjs
new file mode 100644
index 000000000..062548c56
--- /dev/null
+++ b/apps/desktop/test/fixtures/dialog-overflow-runner.cjs
@@ -0,0 +1,81 @@
+const { app, BrowserWindow } = require('electron');
+const { writeFileSync } = require('node:fs');
+const { join } = require('node:path');
+app.setName('PI Dialog Layout Test');
+app.whenReady().then(async () => {
+ const win = new BrowserWindow({ show: false, width: 1100, height: 800, useContentSize: true,
+ webPreferences: { sandbox: true, nodeIntegration: false, contextIsolation: true, backgroundThrottling: false } });
+ win.webContents.on('console-message', (_event, level, message) => { if (level >= 3) console.error(message); });
+ await win.loadURL(process.env.PI_DIALOG_FIXTURE_URL);
+ const evaluate = (code) => win.webContents.executeJavaScript(code);
+ await evaluate(`new Promise((resolve, reject) => { const deadline = Date.now() + 10000; function check() { if (window.dialogFixture) return resolve(); if (Date.now() > deadline) return reject(new Error('fixture did not mount')); requestAnimationFrame(check); } check(); })`);
+ const results = [];
+ const check = (name, ok, detail) => { results.push({ name, ok: !!ok, detail }); console.log((ok ? 'PASS ' : 'FAIL ') + name + ' ' + JSON.stringify(detail ?? '')); };
+ async function measure() {
+ return evaluate(`(() => {
+ const dialog = document.querySelector('[role="dialog"]');
+ const r = dialog.getBoundingClientRect();
+ const close = dialog.querySelector('.session-rename-dialog-close,.project-instructions-dialog-close,.plugins-modal-head button');
+ const c = close?.getBoundingClientRect();
+ const source = dialog.querySelector('.extension-prompt-source-path');
+ const sourceBounds = source?.getBoundingClientRect();
+ const range = document.createRange();
+ if (source) range.selectNodeContents(source);
+ const sourceLines = source ? [...range.getClientRects()] : [];
+ return { width: r.width, height: r.height, overflow: dialog.scrollWidth - dialog.clientWidth,
+ contained: r.left >= -1 && r.right <= innerWidth + 1 && r.top >= -1 && r.bottom <= innerHeight + 1,
+ closeContained: !c || (c.left >= r.left && c.right <= r.right),
+ closeHit: !c || close.contains(document.elementFromPoint(c.x + c.width/2, c.y + c.height/2)),
+ sourceWrapped: !source || (sourceLines.length > 1 && sourceLines.every(line =>
+ line.left >= sourceBounds.left - 1 && line.right <= sourceBounds.right + 1 &&
+ line.top >= sourceBounds.top - 1 && line.bottom <= sourceBounds.bottom + 1)),
+ };
+ })()`);
+ }
+ async function click(selector) {
+ const point = await evaluate(`(() => { const e=document.querySelector(${JSON.stringify(selector)});e.scrollIntoView({block:'nearest'}); const r=e.getBoundingClientRect(); return {x:Math.round(r.x+r.width/2),y:Math.round(r.y+r.height/2)}; })()`);
+ win.webContents.sendInputEvent({ type: 'mouseDown', button: 'left', clickCount: 1, ...point });
+ win.webContents.sendInputEvent({ type: 'mouseUp', button: 'left', clickCount: 1, ...point });
+ await evaluate('new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))');
+ }
+ await evaluate('window.dialogFixture.show("extension")');
+ const original = await measure();
+ check('extension source fits and close is reachable', original.contained && original.overflow <= 1 && original.closeContained && original.closeHit, original);
+ check('full source path wraps without clipping or changing dialog width', original.sourceWrapped && original.width <= 420, original);
+ writeFileSync(join(process.env.PI_DIALOG_ARTIFACT_DIR, 'extension-path.png'), (await win.webContents.capturePage()).toPNG());
+ await click('.session-rename-dialog-close');
+ check('close dismisses the extension prompt', await evaluate('!document.querySelector("[role=dialog]") && window.dialogFixture.responses.length === 1'));
+ await evaluate('window.dialogFixture.show("extension")');
+ for (const keyCode of 'Ann') win.webContents.sendInputEvent({ type: 'char', keyCode });
+ await click('button[type="submit"]');
+ check('typing and submit preserve the input answer', await evaluate('window.dialogFixture.responses[0]?.value === "Ann"'));
+ for (const theme of ['light','dark']) for (const request of ['input','confirm','select']) {
+ win.setContentSize(520, 480);
+ await evaluate('window.dialogFixture.show("extension", ' + JSON.stringify({ theme, request, longTitle: true, locale: 'zh-CN' }) + ')');
+ const m = await measure();
+ check(theme + ' ' + request + ' wraps long content within the viewport', m.contained && m.overflow <= 1 && m.closeContained && m.sourceWrapped, m);
+ if (request === 'select') {
+ await click('input[type="radio"][value="Second option"]');
+ await click('button[type="submit"]');
+ check(theme + ' long option still allows selecting and submitting', await evaluate('window.dialogFixture.responses[0]?.value === "Second option"'));
+ } else {
+ await evaluate('window.dispatchEvent(new KeyboardEvent("keydown", {key:"Escape",bubbles:true}))');
+ check(theme + ' ' + request + ' Escape dismisses', await evaluate('!document.querySelector("[role=dialog]")'));
+ }
+ }
+ for (const kind of ['rename','instructions','memory','delete','install','plugin-settings','plugin-review','oauth']) {
+ win.setContentSize(1100, 800);
+ await evaluate('window.dialogFixture.show(' + JSON.stringify(kind) + ')');
+ const m = await measure();
+ check('audit ' + kind + ' long text stays bounded', m.contained && m.overflow <= 1 && m.closeContained && m.closeHit, m);
+ const dismiss = kind === 'rename' ? '.session-rename-dialog-close'
+ : ['instructions','memory','delete'].includes(kind) ? '.project-instructions-dialog-close'
+ : kind === 'oauth' ? '.provider-dialog-actions button' : '.plugins-modal-actions button';
+ await click(dismiss);
+ check('audit ' + kind + ' dismissal remains operable', await evaluate('window.dialogFixture.closed && !document.querySelector("[role=dialog]")'));
+ }
+ writeFileSync(join(process.env.PI_DIALOG_ARTIFACT_DIR, 'results.json'), JSON.stringify(results, null, 2));
+ const failed = results.filter(r => !r.ok).length;
+ console.log('SUMMARY ' + (results.length-failed) + '/' + results.length + ' passed');
+ win.destroy();app.exit(failed ? 1 : 0);
+}).catch(error => { console.error(error.stack);app.exit(1); });
diff --git a/apps/desktop/test/fixtures/dialog-overflow.jsx b/apps/desktop/test/fixtures/dialog-overflow.jsx
new file mode 100644
index 000000000..f55fffe32
--- /dev/null
+++ b/apps/desktop/test/fixtures/dialog-overflow.jsx
@@ -0,0 +1,79 @@
+import React from "react";
+import { createRoot } from "react-dom/client";
+import { flushSync } from "react-dom";
+import i18n from "i18next";
+import { initReactI18next } from "react-i18next";
+import { catalogs, flattenCatalog } from "@pi-desktop/i18n";
+import { IPC } from "@pi-desktop/shared";
+import { ExtensionPromptHost } from "../../src/components/ExtensionPromptDialog";
+import { SessionRenameDialog } from "../../src/components/SessionRenameDialog";
+import { ProjectInstructionsDialog } from "../../src/components/ProjectInstructionsDialog";
+import { ProjectMemoryDialog } from "../../src/components/ProjectMemoryDialog";
+import { ProjectDeleteDialog } from "../../src/components/ProjectDeleteDialog";
+import { PluginInstallDialog } from "../../src/components/plugins/PluginInstallDialog";
+import { OAuthLoginDialog } from "../../src/components/settings/OAuthLoginDialog";
+import { PluginDialogs } from "../../src/features/plugins/PluginDialogs";
+import { PluginSettingsSheet } from "../../src/components/plugins/PluginSettingsSheet";
+import { newInstallJob } from "../../src/features/plugins/install-progress";
+
+const listeners = new Map();
+const path = "C:\\Users\\Example\\AppData\\Local\\Temp\\pi-extension-fixture\\plugins\\greet\\src\\greet.ts";
+const long = "Project_" + "abcdefghij".repeat(25);
+window.piDesktop = {
+ platform: "win32",
+ on(channel, listener) {
+ const set = listeners.get(channel) ?? new Set();
+ listeners.set(channel, set); set.add(listener);
+ return () => set.delete(listener);
+ },
+ async invoke(channel, ...args) {
+ if (channel === IPC.invoke.extensionsUiRespond) window.dialogFixture.responses.push(args[0]);
+ return { ok: true, data: { project: { scope: "project", path, content: "Fixture instructions", exists: true },
+ content: "Fixture instructions", memory: { content: "", entries: [] } } };
+ },
+};
+await i18n.use(initReactI18next).init({ lng: "en", fallbackLng: "en", keySeparator: false,
+ resources: Object.fromEntries(["en", "zh-CN"].map((locale) => [locale, { translation: flattenCatalog(catalogs[locale]) }])),
+ interpolation: { escapeValue: false } });
+const root = createRoot(document.getElementById("root"));
+let revision = 0;
+const frame = () => new Promise(requestAnimationFrame);
+const close = () => { window.dialogFixture.closed = true; flushSync(() => root.render(null)); };
+const error = (value) => { throw value; };
+window.dialogFixture = {
+ responses: [], closed: false, saved: null,
+ async show(kind, options = {}) {
+ flushSync(() => root.render(null));
+ this.responses = []; this.closed = false; this.saved = null;
+ document.documentElement.dataset.theme = options.theme ?? "light";
+ await i18n.changeLanguage(options.locale ?? "en");
+ const project = { name: long, path, groupId: "fixture-group", sessionCount: 2 };
+ const props = { project, onClose: close, onSaved() {}, onError: error };
+ let component;
+ if (kind === "extension") component = <ExtensionPromptHost key={++revision} />;
+ if (kind === "rename") component = <SessionRenameDialog session={{ id: "s", title: long }} onClose={close} onSave={async (value) => { this.saved = value; }} onError={error} />;
+ if (kind === "instructions") component = <ProjectInstructionsDialog {...props} />;
+ if (kind === "memory") component = <ProjectMemoryDialog {...props} />;
+ if (kind === "delete") component = <ProjectDeleteDialog {...props} runningSessionIds={[]} onDeleted={() => {}} />;
+ if (kind === "install") component = <PluginInstallDialog job={{ ...newInstallJob({ id: "fixture", name: long, grantedPermissions: [], autoUpdate: false }), status: "failed", error: long }} onCancel={close} onRetry={() => {}} onClose={close} />;
+ if (kind === "plugin-settings") component = <PluginSettingsSheet plugin={{ id: "fixture", name: long, settings: [] }} platform="win32" onClose={close} onSaved={() => {}} />;
+ if (kind === "plugin-review") component = <PluginDialogs t={i18n.t.bind(i18n)} pendingInstall={{ id: "fixture", name: long, permissions: [] }} setPendingInstall={close} confirmInstall={close} autoUpdate={false} setAutoUpdate={() => {}} />;
+ if (kind === "oauth") component = <OAuthLoginDialog vendor={{ id: "fixture", name: "Fixture" }} onClose={close} onDone={close} session={{
+ subscribe(listener) { queueMicrotask(() => listener({ kind: "authUrl", url: "https://example.invalid/" + long, instructions: "Open the sign-in URL", opened: false })); return () => {}; },
+ cancel: async () => {},
+ }} />;
+ flushSync(() => root.render(component));
+ await frame();
+ if (kind === "extension") {
+ const requestKind = options.request ?? "input";
+ const request = { kind: requestKind, title: options.longTitle ? long : "Your name?",
+ placeholder: "e.g. Ann", message: long.repeat(2), options: [long, "Second option"] };
+ for (const listener of listeners.get(IPC.event.extensionsUiPrompt) ?? []) {
+ listener({ promptId: `fixture-${revision}`, sessionId: "s", extensionId: path,
+ extensionLabel: options.longTitle ? long : "greet", request });
+ }
+ }
+ await frame(); await frame();
+ await Promise.all(document.getAnimations().filter((animation) => animation.effect.getComputedTiming().iterations !== Infinity).map((animation) => animation.finished.catch(() => {})));
+ },
+};
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 2b4388b28..8c95fca1b 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -3733,3 +3733,15 @@ match the requested deletion. Never trim leading newlines or normalize all BRs.
Remember proven placeholder nodes weakly so native redo cannot restore them.
Explicit line breaks, IME composition, file references, and chip deletion retain
their normal behavior. The input owns and disposes the native event listeners.
+
+### Dialog long-text containment
+
+Extension prompts keep the 420px rename-dialog width. Their heading column
+can shrink beside the close button, full source paths wrap within that column,
+and unbroken titles, labels, confirmation text and radio options wrap. Content
+taller than the viewport scrolls inside the prompt, leaving actions reachable.
+Input, selection, submission and dismissal semantics remain unchanged.
+
+Project-delete descriptions and plugin dialog headings/outcomes also wrap long
+project or plugin names instead of overflowing their existing widths. Project
+instructions, memory and OAuth dialogs retain their existing bounded layouts.
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index c8de1b71d..c3254865c 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -7834,7 +7834,7 @@ identify the platform validation still needed.
| Post-MVP | E2E-022A, E2E-022B, E2E-022C, E2E-024I, E2E-024J, E2E-024K, E2E-024L, E2E-024M (plugin roadmap R2/R3/R6) |
| Post-baseline local automation | E2E-220 |
| Post-MVP remote control | E2E-221, E2E-222, E2E-223, E2E-224, E2E-225, E2E-226, E2E-227, E2E-228, E2E-229, E2E-230, E2E-231, E2E-232 |
-| Trusted extensions (R7 v1) | E2E-241, E2E-242, E2E-TRUSTED-EXTENSION-custom-agent-stream-and-binding, E2E-243, E2E-244, E2E-245, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-import-extension-installs-dependencies, E2E-PLUGIN-import-extension-reports-missing-dependency, E2E-PLUGIN-declared-provider-appears-in-the-native-provider-list |
+| Trusted extensions (R7 v1) | E2E-DIALOG-long-text-boundaries, E2E-241, E2E-242, E2E-TRUSTED-EXTENSION-custom-agent-stream-and-binding, E2E-243, E2E-244, E2E-245, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-import-extension-installs-dependencies, E2E-PLUGIN-import-extension-reports-missing-dependency, E2E-PLUGIN-declared-provider-appears-in-the-native-provider-list |
| Trusted extensions (R7 v1 npm recovery) | E2E-PLUGIN-import-extension-recovers-missing-npm |
| Post-MVP regression coverage (plugin tool dispatch) | E2E-PLUGIN-slow-tool-is-not-cut-off-by-host-dispatch |
| M6+ (Project delete) | E2E-PROJECT-delete-removes-project-and-owned-sessions |
@@ -13801,3 +13801,23 @@ the latest destination. These assertions measure work counts, not device FPS.
`desktop_dispatch_outlasts_every_electron_budget_it_wraps` covers the dispatch
default.
- **Status:** Contract-covered; no end-to-end driver waits out a real 70s call.
+
+### E2E-DIALOG-long-text-boundaries
+
+- **Preconditions:** Built renderer assets and an isolated Electron component
+ fixture; production components, store, translations and stylesheet are used.
+ Only the preload IPC boundary is replaced with deterministic host replies.
+- **Steps:** Open an extension input prompt with a long Windows source path;
+ type, submit, reopen and dismiss. Repeat long title/message/option prompts in
+ light/dark themes and Chinese at 520×480. Inspect long project/plugin names in
+ rename, instructions, memory, delete, install, settings, permission-review and
+ OAuth dialogs; exercise dismissal controls.
+- **Expected:** Full source paths and other long text wrap without clipping; horizontal
+ overflow is absent, and the 420px prompt width is unchanged. Tall prompts
+ scroll inside the viewport. Close, Escape, typing and radio submission work.
+- **Specs:** `04-ux/08-component-spec.md`, Dialog long-text containment.
+- **Acceptance:** Bounded text and reachable modal controls.
+- **Milestone:** Post-MVP maintenance.
+- **Automation:** `pnpm test:e2e:dialog-overflow`; source/contract dialog suites
+ supplement, but do not replace, real Chromium geometry and pointer checks.
+- **Status:** Implemented. Native Windows evidence; macOS/Linux not qualified.
diff --git a/docs/zh-CN/spec/04-ux/08-component-spec.md b/docs/zh-CN/spec/04-ux/08-component-spec.md
index fb221b6d6..2b5b62b08 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -2697,3 +2697,12 @@ default nor provider configuration. OAuth accounts remain in their separate sect
### 输入框文件芯片前的原生删除
删除内联文件引用前面的文字时,不得插入空行或把芯片挤到下一行。保留原生编辑与撤销/重做。原生删除前记录浏览器的目标范围和已有 BR 节点;输入之后,仅当去掉那颗新出现的 BR 后草稿恰好等于这次删除的目标时才移除它。绝不裁掉前导换行,也不整批规范化所有 BR。用弱引用记住已证实的占位节点,避免原生重做把它们恢复回来。显式换行、输入法合成、文件引用和芯片删除保持原有行为。由输入框安装并卸载这些原生事件监听。
+
+### 弹窗长文本边界
+
+扩展提示保留 420px 宽度。标题文字列可以在关闭按钮旁收缩,来源路径在列内
+完整换行显示,连续的长标题、插件名、确认消息和选项允许换行。内容高于视口时
+在弹窗内滚动,保证操作按钮可达;输入、选择、提交和关闭语义不变。
+
+项目删除说明和插件弹窗标题、安装结果中的长名称也在现有宽度内换行。
+项目指令、项目记忆和 OAuth 弹窗维持已有的边界处理。
diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index 2bdc23ba5..55fe9a00a 100644
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@ -5138,7 +5138,7 @@ IPC 请求无法关闭。
| 后MVP | E2E-022A、E2E-022B、E2E-022C、E2E-024I、E2E-024J、E2E-024K、E2E-024L、E2E-024M(插件路线图 R2/R3/R6) |
| 基线后本地自动化 | E2E-220 |
| MVP 后远程控制 | E2E-221、E2E-222、E2E-223、E2E-224、E2E-225、E2E-226、E2E-227、E2E-228、E2E-229、E2E-230、E2E-231、E2E-232 |
-| 受信任扩展(R7 v1) | E2E-241、E2E-242、E2E-243、E2E-244、E2E-245、E2E-PLUGIN-imported-pi-package-skills、E2E-PLUGIN-import-extension-installs-dependencies、E2E-PLUGIN-import-extension-reports-missing-dependency、E2E-PLUGIN-declared-provider-appears-in-the-native-provider-list |
+| 受信任扩展(R7 v1) | E2E-DIALOG-long-text-boundaries、E2E-241、E2E-242、E2E-243、E2E-244、E2E-245、E2E-PLUGIN-imported-pi-package-skills、E2E-PLUGIN-import-extension-installs-dependencies、E2E-PLUGIN-import-extension-reports-missing-dependency、E2E-PLUGIN-declared-provider-appears-in-the-native-provider-list |
| 受信任扩展(R7 v1 npm 恢复) | E2E-PLUGIN-import-extension-recovers-missing-npm |
| Post-MVP 回归覆盖(插件工具调度) | E2E-PLUGIN-slow-tool-is-not-cut-off-by-host-dispatch |
| M6+(删除项目) | E2E-PROJECT-delete-removes-project-and-owned-sessions |
@@ -8119,3 +8119,18 @@ the latest destination. These assertions measure work counts, not device FPS.
`desktop_dispatch_outlasts_every_electron_budget_it_wraps` covers the dispatch
default.
- **Status:** Contract-covered; no end-to-end driver waits out a real 70s call.
+
+### E2E-DIALOG-long-text-boundaries
+
+- **前提:** 已构建渲染器,使用隔离的 Electron 组件测试窗口。组件、状态、翻译
+ 和样式均为生产实现,只在 preload IPC 边界提供确定性宿主回复。
+- **步骤:** 用长 Windows 路径打开扩展输入框,输入、提交、重新打开并关闭;在
+ 520×480 下测试明暗主题及中文的长标题、确认文本、选项;检查重命名、项目
+ 指令、记忆、删除、插件安装、设置、权限确认与 OAuth 弹窗,并操作关闭按钮。
+- **预期:** 来源路径与其他长文本完整换行显示,不截断,无横向溢出,保留 420px 提示框宽度;
+ 高内容在框内滚动,关闭、Escape、输入提交、单选操作正常。
+- **规格:** `04-ux/08-component-spec.md`,弹窗长文本边界。
+- **验收:** 文字保持在边界内,弹窗操作可达。
+- **阶段:** 发布后维护。
+- **自动化:** `pnpm test:e2e:dialog-overflow`;源代码检查不能替代实际布局验证。
+- **状态:** 已实现,原生 Windows 已验证,macOS/Linux 尚未实机验证。
diff --git a/package.json b/package.json
index dd433950f..426026c93 100644
--- a/package.json
+++ b/package.json
@@ -56,7 +56,8 @@
"test:e2e:trusted-extensions": "node scripts/e2e-trusted-extensions.mjs",
"test:e2e:collaboration": "node scripts/e2e-session-collaboration.mjs",
"test:e2e:session-completion": "node scripts/e2e-session-completion.mjs",
- "test:e2e:remote-host": "node scripts/e2e-remote-host.mjs"
+ "test:e2e:remote-host": "node scripts/e2e-remote-host.mjs",
+ "test:e2e:dialog-overflow": "node scripts/test-dialog-overflow.mjs"
},
"devDependencies": {
"@biomejs/biome": "^2.5.13",
diff --git a/scripts/test-dialog-overflow.mjs b/scripts/test-dialog-overflow.mjs
new file mode 100644
index 000000000..19c260fad
--- /dev/null
+++ b/scripts/test-dialog-overflow.mjs
@@ -0,0 +1,49 @@
+/** Mounted production dialog regression tests in isolated Electron/Chromium.
+ * Only the preload host boundary is stubbed; components, store, i18n and CSS are real.
+ */
+import { createRequire } from "node:module";
+import { createServer } from "node:http";
+import { spawn } from "node:child_process";
+import { mkdtemp, readdir, readFile, rm, mkdir } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import { join, resolve, extname } from "node:path";
+import { repositoryRoot, resolveElectronBinary, assertDesktopBuild } from "./e2e/boot.mjs";
+
+const root = repositoryRoot();
+assertDesktopBuild(root);
+const { build } = createRequire(new URL("../packages/agent-runtime/package.json", import.meta.url))("esbuild");
+const temp = await mkdtemp(join(tmpdir(), "pi-dialog-layout-"));
+const artifacts = process.env.PI_DIALOG_ARTIFACT_DIR ? resolve(process.env.PI_DIALOG_ARTIFACT_DIR) : temp;
+await mkdir(artifacts, { recursive: true });
+const assets = join(root, "apps/desktop/out/renderer/assets");
+const stylesheet = (await readdir(assets)).find((name) => /^index-.*\.css$/.test(name));
+if (!stylesheet) throw new Error("Built renderer stylesheet missing");
+await build({ entryPoints: [join(root, "apps/desktop/test/fixtures/dialog-overflow.jsx")],
+ outfile: join(temp, "fixture.js"), bundle: true, format: "esm", platform: "browser", jsx: "automatic",
+ define: { "import.meta.env.DEV": "false", "process.env.NODE_ENV": '"production"' } });
+const server = createServer(async (req, res) => {
+ try {
+ const name = req.url?.split("?")[0];
+ if (name === "/") {
+ res.setHeader("content-type", "text/html");
+ res.end(`<html><head><meta charset="utf-8"><link rel="stylesheet" href="/assets/${stylesheet}"></head><body><div id="root"></div><script type="module" src="/fixture.js"></script></body></html>`);
+ return;
+ }
+ const file = name === "/fixture.js" ? join(temp, "fixture.js") : resolve(assets, (name ?? "").replace(/^\/assets\//, ""));
+ if (file !== join(temp, "fixture.js") && !file.startsWith(assets + "/") && !file.startsWith(assets + "\\")) { res.writeHead(404); res.end(); return; }
+ res.setHeader("content-type", { ".js": "text/javascript", ".css": "text/css", ".woff2": "font/woff2" }[extname(file)] ?? "application/octet-stream");
+ res.end(await readFile(file));
+ } catch { res.writeHead(404); res.end(); }
+});
+await new Promise((resolvePromise) => server.listen(0, "127.0.0.1", resolvePromise));
+const url = `http://127.0.0.1:${server.address().port}`;
+
+const env = { ...process.env, PI_DIALOG_FIXTURE_URL: url, PI_DIALOG_ARTIFACT_DIR: artifacts }; delete env.ELECTRON_RUN_AS_NODE;
+try {
+ const child = spawn(resolveElectronBinary(root).electronBinary, [`--user-data-dir=${join(temp, "profile")}`, join(root, "apps/desktop/test/fixtures/dialog-overflow-runner.cjs")], { env, windowsHide: true, stdio: "inherit" });
+ const code = await new Promise((resolvePromise, reject) => { child.on("exit", resolvePromise); child.on("error", reject); });
+ process.exitCode = code ?? 1;
+} finally {
+ server.closeAllConnections(); await new Promise((resolvePromise) => server.close(resolvePromise));
+ if (artifacts !== temp) await rm(temp, { recursive: true, force: true });
+}