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): lower window minimum to 800x560 capped to work area
Zihao Pengb3b62fb34c04
diff --git a/apps/desktop/electron/main/bootstrap/window.ts b/apps/desktop/electron/main/bootstrap/window.tsindex 578ac7eb3..d6664127c 100644--- a/apps/desktop/electron/main/bootstrap/window.ts+++ b/apps/desktop/electron/main/bootstrap/window.ts@@ -17,6 +17,7 @@ import {baseWindowBounds,clampBoundsOriginToWorkArea,clampBoundsToWorkArea,+ clampMinimumSizeToWorkArea,displayWorkAreaKey,emptyWorkPanelReservationState,isWorkPanelOuterResizeEdge,@@ -154,8 +155,11 @@ export async function createWindow({const restoredBounds = savedState? clampBoundsToWorkArea(savedState, restoreWorkArea): null;- const initialMinWidth = Math.min(windowMinWidth, restoreWorkArea.width);- const initialMinHeight = Math.min(windowMinHeight, restoreWorkArea.height);+ const { width: initialMinWidth, height: initialMinHeight } =+ clampMinimumSizeToWorkArea(+ { width: windowMinWidth, height: windowMinHeight },+ restoreWorkArea,+ );windowState.mainWindow = new BrowserWindow({...(restoredBounds ?? { width: 1200, height: 800 }),minWidth: initialMinWidth,@@ -298,11 +302,14 @@ export async function createWindow({width: Math.max(0, currentBounds.width - nextBaseBounds.width),xOffset: currentBounds.x - nextBaseBounds.x,};- const minimumWidth = Math.max(- windowMinWidth,- Math.min(display.workArea.width, windowMinWidth + panelWidth),+ const minimumWidth = Math.min(+ display.workArea.width,+ windowMinWidth + panelWidth,+ );+ window.setMinimumSize(+ minimumWidth,+ Math.min(windowMinHeight, display.workArea.height),);- window.setMinimumSize(minimumWidth, windowMinHeight);sendWorkPanelResize("commit", panelWidth);};@@ -381,17 +388,18 @@ export async function createWindow({reservationWidth: windowState.workPanelReservation.width,requestedWidth,});- const minimumWidth = Math.max(- windowMinWidth,- Math.min(display.workArea.width, windowMinWidth + next.reservation.width),+ const minimumWidth = Math.min(+ display.workArea.width,+ windowMinWidth + next.reservation.width,);+ const minimumHeight = Math.min(windowMinHeight, display.workArea.height);if (next.bounds.width < currentBounds.width) {- window.setMinimumSize(minimumWidth, windowMinHeight);+ window.setMinimumSize(minimumWidth, minimumHeight);}windowState.expectedWorkPanelBounds = next.bounds;window.setBounds(next.bounds, false);if (next.bounds.width >= currentBounds.width) {- window.setMinimumSize(minimumWidth, windowMinHeight);+ window.setMinimumSize(minimumWidth, minimumHeight);}const appliedBounds = window.getBounds();windowState.expectedWorkPanelBounds = appliedBounds;@@ -572,10 +580,11 @@ export async function createWindow({if (window.isMaximized() || window.isFullScreen() || window.isMinimized()) return;const currentBounds = window.getBounds();const workArea = screen.getDisplayMatching(currentBounds).workArea;- window.setMinimumSize(- Math.min(windowMinWidth, workArea.width),- Math.min(windowMinHeight, workArea.height),+ const minimum = clampMinimumSizeToWorkArea(+ { width: windowMinWidth, height: windowMinHeight },+ workArea,);+ window.setMinimumSize(minimum.width, minimum.height);const fitted = clampBoundsToWorkArea(currentBounds, workArea);if (windowBoundsEqual(fitted, currentBounds)) return;windowState.expectedWorkPanelBounds = fitted;@@ -655,6 +664,16 @@ export async function createWindow({// mistaken for one (D263).const reconcileDisplayTopology = () => {windowState.workPanelUserMovePending = false;+ // A scale or text-size change shrinks the DIP work area in place; re-cap the+ // minimum so the OS never enforces one the display cannot show (issue #1175).+ // Keep the open work panel's reservation in the minimum; only cap it.+ if (isLiveWindow() && !window.isFullScreen()) {+ const minimum = clampMinimumSizeToWorkArea(+ { width: workPanelMinimumWindowWidth(), height: windowMinHeight },+ screen.getDisplayMatching(window.getBounds()).workArea,+ );+ window.setMinimumSize(minimum.width, minimum.height);+ }reconcileWorkPanelDisplay();};screen.on("display-metrics-changed", reconcileDisplayTopology);@@ -776,7 +795,11 @@ export async function createWindow({boundsGuard = true;try {if (window.isMinimized()) window.restore();- window.setMinimumSize(windowMinWidth, windowMinHeight);+ const minimum = clampMinimumSizeToWorkArea(+ { width: windowMinWidth, height: windowMinHeight },+ screen.getDisplayMatching(electronBounds).workArea,+ );+ window.setMinimumSize(minimum.width, minimum.height);// Prefer normal layer so CG helpers and Stage Manager stay stable.window.setAlwaysOnTop(false);window.show();@@ -1447,16 +1470,20 @@ export async function createWindow({await new Promise((r) => setTimeout(r, 250));captureViewportOverride = true;try {- windowState.mainWindow!.setMinimumSize(1040, 700);- windowState.mainWindow!.setSize(1040, 700, false);+ windowState.mainWindow!.setMinimumSize(windowMinWidth, windowMinHeight);+ windowState.mainWindow!.setSize(windowMinWidth, windowMinHeight, false);await new Promise((r) => setTimeout(r, 350));await probeWorkPanelHeader("minimum-supported");await shot("pi-panel-minimum-supported");} finally {windowState.mainWindow!.setSize(CODEX_BOUNDS.width, CODEX_BOUNDS.height, false);+ const restoredMinimum = clampMinimumSizeToWorkArea(+ { width: workPanelMinimumWindowWidth(), height: windowMinHeight },+ screen.getDisplayMatching(windowState.mainWindow!.getBounds()).workArea,+ );windowState.mainWindow!.setMinimumSize(- workPanelMinimumWindowWidth(),- windowMinHeight,+ restoredMinimum.width,+ restoredMinimum.height,);captureViewportOverride = false;}@@ -1617,9 +1644,13 @@ export async function createWindow({`);} finally {windowState.mainWindow!.setSize(CODEX_BOUNDS.width, CODEX_BOUNDS.height, false);+ const restoredMinimum = clampMinimumSizeToWorkArea(+ { width: workPanelMinimumWindowWidth(), height: windowMinHeight },+ screen.getDisplayMatching(windowState.mainWindow!.getBounds()).workArea,+ );windowState.mainWindow!.setMinimumSize(- workPanelMinimumWindowWidth(),- windowMinHeight,+ restoredMinimum.width,+ restoredMinimum.height,);captureViewportOverride = false;}diff --git a/apps/desktop/electron/main/index.ts b/apps/desktop/electron/main/index.tsindex 8c98cba26..5d0b0bac3 100644--- a/apps/desktop/electron/main/index.ts+++ b/apps/desktop/electron/main/index.ts@@ -40,7 +40,11 @@ import {} from "./models-dev-catalog";import { VendorOAuth } from "./oauth";import { AppUpdaterController } from "./updater";-import type { WorkPanelReservationState } from "./work-panel-window";+import {+ WINDOW_MIN_HEIGHT,+ WINDOW_MIN_WIDTH,+ type WorkPanelReservationState,+} from "./work-panel-window";import { InflightCheckpointer } from "@pi-desktop/host-runtime";import { withGitBranch } from "./workspace-git";import { applyDevelopmentUserData, desktopDataDir } from "./data-paths";@@ -117,8 +121,6 @@ if (!hasSingleInstanceLock) {app.quit();}-const WINDOW_MIN_WIDTH = 1040;-const WINDOW_MIN_HEIGHT = 700;// Native resize streams can pause briefly while the pointer crosses a display// scale boundary. Keep recovery out of that gesture and only run it after the// bounds have been stable for one short interaction window.diff --git a/apps/desktop/electron/main/work-panel-window.ts b/apps/desktop/electron/main/work-panel-window.tsindex bd0f415bd..d2e6dfb48 100644--- a/apps/desktop/electron/main/work-panel-window.ts+++ b/apps/desktop/electron/main/work-panel-window.ts@@ -21,7 +21,10 @@ export type WorkPanelReservationState = {export const WORK_PANEL_MIN_WIDTH = 244;export const WORK_PANEL_MAX_WIDTH = 720;-export const WORK_PANEL_CHAT_MIN_WIDTH = 1040;+/** App-wide minimum window size, in DIP, before clamping to the work area. */+export const WINDOW_MIN_WIDTH = 800;+export const WINDOW_MIN_HEIGHT = 560;+export const WORK_PANEL_CHAT_MIN_WIDTH = WINDOW_MIN_WIDTH;export const WORK_PANEL_CHAT_MAX_WIDTH = 10000;export const emptyWorkPanelReservationState = (): WorkPanelReservationState => ({@@ -148,6 +151,22 @@ export function clampBoundsToWorkArea(return clampBoundsOriginToWorkArea({ ...bounds, width, height }, workArea);}+/**+ * Caps a requested minimum window size to the current work area so the OS+ * never enforces a minimum larger than the display can show (issue #1175:+ * Windows at 150% scaling reports a ~1280x672 DIP work area). Each dimension+ * is floored to an integer and kept at least 1.+ */+export function clampMinimumSizeToWorkArea(+ min: { width: number; height: number },+ workArea: { width: number; height: number },+): { width: number; height: number } {+ return {+ width: Math.max(1, Math.floor(Math.min(min.width, workArea.width))),+ height: Math.max(1, Math.floor(Math.min(min.height, workArea.height))),+ };+}+export function planWorkPanelReservation({baseBounds,workArea,diff --git a/apps/desktop/src/lib/work-panel-resize.ts b/apps/desktop/src/lib/work-panel-resize.tsindex 589f9db30..708195840 100644--- a/apps/desktop/src/lib/work-panel-resize.ts+++ b/apps/desktop/src/lib/work-panel-resize.ts@@ -3,7 +3,7 @@// this only affects a new profile without a saved preference.export const WORK_PANEL_MIN_WIDTH = 244;export const WORK_PANEL_DEFAULT_WIDTH = 360;-export const WORK_PANEL_CHAT_MIN_WIDTH = 1040;+export const WORK_PANEL_CHAT_MIN_WIDTH = 800;export const WORK_PANEL_CHAT_MAX_WIDTH = 10000;/*** Hard MainChat floor for the in-flow three-column shell. The work panel maydiff --git a/apps/desktop/test/work-panel-resize.test.mjs b/apps/desktop/test/work-panel-resize.test.mjsindex 3c7baa0c7..cde92239f 100644--- a/apps/desktop/test/work-panel-resize.test.mjs+++ b/apps/desktop/test/work-panel-resize.test.mjs@@ -171,7 +171,9 @@ test("clamps the work panel to its minimum without a fixed upper bound", () => {});test("clamps the conversation area to its bounded native resize range", () => {- assert.equal(clampWorkPanelChatWidth(900), WORK_PANEL_CHAT_MIN_WIDTH);+ assert.equal(WORK_PANEL_CHAT_MIN_WIDTH, 800);+ assert.equal(clampWorkPanelChatWidth(700), WORK_PANEL_CHAT_MIN_WIDTH);+ assert.equal(clampWorkPanelChatWidth(900), 900);assert.equal(clampWorkPanelChatWidth(1200), 1200);assert.equal(clampWorkPanelChatWidth(20000), WORK_PANEL_CHAT_MAX_WIDTH);});@@ -213,9 +215,9 @@ test("commits only a changed conversation preview after a completed gesture", ()});test("accepts only bounded integer conversation widths over IPC", () => {- assert.equal(parseWorkPanelChatWidth({ width: 1040 }), 1040);+ assert.equal(parseWorkPanelChatWidth({ width: 800 }), 800);assert.equal(parseWorkPanelChatWidth({ width: 10000 }), 10000);- assert.equal(parseWorkPanelChatWidth({ width: 1039 }), null);+ assert.equal(parseWorkPanelChatWidth({ width: 799 }), null);assert.equal(parseWorkPanelChatWidth({ width: 10000.5 }), null);assert.equal(parseWorkPanelChatWidth({ width: "1200" }), null);assert.equal(parseWorkPanelChatWidth(null), null);diff --git a/apps/desktop/test/work-panel-window.test.mjs b/apps/desktop/test/work-panel-window.test.mjsindex 18523468f..22866318f 100644--- a/apps/desktop/test/work-panel-window.test.mjs+++ b/apps/desktop/test/work-panel-window.test.mjs@@ -1,7 +1,12 @@import assert from "node:assert/strict";+import { readFileSync } from "node:fs";import test from "node:test";import {+ WINDOW_MIN_HEIGHT,+ WINDOW_MIN_WIDTH,+ WORK_PANEL_CHAT_MIN_WIDTH,baseWindowBounds,+ clampMinimumSizeToWorkArea,clampBoundsOriginToWorkArea,clampBoundsToWorkArea,displayWorkAreaKey,@@ -25,12 +30,42 @@ test("legacy work-panel edge classifier remains available to geometry helpers",});test("chat resize IPC accepts only bounded integer widths", () => {- assert.equal(parseWorkPanelChatWidth({ width: 1040 }), 1040);+ assert.equal(parseWorkPanelChatWidth({ width: 800 }), 800);assert.equal(parseWorkPanelChatWidth({ width: 10000 }), 10000);- assert.equal(parseWorkPanelChatWidth({ width: 1039 }), null);+ assert.equal(parseWorkPanelChatWidth({ width: 799 }), null);+ assert.equal(parseWorkPanelChatWidth({ width: 10001 }), null);assert.equal(parseWorkPanelChatWidth({ width: 10000.5 }), null);});+test("app-wide minimum window size is shared with the chat width floor", () => {+ assert.equal(WINDOW_MIN_WIDTH, 800);+ assert.equal(WINDOW_MIN_HEIGHT, 560);+ assert.equal(WORK_PANEL_CHAT_MIN_WIDTH, WINDOW_MIN_WIDTH);+});++test("minimum window size is capped to the work area", () => {+ const scaledWorkArea = { width: 1280, height: 672 };+ assert.deepEqual(+ clampMinimumSizeToWorkArea({ width: 1040, height: 700 }, scaledWorkArea),+ { width: 1040, height: 672 },+ );+ assert.deepEqual(+ clampMinimumSizeToWorkArea(+ { width: WINDOW_MIN_WIDTH, height: WINDOW_MIN_HEIGHT },+ workArea,+ ),+ { width: 800, height: 560 },+ );+ assert.deepEqual(+ clampMinimumSizeToWorkArea({ width: 800, height: 560 }, { width: 640.7, height: 480.9 }),+ { width: 640, height: 480 },+ );+ assert.deepEqual(+ clampMinimumSizeToWorkArea({ width: 800, height: 560 }, { width: 0, height: 0.5 }),+ { width: 1, height: 1 },+ );+});+test("display work-area keys change with display geometry", () => {assert.equal(displayWorkAreaKey(1, workArea), "1:0:0:1920:1080");assert.notEqual(@@ -486,3 +521,18 @@ test("reservation width parsing rejects coerced and malformed IPC input", () =>assert.equal(parseWorkPanelReservationWidth(input), null);}});++test("display topology changes cap the reserved minimum instead of dropping it", () => {+ const windowSource = readFileSync(+ new URL("../electron/main/bootstrap/window.ts", import.meta.url),+ "utf8",+ );+ const handler =+ windowSource.match(/const reconcileDisplayTopology = \(\) => \{[\s\S]*?\n \};/)?.[0] ?? "";+ assert.ok(handler, "reconcileDisplayTopology handler not found");+ assert.match(+ handler,+ /clampMinimumSizeToWorkArea\(\s*\{ width: workPanelMinimumWindowWidth\(\), height: windowMinHeight \}/,+ );+ assert.doesNotMatch(handler, /\{ width: windowMinWidth, height: windowMinHeight \}/);+});diff --git a/apps/desktop/test/work-panel.test.mjs b/apps/desktop/test/work-panel.test.mjsindex 08ef9e209..3d82a052c 100644--- a/apps/desktop/test/work-panel.test.mjs+++ b/apps/desktop/test/work-panel.test.mjs@@ -451,15 +451,18 @@ test("work panel separator exposes internal panel width resizing", () => {});test("Electron enforces the responsive shell minimum", () => {- assert.match(mainSource, /const WINDOW_MIN_WIDTH = 1040/);- assert.match(mainSource, /const WINDOW_MIN_HEIGHT = 700/);- // The window creation clamps the minimum to fit the current work area, so- // the props are the clamped `initialMin*` values, both derived from- // `windowMin*` via `Math.min(windowMin*, restoreWorkArea.*)`.+ assert.match(mainSource, /export const WINDOW_MIN_WIDTH = 800/);+ assert.match(mainSource, /export const WINDOW_MIN_HEIGHT = 560/);+ // The window creation clamps the minimum to fit the current work area+ // (issues #544 / #1175), so the props are the clamped `initialMin*` values.assert.match(mainSource, /minWidth:\s*initialMinWidth/);assert.match(mainSource, /minHeight:\s*initialMinHeight/);- assert.match(mainSource, /initialMinWidth = Math\.min\(windowMinWidth/);- assert.match(mainSource, /initialMinHeight = Math\.min\(windowMinHeight/);+ assert.match(+ mainSource,+ /\{ width: initialMinWidth, height: initialMinHeight \} =\s*clampMinimumSizeToWorkArea\(/,+ );+ // Every unconditional app-minimum reassertion goes through the same clamp.+ assert.doesNotMatch(mainSource, /setMinimumSize\(windowMinWidth, windowMinHeight\);\n\s*\/\/ Prefer normal layer/);});test("built-in terminal is absent while the work panel keeps its other surfaces", () => {diff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.mdindex 4eb4e4bcb..5483131d9 100644--- a/docs/spec/04-ux/01-ui-ia.md+++ b/docs/spec/04-ux/01-ui-ia.md@@ -148,7 +148,8 @@ destination, chat as the home surface, tools and permissions inline.rectangle continues to position the native Browser view. Native window edgesresize the app window only; they do not change the panel target. The outerwindow remains natively resizable from all OS edges and corners, with a- minimum supported size of 1040×700. Replaces+ minimum supported size of 800×560, capped to the current display's work+ area (D635). Replacesthe former context-panel overlay; workspace/model/status info lives in thecomposer chips and Settings instead.- **Composer**: workspace-agnostic floating pill anchored to the conversationdiff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.mdindex 3431f0c37..d040e4812 100644--- a/docs/spec/04-ux/07-ui-design-system.md+++ b/docs/spec/04-ux/07-ui-design-system.md@@ -1062,8 +1062,8 @@ Codex parity decisions (D034/D070) supersede any older value here.| Composer toolbar | MainChat `≥450px` | Left/right control groups stay on one row and do not shrink; mode/permission labels stay single-line and ellipsize || Composer draft height | 1–7 text lines | Auto-grow; internal scroll beyond line 7 || Chat message max width | 760px default band (user-resizable, min 560px) / 600px user plate | Band follows `min(pane, preferred)`; user turns stay compact |-| Window min width | 1040px | Enforced by Electron for the whole app; opening the panel never changes native bounds |-| Window min height | 700px | Enforced by Electron |+| Window min width | 800px | Enforced by Electron for the whole app, capped to the current display work area (D635); opening the panel never changes native bounds |+| Window min height | 560px | Enforced by Electron, capped to the current display work area (D635) |An open work panel is a fixed-width in-flow column inside the existing clientarea (ADR 0033 / ADR 0151). Its flex allocation comes from MainChat, but MainPane@@ -1110,8 +1110,8 @@ header-height background behind the excluded lane without covering its controls.Frameless titlebar drag regions never replace the OS resize ownership. A300ms stable-bounds settle window prevents recovery logic from competing witha slow pointer gesture, and normal base bounds persist 600ms after the last- native resize/move event. Width < 1040px or height < 700px is unsupported and- prevented by Electron.+ native resize/move event. Electron enforces an 800×560 minimum, capped to the+ current display's work area (D635); smaller sizes are unsupported.## 11. Component foundationsdiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex ea15f57e1..9dc31311f 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -1972,7 +1972,7 @@ identify the platform validation still needed.and inspect the command/file and keyboard hints. 5) Type `/` and inspect theslash menu. Include Skills with long English/CJK descriptions, short/nodescriptions, a separate title/argument hint, and an exceptionally long slash- name; also inspect a long filename in `@` mode. Repeat at 1040px and 1680px+ name; also inspect a long filename in `@` mode. Repeat at 800px and 1680pxviewport widths with 320px and 640px composer widths. 6) Switch to zh-CN andrepeat the context-switch checks.- **Expected**: The initially rendered context starts with its welcome copy and stays stable until@@ -2563,7 +2563,7 @@ identify the platform validation still needed.#### E2E-043: Settings content follows window width- **Preconditions**: App running windowed on macOS with Settings open.-- **Steps**: 1) Open Basics at the default window width and record the content-card width. 2) Expand the window to 1600px wide. 3) Open Model configuration, Import, and Project archive. 4) Shrink the window to the supported 1040px minimum.+- **Steps**: 1) Open Basics at the default window width and record the content-card width. 2) Expand the window to 1600px wide. 3) Open Model configuration, Import, and Project archive. 4) Shrink the window to the supported 800px minimum.- **Expected**: The right-side content cards expand and contract with the available pane at every tested width; the 275px rail and pane gutters remain stable; controls remain visible without clipping or horizontal page scrolling.- **Specs linked**: `04-ux/06-settings-ia.md`, `04-ux/07-ui-design-system.md`- **Acceptance**: Quality (key operations feel polished)@@ -3208,7 +3208,7 @@ identify the platform validation still needed.#### E2E-033: Window bounds persist across restart- **Preconditions**: App running with default window size.-- **Steps**: 1) Resize/move the window to distinct normal bounds A (≥1040×700), maximize before the 600ms save debounce ends, quit, and relaunch. 2) Restore, resize/move to distinct bounds B, quit before the debounce ends, and relaunch again.+- **Steps**: 1) Resize/move the window to distinct normal bounds A (≥800×560), maximize before the 600ms save debounce ends, quit, and relaunch. 2) Restore, resize/move to distinct bounds B, quit before the debounce ends, and relaunch again.- **Expected**: Each relaunch restores the latest normal bounds (A, then B), including when quit occurs while maximized or with a pending save. Maximized/fullscreen geometry is never stored as normal bounds; invalid/tiny saved bounds fall back to the 1200×800 default.- **Specs linked**: `04-ux/09-interaction-patterns.md`- **Acceptance**: Quality (key operations feel polished)@@ -9081,8 +9081,8 @@ This test plan spec is accepted when:submits/aborts the current turn.### US-UI-19 Permanent Stage Manager bounds restore (macOS only)-- On macOS with Stage Manager, shrink or unfocus the PI window until width < 1040 or height < 700.-- Expect the shell to re-assert a Codex-like footprint (~1200×800, min 1040×700) and keep restoring while still collapsed (not only during the first 20s after launch).+- On macOS with Stage Manager, shrink or unfocus the PI window until width < 800 or height < 560.+- Expect the shell to re-assert a Codex-like footprint (~1200×800, min 800×560 capped to the display work area) and keep restoring while still collapsed (not only during the first 20s after launch).- The recovery watchdog is macOS-only (D447). On Windows/Linux it must not run at all: the app must never re-layer or re-raise its own window unprompted. Focus another window, then confirm PI-Desktop stays behind it instead of jumping back to the top of the stack, and that a stacking check (`xprop -root _NET_CLIENT_LIST_STACKING`) never shows it returning to the top periodically.### US-UI-20 Dark floating composer box@@ -9360,7 +9360,7 @@ This test plan spec is accepted when:- Expect the working theme selector without inert toggle or open-target rows.- Expect Permissions + Basics + Appearance elevated cards; Agent,Import, and Info remain the only other destinations.-- Resize between 1040px, 1200px, and 1600px widths; the content cards fill the+- Resize between 800px, 1200px, and 1600px widths; the content cards fill theavailable right pane at each size without changing the rail or introducinghorizontal scrolling.@@ -11288,7 +11288,8 @@ This test plan spec is accepted when:maximum, then verify the target follows the live budget (`client width - 360px - expanded sidebar`) instead of a fixed cap.4. Close and relaunch the app after the resize settles.- **Expected**: Native edge and corner hit regions remain available in frameless- chrome, the minimum size remains 1040×700, and the recovery watchdog does not+ chrome, the minimum size remains 800×560 (capped to the display+ work area), and the recovery watchdog does notcompete with a slow resize stream. The renderer-owned divider updates thebounded panel target without changing native bounds; the last settled windowbounds and the committed panel width reopen after relaunch. No temporarydiff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex 87c38ab62..d4fb90190 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -29,6 +29,7 @@ This log freezes previously open questions into concrete decisions.| D459 | Restore resizable sidebar width with collapse-below-threshold | **Amend D408 / ADR 0238 and restore ADR 0141 (ADR 0290): the expanded sidebar is again a renderer-owned `240px..520px` column (default `275px`) with a right-edge handle that previews on pointer-down, persists on release, and supports ArrowLeft/ArrowRight (16px), Home, and End. A pointer width below `160px` collapses as a user action without overwriting the preferred expanded width; keyboard resize never collapses. Live maximum is the three-column remainder after MainChat's 450px floor. Renderer only; existing `pi.desktop.sidebarWidth` preference. See E2E-168.** | Long labels need reclaimable width; ADR 0238's fixed 275px pin blocked that while the live three-column budget could already cap a user-chosen width. This decision was mistakenly recorded as D451 (already used by Review-opens-only-on-explicit-user-action); renumbered per issue #620. || D457 | Signed macOS DMG is a two-icon install | *(amended by D634)* **Amend D406 / ADR 0232 / ADR 0204: official and local DMGs contain only PI-Desktop.app and the Applications link on a branded 720×440 plate. The ZIP contains PI-Desktop.app only. Neither macOS format includes the opening note or command helper, including unsigned debug artifacts. See ADR 0296 / ADR 0309 and E2E-196b.** | Tagged DMGs are signed and notarized (D450); unsigned first-launch guidance is no longer needed in package artifacts. || D634 | Remove bundled macOS first-launch guidance | **Amend D457 / ADR 0296 and the macOS distribution provisions of ADR 0232 / ADR 0204: neither macOS DMG nor ZIP ships `PI-Desktop-macOS-open.command`, `PI-Desktop-macOS-opening-help.txt`, or another bundled quarantine-clearing helper or opening note. The ZIP contains `PI-Desktop.app` at its root; the DMG remains a two-icon install. This applies to signed releases and local or opt-in unsigned debug builds. See ADR 0309 and E2E-196b.** | The signed release lane has eliminated the user need for an unsigned first-launch workaround; shipping it beside debug builds risks suggesting a Gatekeeper bypass. |+| D635 | Work-area-capped 800×560 window minimum | **Supersede the 1040×700 window minimum in D156 / D447 (and the matching clauses of ADR 0029 / ADR 0238) and the `1040..10000` `window/setWorkPanelChatWidth` range (ADR 0146): Electron enforces an 800×560 minimum, capped per dimension to the current display work area by `clampMinimumSizeToWorkArea`. The chat-width IPC and renderer accept `800..10000`. On narrow windows the existing `workPanelLayout` budget caps the docked panel so MainChat keeps its 450px floor, collapsing the sidebar first. See US-UI-19 and E2E-167.** | At 150% Windows scaling the work area is about 1280×672 DIP, so a fixed minimum could exceed the screen and leave the window unfittable. || D450 | Signed macOS GitHub Releases | **Amend D078 / ADR 0022: GitHub tag releases Developer ID-sign, notarize (`notarytool` via electron-builder 26), staple, and Gatekeeper-verify macOS DMG/ZIP before upload, using identity `Developer ID Application: XingYu Liu (DUV63RKYTW)` / team `DUV63RKYTW` from Actions secrets (`CSC_LINK`, `CSC_KEY_PASSWORD`, `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID`). Missing secrets fail the job. Local unsigned packaging without a certificate remains. `workflow_dispatch` may set `sign_macos: false` only for unsigned debug artifacts. Packaged macOS uses in-app `electron-updater` (ZIP + merged `latest-mac.yml`); Linux deb/rpm and Windows portable ZIP stay notify-and-link. No afterPack/afterSign adhoc codesign (ADR 0278).** | Production DMGs must open without a Gatekeeper warning, and signed macOS installs can download and restart into a new tag. See ADR 0289, E2E-196c, E2E-067A. |## B. Secondary implementation defaults@@ -7299,3 +7300,23 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.covers native DMG and ZIP archive inspection.- D634 amends D457 / ADR 0296 and supersedes the macOS distribution provisionsof ADR 0232 / ADR 0204. See ADR 0309.++## 2026-09-29 — Work-area-capped 800×560 window minimum (D635)++- The app-wide window minimum is 800×560 DIP. `clampMinimumSizeToWorkArea`+ caps each dimension to the current display's work area (floored, at least 1)+ wherever Main sets the minimum: window creation, display reconciliation,+ Stage Manager recovery, and the work-panel resize paths. At 150% scaling on+ Windows the work area is about 1280×672 DIP, so a fixed minimum could be+ larger than the screen.+- `window/setWorkPanelChatWidth` and the renderer's chat-width clamp accept+ `800..10000px`; the two floors share one constant so a renderer-valid width+ is never rejected by Main.+- On a narrow window the existing three-column budget (`workPanelLayout`)+ still applies: the docked panel is capped so MainChat keeps its 450px floor,+ and the expanded sidebar auto-collapses first. Saved panel widths are not+ rewritten.+- D635 supersedes the 1040×700 minimum in D156 / D447 (and the matching+ clauses of ADR 0029 / ADR 0238) and the `1040..10000` chat-width range in+ ADR 0146. `work-panel-window.test.mjs` and `work-panel-resize.test.mjs`+ cover the clamp and chat-width range; see US-UI-19 and E2E-167.