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): keep window controls below splash and overlays
vastsaff340865c6de
diff --git a/apps/desktop/src/features/app/AppShell.tsx b/apps/desktop/src/features/app/AppShell.tsxindex f82e0ebd6..890463836 100644--- a/apps/desktop/src/features/app/AppShell.tsx+++ b/apps/desktop/src/features/app/AppShell.tsx@@ -308,8 +308,8 @@ export function AppShell() {><div className="app-scenic-backdrop" aria-hidden />{shell}- {/* Keep native-window actions outside pane stacking contexts. */}- {ready && <WindowControls />}+ {/* Outside pane stacking; skip splash so the band cannot cover boot chrome. */}+ {ready && !showSplash && <WindowControls />}<ProjectCreateDialog />{splash}</div>diff --git a/apps/desktop/src/styles/chrome.css b/apps/desktop/src/styles/chrome.cssindex 46f72dd5b..ea7e922f9 100644--- a/apps/desktop/src/styles/chrome.css+++ b/apps/desktop/src/styles/chrome.css@@ -1003,11 +1003,20 @@/* Electron resolves app-region hit testing across siblings. The controls must* be a later compositor layer than Settings, plugin content, or a work-panel- * drag header. */+ * drag header. Direct-child overlays (search, toasts, splash) must still win. */.app-shell > .window-controls {z-index: 1100;}+.app-shell > .search-overlay,+.app-shell > .toast-viewport {+ z-index: 1200;+}++.app-shell > .startup-splash {+ z-index: 1300;+}+/* Follow the adjacent titlebar surface when the dock occupies the right edge. */.app-shell:has(> .work-panel) > .window-controls {background: var(--ds-bg-dock-raised);diff --git a/apps/desktop/test/plugin-settings-renderer-surface.test.mjs b/apps/desktop/test/plugin-settings-renderer-surface.test.mjsindex fc26e5492..baf5270f5 100644--- a/apps/desktop/test/plugin-settings-renderer-surface.test.mjs+++ b/apps/desktop/test/plugin-settings-renderer-surface.test.mjs@@ -37,4 +37,9 @@ test("window controls have a compositor layer above Settings destinations", () =const chrome = read("src/styles/chrome.css");assert.match(chrome, /\.window-controls\s*\{[\s\S]*?z-index:\s*1000/s);assert.match(chrome, /\.app-shell\s*>\s*\.window-controls\s*\{[\s\S]*?z-index:\s*1100/s);+ assert.match(+ chrome,+ /\.app-shell\s*>\s*\.search-overlay,\s*\n\.app-shell\s*>\s*\.toast-viewport\s*\{[\s\S]*?z-index:\s*1200/s,+ );+ assert.match(chrome, /\.app-shell\s*>\s*\.startup-splash\s*\{[\s\S]*?z-index:\s*1300/s);});diff --git a/apps/desktop/test/window-menu.test.mjs b/apps/desktop/test/window-menu.test.mjsindex cff800b6a..d1cb11a4a 100644--- a/apps/desktop/test/window-menu.test.mjs+++ b/apps/desktop/test/window-menu.test.mjs@@ -166,7 +166,7 @@ test("Windows and Linux use menu-free frameless chrome with window controls", ()assert.match(controlsSource, /ariaLabel=\{t\("window\.minimize"/);assert.match(controlsSource, /ariaLabel=\{t\("window\.close"/);assert.equal((appSource.match(/<WindowControls\s*\/>/g) ?? []).length, 1);- assert.match(appSource, /\{shell\}[\s\S]*?\{ready && <WindowControls \/>\}/);+ assert.match(appSource, /\{shell\}[\s\S]*?\{ready && !showSplash && <WindowControls \/>\}/);assert.match(stylesSource,/\.window-control-btn\s*\{[^}]*-webkit-app-region:\s*no-drag;[^}]*pointer-events:\s*auto;/s,diff --git a/apps/desktop/test/work-panel.test.mjs b/apps/desktop/test/work-panel.test.mjsindex 0ab162f0d..866cf8e5a 100644--- a/apps/desktop/test/work-panel.test.mjs+++ b/apps/desktop/test/work-panel.test.mjs@@ -607,7 +607,7 @@ test("preview mode keeps shell actions and restores routes before navigation", (assert.match(appSource, /className=\{cx\([\s\S]*?"window-chrome-row"/);assert.match(appSource, /data-nav="new-task"/);assert.match(appSource, /<CollapsedTitlebarActions[\s\S]*?onNewTask=/);- assert.match(appSource, /\{ready && <WindowControls \/>\}/);+ assert.match(appSource, /\{ready && !showSplash && <WindowControls \/>\}/);assert.match(appSource, /const workPanelMaximizedRef = useRef\(false\)/);assert.match(appSource,diff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.mdindex 4fed80673..e99af3100 100644--- a/docs/spec/04-ux/01-ui-ia.md+++ b/docs/spec/04-ux/01-ui-ia.md@@ -77,6 +77,7 @@ destination, chat as the home surface, tools and permissions inline.stays outside pane stacking contexts across panel open, preview, restore,and Settings transitions. Its background follows the adjacent titlebar surface(dock header when open, conversation surface when closed) in both themes.+ Boot splash, search, and toasts stay above that band.Preview navigation must also remain above the panel;macOS keeps native traffic lights and its existing fullscreen insets.Destination history isdiff --git a/docs/zh-CN/spec/04-ux/01-ui-ia.md b/docs/zh-CN/spec/04-ux/01-ui-ia.mdindex c3394bb61..bd1f56531 100644--- a/docs/zh-CN/spec/04-ux/01-ui-ia.md+++ b/docs/zh-CN/spec/04-ux/01-ui-ia.md@@ -77,12 +77,10 @@The main process uses the same geometry from `@pi-desktop/shared`.Right native-control exclusion is unchanged; header-height background paintfills the left lane without an opaque overlay covering panel controls.- One window-level control band stays outside pane stacking contexts across- panel open, preview, restore, and Settings transitions. Its background follows- the adjacent titlebar surface (dock header when open, conversation surface when- closed) in both themes. Preview navigation- must also remain above the panel; macOS keeps native traffic lights and its- existing fullscreen insets.+ 窗口级控件条始终挂在各面板堆叠上下文之外,覆盖面板打开、预览、还原和设置页切换。+ 背景跟随相邻标题栏(打开时为停靠栏标题,关闭时为会话表面),深浅色主题均如此。+ 启动闪屏、搜索和 Toast 保持在控件条之上。预览导航也必须保持在面板之上;+ macOS 继续使用原生交通灯和既有全屏留白。Windows/Linux 使用无菜单的无框架 46px 行,并在左侧和可访问的最小化/最大化或恢复/关闭控件右(D129)。目的地历史以快捷键为主(`Cmd/Ctrl+[` 和diff --git a/scripts/e2e-three-column-layout.mjs b/scripts/e2e-three-column-layout.mjsindex ee098006f..f5bdc47b6 100644--- a/scripts/e2e-three-column-layout.mjs+++ b/scripts/e2e-three-column-layout.mjs@@ -716,7 +716,7 @@ async function main() {const actions = [...row.querySelectorAll("[data-nav]")];const headerBox = header.getBoundingClientRect();const firstTab = document.querySelector(".work-panel-tab");- const controls = row.querySelector(".window-controls");+ const controls = document.querySelector(".window-controls");const sidebar = document.querySelector(".sidebar");const platform = document.documentElement.dataset.platform;const inset = parseFloat(getComputedStyle(row).paddingLeft);@@ -779,7 +779,7 @@ async function main() {sidebarToggle:!!document.querySelector('.window-chrome-row [data-nav="toggle-sidebar"]') ||!!document.querySelector('.sidebar [data-nav="toggle-sidebar"]'),- controls: !!document.querySelector(".window-chrome-row .window-controls"),+ controls: !!document.querySelector(".window-controls"),};})()`);check(@@ -1061,7 +1061,7 @@ async function main() {};const e2eChromeProbe = `(() => {const band = document.querySelector(".window-chrome-row");- const controls = document.querySelector(".window-chrome-row .window-controls");+ const controls = document.querySelector(".window-controls");const sidebar = document.querySelector(".sidebar, .sidebar-rail");const handle = document.querySelector(".sidebar-resize-handle");const panel = document.querySelector('[data-testid="work-panel"]');