Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(desktop): exclude preview shell controls from header drag regions
ZeroY7ed2f0109bc9
diff --git a/apps/desktop/src/features/app/AppShell.tsx b/apps/desktop/src/features/app/AppShell.tsxindex 933e48def..4c3b30b51 100644--- a/apps/desktop/src/features/app/AppShell.tsx+++ b/apps/desktop/src/features/app/AppShell.tsx@@ -111,9 +111,8 @@ export function AppShell() {) : null}{workPanelMaximized && (- /* Preview mode hides MainChat, which normally owns the drag band and- the window controls. Keep the same top band with the same system- buttons, at the window level rather than inside the panel. */+ /* MainChat is absent; the panel header owns dragging while this+ pass-through row keeps the shell controls available. */<divclassName={cx("window-chrome-row",diff --git a/apps/desktop/src/styles/chrome.css b/apps/desktop/src/styles/chrome.cssindex 98de2cfe7..88e77fdf2 100644--- a/apps/desktop/src/styles/chrome.css+++ b/apps/desktop/src/styles/chrome.css@@ -1108,15 +1108,22 @@user-select: none;}-/* Window-level chrome for preview mode: the topbar that normally owns the drag- band and the window controls lives in MainChat, which preview mode does not- render, so the shell reserves the same 46px band itself. */-.app-shell.work-panel-maximized .work-panel-header {- -webkit-app-region: drag;+.app-shell.work-panel-maximized {+ --preview-chrome-inset: 8px;+ --preview-chrome-action-lane: 30px;}-.app-shell.work-panel-maximized .work-panel-header button {- -webkit-app-region: no-drag;+.app-shell.work-panel-maximized.sidebar-collapsed {+ --preview-chrome-action-lane: var(--ds-preview-action-lane-width);+}++:root[data-platform="darwin"] .app-shell.work-panel-maximized.sidebar-collapsed {+ --preview-chrome-inset: 76px;+}++:root[data-platform="darwin"][data-fullscreen="true"]+ .app-shell.work-panel-maximized.sidebar-collapsed {+ --preview-chrome-inset: 8px;}.window-chrome-row {@@ -1128,54 +1135,21 @@display: flex;height: var(--ds-toolbar-height);align-items: center;- padding-left: 8px;+ padding-left: var(--preview-chrome-inset);pointer-events: none;- -webkit-app-region: drag;- app-region: drag;}.window-chrome-row.sidebar-expanded {left: var(--ds-sidebar-width);}-/* Native macOS traffic lights occupy the top-left ~76px of the window. Keep- * preview actions outside that hit area while the sidebar is collapsed. */-:root[data-platform="darwin"] .window-chrome-row:not(.sidebar-expanded) {- padding-left: 76px;-}--:root[data-platform="darwin"][data-fullscreen="true"]- .window-chrome-row:not(.sidebar-expanded) {- padding-left: 8px;-}-.window-chrome-row button {pointer-events: auto;-}--/* The system buttons keep their ordinary titlebar seat at the top right. */-.window-chrome-row .window-controls {- margin-left: auto;-webkit-app-region: no-drag;+ app-region: no-drag;}.window-chrome-drag {flex: 1 1 auto;align-self: stretch;- -webkit-app-region: drag;- app-region: drag;}--.window-chrome-row .window-controls,-.window-chrome-row button {- -webkit-app-region: no-drag;-}-/* Preview mode: the top band replaces MainChat's titlebar, so the system- buttons join the band's own flow instead of floating over the panel as a- separate opaque block (their fixed seat is meant for the titlebar row). */-----/* Preview mode: the three shell actions sit tight at the band's left edge- * (new task, restore the panel, toggle the panel), then the drag region. */diff --git a/apps/desktop/src/styles/work-panel.css b/apps/desktop/src/styles/work-panel.cssindex 9d8bdd741..ed6c11feb 100644--- a/apps/desktop/src/styles/work-panel.css+++ b/apps/desktop/src/styles/work-panel.css@@ -139,19 +139,16 @@-webkit-app-region: drag;}-/* In preview mode the panel can move to the window's left edge when the sidebar- is collapsed. Keep its first tab clear of both macOS's hiddenInset traffic- lights and the preview row's sidebar/new-task action group. */-:root[data-platform="darwin"]:not([data-fullscreen="true"])- .app-shell.work-panel-maximized.sidebar-collapsed- .work-panel-header {- padding-left: calc(76px + var(--ds-preview-action-lane-width));-}--:root[data-platform="darwin"][data-fullscreen="true"]- .app-shell.work-panel-maximized.sidebar-collapsed- .work-panel-header {- padding-left: calc(8px + var(--ds-preview-action-lane-width));+.app-shell.work-panel-maximized .work-panel-header {+ margin-left: calc(var(--preview-chrome-inset) + var(--preview-chrome-action-lane));+ padding-left: 0;+}++.app-shell.work-panel-maximized .work-panel-main {+ background: linear-gradient(+ var(--ds-bg-dock-raised) 0 var(--ds-toolbar-height),+ transparent var(--ds-toolbar-height)+ );}:root[data-platform="win32"] .work-panel-header,diff --git a/apps/desktop/test/work-panel.test.mjs b/apps/desktop/test/work-panel.test.mjsindex 94f8da501..22e877eaf 100644--- a/apps/desktop/test/work-panel.test.mjs+++ b/apps/desktop/test/work-panel.test.mjs@@ -576,28 +576,19 @@ test("preview mode keeps shell actions and restores routes before navigation", (appSource,/case "newTask":[\s\S]*?if \(workPanelMaximizedRef\.current\) setWorkPanelMaximized\(false\);/,);- assert.match(- globalStyles,- /\.window-chrome-row \{[\s\S]*?-webkit-app-region: drag;/,- );- assert.match(- globalStyles,- /\.window-chrome-row\.sidebar-expanded \{[\s\S]*?left: var\(--ds-sidebar-width\);/,- );- assert.match(- globalStyles,- /:root\[data-platform="darwin"\] \.window-chrome-row:not\(\.sidebar-expanded\) \{[\s\S]*?padding-left:\s*76px;/,- );- assert.match(- globalStyles,- /:root\[data-platform="darwin"\]\[data-fullscreen="true"\][\s\S]*?\.window-chrome-row:not\(\.sidebar-expanded\) \{[\s\S]*?padding-left:\s*8px;/,- );- assert.match(- globalStyles,- /:root\[data-platform="darwin"\]:not\(\[data-fullscreen="true"\]\)[\s\S]*?\.app-shell\.work-panel-maximized\.sidebar-collapsed\s+\.work-panel-header\s*\{[^}]*padding-left:\s*calc\(76px \+ var\(--ds-preview-action-lane-width\)\);/,- );- assert.match(- globalStyles,- /:root\[data-platform="darwin"\]\[data-fullscreen="true"\][\s\S]*?\.app-shell\.work-panel-maximized\.sidebar-collapsed\s+\.work-panel-header\s*\{[^}]*padding-left:\s*calc\(8px \+ var\(--ds-preview-action-lane-width\)\);/,- );+ const row = globalStyles.match(/\.window-chrome-row \{[^}]*\}/)?.[0] ?? "";+ const spacer = globalStyles.match(/\.window-chrome-drag \{[^}]*\}/)?.[0] ?? "";+ assert.match(row, /pointer-events:\s*none/);+ assert.match(row, /padding-left:\s*var\(--preview-chrome-inset\)/);+ assert.ok(spacer);+ assert.doesNotMatch(row + spacer, /app-region:|background:/);+ assert.match(globalStyles, /\.window-chrome-row button \{[^}]*pointer-events:\s*auto;[^}]*app-region:\s*no-drag;/);+ assert.match(globalStyles, /\.window-chrome-row\.sidebar-expanded \{[^}]*left: var\(--ds-sidebar-width\);/);+ assert.match(globalStyles, /\.app-shell\.work-panel-maximized \{[^}]*--preview-chrome-inset:\s*8px;[^}]*--preview-chrome-action-lane:\s*30px;/);+ assert.match(globalStyles, /\.app-shell\.work-panel-maximized\.sidebar-collapsed \{[^}]*--preview-chrome-action-lane:\s*var\(--ds-preview-action-lane-width\);/);+ assert.match(globalStyles, /:root\[data-platform="darwin"\] \.app-shell\.work-panel-maximized\.sidebar-collapsed \{[^}]*--preview-chrome-inset:\s*76px;/);+ assert.match(globalStyles, /:root\[data-platform="darwin"\]\[data-fullscreen="true"\]\s+\.app-shell\.work-panel-maximized\.sidebar-collapsed \{[^}]*--preview-chrome-inset:\s*8px;/);+ assert.match(globalStyles, /\.app-shell\.work-panel-maximized \.work-panel-header \{[^}]*margin-left:\s*calc\(var\(--preview-chrome-inset\) \+ var\(--preview-chrome-action-lane\)\);[^}]*padding-left:\s*0;/);+ assert.match(globalStyles, /\.work-panel-header \{[^}]*app-region:\s*drag;/);+ assert.match(globalStyles, /\.app-shell\.work-panel-maximized \.work-panel-main \{[^}]*var\(--ds-bg-dock-raised\) 0 var\(--ds-toolbar-height\)/);});diff --git a/docs/adr/0238-three-column-width-priority.md b/docs/adr/0238-three-column-width-priority.mdindex f0397b9e9..ce539175e 100644--- a/docs/adr/0238-three-column-width-priority.md+++ b/docs/adr/0238-three-column-width-priority.md@@ -67,6 +67,16 @@ MainChat to its floor while the expanded sidebar kept its full width.46px chrome row with New Task, sidebar, and native window controls.Collapsed-sidebar preview reserves 76px on the left for macOS traffic lightsin windowed mode and 8px in fullscreen.+ Hit-region amendment (2026-09-16): the chrome row and its spacer declare+ neither drag nor no-drag, and pass pointer events through outside controls.+ The panel header is the sole drag owner within the preview pane. Its actual+ border box excludes the left shell-action lane plus an 8px gap in both+ sidebar states, including expanded-sidebar New Task. All platforms use an+ 8px left inset except collapsed-sidebar windowed macOS (76px). The existing+ right native-control border exclusion remains unchanged. Header-height+ background paint fills the excluded lane without an opaque control overlay.+ Native pointer clicks and window dragging require native validation;+ renderer geometry and DOM/CDP event dispatch are not native hit-test proof.## Consequencesdiff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.mdindex 7f8434b28..4f9da1523 100644--- a/docs/spec/04-ux/01-ui-ia.md+++ b/docs/spec/04-ux/01-ui-ia.md@@ -80,10 +80,13 @@ destination, chat as the home surface, tools and permissions inline.notification action; the durable local inbox opens from the sidebar footerbell instead (D130/D117). In work-panel preview mode, MainChat is unmountedand a window-level 46px chrome row keeps New Task, sidebar, and native window- controls available. In macOS collapsed-sidebar preview, the panel header- reserves the 76px windowed (8px fullscreen) traffic-light inset plus the- preview action lane and an 8px gap, so its first tab never overlaps either- the traffic lights or the preview controls.+ controls available without owning a drag or no-drag rectangle across the+ panel. The panel header alone owns dragging in the preview pane; its actual+ border box starts after the shell action lane plus an 8px gap, including the+ expanded-sidebar New Task button, on every platform. The left inset is 8px,+ or 76px for collapsed-sidebar windowed macOS. Its right native-control+ exclusion is unchanged. Header paint fills the excluded lane without an+ opaque overlay hiding tabs or panel actions.- **Work panel**: docked right column (not an overlay) opened by an artifact,the viewport-fixed toggle, or `Cmd/Ctrl + J`. File, URL, browser-preview, andsuccessful workspace-edit artifacts create their resources atomically. Thediff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.mdindex 48c0dc95b..e71a02ea4 100644--- a/docs/spec/04-ux/07-ui-design-system.md+++ b/docs/spec/04-ux/07-ui-design-system.md@@ -1043,11 +1043,13 @@ retain the fade-and-slide exit.Preview mode is a transient shell state: MainChat is unmounted and the workpanel occupies the client width beside the sidebar. A window-level 46px chrome-row owns the drag area, New Task/sidebar actions, and native window controls.-Collapsed-sidebar preview reserves 76px on the left for macOS traffic lights in-windowed mode and 8px in fullscreen. The maximized panel header retains that-native reserve, then adds the preview action lane and an 8px gap before its-first tab.+row is pointer-transparent outside New Task/sidebar and native window controls;+it declares neither drag nor no-drag across the panel. The panel header alone+owns the preview pane's drag area. Its border box, not just its padding, excludes+the left action lane plus an 8px gap in both sidebar states on all platforms.+The left inset is 8px except for collapsed-sidebar windowed macOS (76px).+The right native-control exclusion remains unchanged. The panel paints the+header-height background behind the excluded lane without covering its controls.### 10.1 Responsive collapsediff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.mdindex 5f344eb4e..f8f77dd45 100644--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@ -65,9 +65,10 @@ Outer frame that positions Topbar, Sidebar, MainChat, and WorkPanel. Owns resizenative window bounds stay unchanged.- Work panel preview: the header maximize action temporarily unmounts MainChatand expands the panel across the client area beside the sidebar. A window-level- 46px chrome row owns the drag area, New Task/sidebar actions, and native- window controls. On macOS, collapsed-sidebar preview reserves 76px on the- left in windowed mode and 8px in fullscreen for the traffic lights.+ 46px chrome row keeps New Task/sidebar and native window controls, with+ pointer passthrough and no drag/no-drag rectangle outside its controls.+ The panel header alone owns dragging in the preview pane; its border box+ excludes the shell action lane in both sidebar states on every platform.- Work panel resize: its inner left-edge handle changes the committed panelwidth in the renderer, so dragging left gives the panel more internal spaceand dragging right returns space to MainChat (§5.4)@@ -239,10 +240,11 @@ combined model × reasoning selection (§11).while the panel is closed. While the panel is open, that 120px band plus thetoggle overlay the panel header instead, and the header ends its box beforethe band so the panel tab strip and `+` stay clear of the native control band.- In macOS windowed preview mode, a collapsed sidebar also adds the 76px- traffic-light reserve and the preview action lane plus an 8px gap to the- panel header itself, keeping its first tab clear; fullscreen uses the 8px- native reserve but retains the preview action lane.+ In preview mode the header's left border box starts after the shell actions+ plus an 8px gap, including expanded-sidebar New Task, on every platform.+ The left inset is 8px except collapsed-sidebar windowed macOS (76px).+ Header-height background paint fills the excluded lane without an opaque+ overlay hiding tabs or panel actions.Resource close actions stay in their tabs so a second header `×` does not echothe native Windows close control (D357).- Title cluster (task title) flexes and shows at most the first 10 Unicodediff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.mdindex 128fa86c2..63f8bdabd 100644--- a/docs/spec/04-ux/09-interaction-patterns.md+++ b/docs/spec/04-ux/09-interaction-patterns.md@@ -1096,9 +1096,13 @@ Work-panel and application-window resizing are implemented in MVP:- Preview mode unmounts MainChat and lets the work panel fill the client areabeside the sidebar. A window-level 46px chrome row keeps New Task, sidebar,- and native window controls available. In collapsed-sidebar macOS preview, the- panel header reserves the 76px windowed (8px fullscreen) traffic-light inset,- the preview action lane, and an 8px gap before its first tab.+ and native window controls available through a pointer-transparent row that+ declares neither drag nor no-drag across the panel. The panel header's drag+ border box starts after the shell actions plus an 8px gap, including expanded+ sidebar New Task. All platforms use an 8px left inset, except collapsed-sidebar+ windowed macOS (76px). Native pointer clicks must operate the controls and+ dragging empty header space must move the window; DOM/CDP clicks alone do+ not establish native hit testing.The expanded sidebar is fixed at 275px. Collapse/open changes only whether thecolumn is present; the historical resize handle is hidden and legacy widthdiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 73bc3c825..f770662fc 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -12221,7 +12221,15 @@ plugin-form fixtures in an isolated temporary directory at runtime.1. Note the current panel width. If the sidebar is expanded, collapse it;then click the panel header's `+` action to open a real work-panel tab.2. Click the panel header's preview toggle.- 3. Inspect the shell and tab alignment, then click the toggle again.+ 3. Inspect the header border box and tab alignment with the sidebar collapsed+ and expanded on macOS windowed/fullscreen and Windows/Linux. Confirm the+ overlay row and spacer declare neither drag nor no-drag and do not cover+ the panel controls with opaque paint.+ 4. Using native pointer input, click the centers and edges of sidebar and+ New Task controls; confirm sidebar toggles and New Task exits preview to+ an editable composer. Reenter preview, operate tabs, close, add, restore,+ panel toggle and native controls, then drag empty header space and confirm+ the native window moves. Repeat in light/dark themes and both sidebar states.- **Expected**: Entering preview mode stops rendering MainChat and hands itswidth to the panel, so the panel spans the client area minus the expandedsidebar (the whole client area when the sidebar is collapsed). The native@@ -12230,17 +12238,24 @@ plugin-form fixtures in an isolated temporary directory at runtime.keeps whatever sidebar state the user chose last. The mode is transient: it isnot persisted and ends when the panel closes. Preview mode keeps the shell'snew-task, sidebar, and system-window actions reachable while MainChat is- absent. On non-fullscreen macOS with the sidebar collapsed, the first preview- action starts at the 76px traffic-light safe inset. After opening a real work- panel tab, its first tab starts at least 8px to the right of the preview action- group; fullscreen uses the 8px native inset but retains that action lane.+ absent. The panel header is the sole drag owner in the preview pane. Its+ actual border box and first tab start at least 8px after the shell actions,+ including expanded-sidebar New Task, on every platform. Left inset is 8px+ except collapsed-sidebar windowed macOS (76px). The right native-control+ border exclusion remains intact. Controls receive native clicks without+ moving the window; empty header space still drags it. Header-height background+ paint fills the excluded lane without hiding panel controls.- **Specs linked**: `04-ux/01-ui-ia.md`, `04-ux/07-ui-design-system.md` §10,`04-ux/08-component-spec.md` §5, `04-ux/09-interaction-patterns.md` §8,ADR 0238 §6, issue #289- **Acceptance**: F (persistence), Quality- **Milestone**: Post-M6 desktop shell maintenance-- **Status**: Automated (`scripts/e2e-three-column-layout.mjs` — preview mode- entry/exit widths, MainChat unmount, and window invariance)+- **Status**: Partially automated (`scripts/e2e-three-column-layout.mjs` —+ preview entry/exit, DOM action behavior, header border-box exclusion, row/spacer+ drag ownership, and all-platform/fullscreen CSS fixtures in both sidebar+ states). DOM clicks and CDP input are not native hit-test proof; native pointer,+ window-drag and visual checks remain required on each platform. Branch runs+ are exploratory and do not satisfy the integrated-main gate.#### E2E-AGENT-alt-enter-steers-active-turn: Enter follows up and Alt+Enter steers the active turndiff --git a/docs/zh-CN/spec/04-ux/01-ui-ia.md b/docs/zh-CN/spec/04-ux/01-ui-ia.mdindex f69511ddf..2c4b24084 100644--- a/docs/zh-CN/spec/04-ux/01-ui-ia.md+++ b/docs/zh-CN/spec/04-ux/01-ui-ia.md@@ -66,7 +66,13 @@后接固定的 `+` 新建入口;关闭操作归属于各标签,因此 Windows 原生关闭控件旁不再重复呈现第二个 `×`。工作面板预览模式会卸载 MainChat,并在窗口级 46px chrome 行中保留新建任务、侧边栏和本机窗口控件。- macOS 非全屏且侧边栏折叠时,左侧预留 76px(全屏为 8px),避免与交通灯重叠。+ The row and spacer declare neither drag nor no-drag and pass pointer events+ through outside controls. The panel header alone owns dragging in the preview+ pane. Its border box excludes the shell action lane plus an 8px gap in both+ sidebar states, including expanded-sidebar New Task, on every platform.+ The left inset is 8px except collapsed-sidebar windowed macOS (76px).+ Right native-control exclusion is unchanged; header-height background paint+ fills the left lane without an opaque overlay covering panel controls.Windows/Linux 使用无菜单的无框架 46px 行,并在左侧和可访问的最小化/最大化或恢复/关闭控件右(D129)。目的地历史以快捷键为主(`Cmd/Ctrl+[` 和diff --git a/docs/zh-CN/spec/04-ux/07-ui-design-system.md b/docs/zh-CN/spec/04-ux/07-ui-design-system.mdindex b6950d425..f8d4f4a2a 100644--- a/docs/zh-CN/spec/04-ux/07-ui-design-system.md+++ b/docs/zh-CN/spec/04-ux/07-ui-design-system.md@@ -939,8 +939,13 @@ Linux 保留淡入淡出和滑动退出。- 面板 open/collapse/final 关闭和分隔符提交更新已提交首选宽度。本机边缘调整窗口大小并重排 MainChat。- 预览模式是临时的 shell 状态:卸载 MainChat,工作面板填充侧边栏之外的客户区。- 窗口级 46px chrome 行保留拖动区域、新建任务、侧边栏和本机窗口控件。- 侧边栏折叠时,macOS 窗口模式左侧预留 76px,全屏预留 8px 给交通灯。+ The 46px chrome row retains shell and native controls but declares neither+ drag nor no-drag across the panel and passes pointer events through outside+ controls. The panel header alone owns dragging in the preview pane. Its+ border box excludes shell actions plus an 8px gap in both sidebar states on+ every platform. The left inset is 8px except collapsed-sidebar windowed macOS+ (76px). Right native-control exclusion is unchanged. Header-height background+ paint fills the excluded lane without covering panel controls.- 外层外壳在每个平台上都保留原生边缘/角落调整大小。无边框标题栏的拖动区域不会替代操作系统的调整大小所有权。300ms 的稳定边界等待窗口可避免恢复逻辑与慢速指针手势竞争,原生调整大小/移动事件停止 600ms 后diff --git a/docs/zh-CN/spec/04-ux/08-component-spec.md b/docs/zh-CN/spec/04-ux/08-component-spec.mdindex 06e91ce92..9cac541e1 100644--- a/docs/zh-CN/spec/04-ux/08-component-spec.md+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md@@ -70,8 +70,14 @@工作面板标题带通过让自身盒子在该保留带之前结束来承载它——用外边距而非内边距——因为原生拖拽矩形就是边框盒。- 工作面板预览:标题栏最大化操作会临时卸载 MainChat,并让面板填充侧边栏- 之外的客户区。窗口级 46px chrome 行负责拖动区域、新建任务、侧边栏和本机- 窗口控件。macOS 侧边栏折叠时,窗口模式左侧预留 76px,全屏预留 8px 给交通灯。+ 之外的客户区。+ The 46px chrome row keeps shell/native controls but has no drag/no-drag+ rectangle and passes pointer events through outside controls. The panel+ header alone owns dragging in the preview pane; its border box excludes+ shell actions plus an 8px gap in both sidebar states on every platform.+ The left inset is 8px except collapsed-sidebar windowed macOS (76px).+ Right native-control exclusion is unchanged. Header-height paint fills the+ left lane without an opaque overlay hiding tabs or panel actions.- 工作面板调整大小:左边缘拖动手柄(§5.4)- 窗口大小调整:本机边缘仅在打开作品时更改 MainChat 宽度面板保持其承诺的宽度;响应式布局如下diff --git a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md b/docs/zh-CN/spec/04-ux/09-interaction-patterns.mdindex c83d76cd5..d8659e585 100644--- a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md+++ b/docs/zh-CN/spec/04-ux/09-interaction-patterns.md@@ -851,9 +851,14 @@ Mode/provider/model/permission/shell 配置和新提示仍然存在(预订始终为 0)。- 后台会话工件永远不会更新可见面板。-- 预览模式会卸载 MainChat,让工作面板填充侧边栏之外的客户区。窗口级 46px- chrome 行保留新建任务、侧边栏和本机窗口控件;侧边栏折叠时,macOS 窗口模式- 左侧预留 76px,全屏预留 8px 给交通灯。+- Preview mode unmounts MainChat and fills the client area beside the sidebar.+ The 46px chrome row keeps shell/native controls but declares neither drag nor+ no-drag across the panel and passes pointer events through outside controls.+ The panel header alone owns dragging in the preview pane; its border box+ excludes shell actions plus an 8px gap in both sidebar states on all platforms.+ The left inset is 8px except collapsed-sidebar windowed macOS (76px).+ Native clicks must operate controls and empty-header drags must move the+ window; DOM/CDP clicks alone are not native hit-test proof.展开侧边栏固定为 275px。折叠/展开只改变列是否存在;历史上的调整大小手柄会隐藏,旧的宽度偏好不会继续持久化。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.mdindex 18d471636..cc97d7126 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@@ -7219,6 +7219,37 @@ runner 会在运行时的隔离临时目录中生成六个插件形态 fixture- **里程碑**:M6 之后的桌面外壳维护- **状态**:已自动化(`scripts/e2e-three-column-layout.mjs`,经 `pnpm test:e2e:layout` —— 固定窗口宽度不变、指针拖动全程 360px 下限、左栏让位/恢复、370px 重开目标);单元覆盖见 `work-panel-resize.test.mjs`+#### E2E-LAYOUT-work-panel-maximize++- **Preconditions**: A desktop session has an open work panel with a real tab.+- **Steps**:+ 1. Record the panel width and enter preview mode.+ 2. Inspect the header border box with the sidebar collapsed and expanded on+ macOS windowed/fullscreen and Windows/Linux. Check row/spacer drag ownership.+ 3. With native pointer input, click centers and edges of sidebar and New Task+ controls. Reenter preview and operate tabs, close, add, restore, panel toggle+ and native controls. Drag empty header space. Repeat in light/dark themes.+- **Expected**: MainChat is absent while preview fills the client area beside+ the sidebar; native bounds and persisted preferred width are unchanged, the+ divider is inert, and restore retains the last chosen sidebar state. The row+ and spacer declare neither drag nor no-drag and pass pointer events through+ outside controls. The panel header is the sole drag owner in the preview pane;+ its border box and first tab start at least 8px after shell actions, including+ expanded-sidebar New Task. Left inset is 8px except collapsed-sidebar windowed+ macOS (76px); right native-control exclusion is unchanged. Controls receive+ native clicks without window movement; empty-header drags move the window.+ New Task exits preview to an editable composer. Header-height paint fills the+ excluded lane without hiding panel controls.+- **Specs linked**: `04-ux/01-ui-ia.md`, `04-ux/07-ui-design-system.md` §10,+ `04-ux/08-component-spec.md` §5, `04-ux/09-interaction-patterns.md` §8, ADR 0238+- **Acceptance**: F (persistence), Quality+- **Milestone**: Post-M6 desktop shell maintenance+- **Status**: Partially automated by `scripts/e2e-three-column-layout.mjs`+ (preview entry/exit, DOM action behavior, header border-box exclusion,+ row/spacer ownership, all-platform/fullscreen CSS fixtures in both sidebar+ states). DOM/CDP clicks are not native hit-test proof. Native pointer, drag+ and visual checks remain required; branch runs are exploratory only.+#### E2E-AGENT-alt-enter-steers-active-turn:Enter 排队跟进,Alt+Enter 向当前回合补充指令- **前提条件**:会话已配置模型,能够控制流式回复或工具完成时机;附件场景使用支持图像的模型。diff --git a/scripts/e2e-three-column-layout.mjs b/scripts/e2e-three-column-layout.mjsindex 5d76bc82d..c3f0d85df 100644--- a/scripts/e2e-three-column-layout.mjs+++ b/scripts/e2e-three-column-layout.mjs@@ -477,35 +477,58 @@ async function main() {`window ${beforeMaximize.windowWidth} -> ${maximizing.windowWidth}`,);- const openedTabPreview = await cdp.evaluate(`(() => {- const actionGroup = document.querySelector(- ".window-chrome-row .titlebar-nav",+ // CSS geometry and DOM behavior are not proof of native titlebar hit testing.+ const checkPreviewHitRegions = async (label) => {+ const geometry = await cdp.evaluate(`(() => {+ const row = document.querySelector(".window-chrome-row");+ const spacer = document.querySelector(".window-chrome-drag");+ const header = document.querySelector(".work-panel-header");+ const actions = [...row.querySelectorAll("[data-nav]")];+ const headerBox = header.getBoundingClientRect();+ const firstTab = document.querySelector(".work-panel-tab");+ const controls = row.querySelector(".window-controls");+ const sidebar = document.querySelector(".sidebar");+ const platform = document.documentElement.dataset.platform;+ const fullscreen = document.documentElement.dataset.fullscreen === "true";+ const inset = platform === "darwin" && !fullscreen && !sidebar ? 76 : 8;+ const actionRight = Math.max(...actions.map(el => el.getBoundingClientRect().right));+ return {+ headerLeft: headerBox.left,+ headerRight: headerBox.right,+ actionRight,+ leftClear: actions.length > 0 && headerBox.left >= actionRight + 8,+ insetClear: actions[0].getBoundingClientRect().left >= (sidebar?.getBoundingClientRect().right ?? 0) + inset,+ rightClear: headerBox.right <= window.innerWidth -+ (platform === "win32" || platform === "linux" ? 120 : 0) &&+ (!controls || headerBox.right <= controls.getBoundingClientRect().left),+ tabClear: !firstTab || firstTab.getBoundingClientRect().left >= actionRight + 8,+ rowRegion: getComputedStyle(row).webkitAppRegion,+ spacerRegion: getComputedStyle(spacer).webkitAppRegion,+ headerRegion: getComputedStyle(header).webkitAppRegion,+ passThrough: getComputedStyle(row).pointerEvents === "none",+ actionsInteractive: actions.every(el => getComputedStyle(el).pointerEvents === "auto" && getComputedStyle(el).webkitAppRegion === "no-drag"),+ };+ })()`);+ check(+ geometry.leftClear && geometry.insetClear && geometry.rightClear && geometry.tabClear &&+ geometry.rowRegion === "none" && geometry.spacerRegion === "none" &&+ geometry.headerRegion === "drag" && geometry.passThrough && geometry.actionsInteractive,+ `preview header border box excludes shell controls (${label}; geometry only)`,+ JSON.stringify(geometry),);- const firstTab = document.querySelector(".work-panel-tab");- const header = document.querySelector(".work-panel-header");- const actionGroupBox = actionGroup?.getBoundingClientRect();- const firstTabBox = firstTab?.getBoundingClientRect();- return {- platform: window.piDesktop?.platform ?? "unknown",- fullscreen: document.documentElement.dataset.fullscreen === "true",- actionGroupRight: actionGroupBox- ? Math.round(actionGroupBox.right)- : null,- firstTabLeft: firstTabBox ? Math.round(firstTabBox.left) : null,- headerPaddingLeft: header- ? Math.round(parseFloat(getComputedStyle(header).paddingLeft))- : null,- };- })()`);- check(- openedTabPreview.firstTabLeft !== null &&- (openedTabPreview.platform !== "darwin" ||- openedTabPreview.actionGroupRight === null ||- openedTabPreview.firstTabLeft >=- openedTabPreview.actionGroupRight + 8),- "opened work-panel tabs clear the preview action group",- JSON.stringify(openedTabPreview),- );+ };+ const originalPlatform = await cdp.evaluate(`document.documentElement.dataset.platform`);+ const originalFullscreen = await cdp.evaluate(`document.documentElement.dataset.fullscreen`);+ for (const platform of ["darwin", "win32", "linux"]) {+ for (const fullscreen of [false, true]) {+ await cdp.evaluate(`document.documentElement.dataset.platform = ${JSON.stringify(platform)}; document.documentElement.dataset.fullscreen = "${fullscreen}"`);+ for (let state = 0; state < 2; state += 1) {+ await checkPreviewHitRegions(`${platform}, fullscreen=${fullscreen}, sidebar=${(await measure()).sidebarKind}`);+ await clickSidebarToggle();+ }+ }+ }+ await cdp.evaluate(`document.documentElement.dataset.platform = ${JSON.stringify(originalPlatform)}; ${originalFullscreen === undefined ? "delete document.documentElement.dataset.fullscreen" : `document.documentElement.dataset.fullscreen = ${JSON.stringify(originalFullscreen)}`}`);const previewActions = await cdp.evaluate(`(() => {const firstAction =document.querySelector('.window-chrome-row [data-nav="toggle-sidebar"]') ??@@ -807,19 +830,7 @@ async function main() {"preview actions clear the macOS traffic-light hit area",JSON.stringify(e2eChromePreview),);- check(- e2eChromePreview.platform !== "darwin" ||- e2eChromePreview.sidebarWidth !== null ||- (e2eChromePreview.panelHeaderPaddingLeft !== null &&- e2eChromePreview.previewActionGroupRight !== null &&- e2eChromePreview.panelHeaderPaddingLeft >=- e2eChromePreview.previewActionGroupRight + 8 &&- e2eChromePreview.panelTabStripLeft !== null &&- e2eChromePreview.panelTabStripLeft >=- e2eChromePreview.previewActionGroupRight + 8),- "maximized panel header clears the macOS preview action lane",- JSON.stringify(e2eChromePreview),- );+ await checkPreviewHitRegions("reopened preview");check(e2eChromePreview.platform === "darwin" ||(e2eChromePreview.controlsPosition === "fixed" &&