Skip to content

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

docs(spec): record the single-source traffic-light reserve

ZeroYf9a052170da1
diff --git a/docs/adr/0238-three-column-width-priority.md b/docs/adr/0238-three-column-width-priority.md
index f0397b9e9..32a705149 100644
--- a/docs/adr/0238-three-column-width-priority.md
+++ b/docs/adr/0238-three-column-width-priority.md
@@ -65,8 +65,8 @@ MainChat to its floor while the expanded sidebar kept its full width.
(never persisted, ends with the panel) and never changes native bounds.
Because MainChat is absent in this mode, AppShell supplies a window-level
46px chrome row with New Task, sidebar, and native window controls.
- Collapsed-sidebar preview reserves 76px on the left for macOS traffic lights
- in windowed mode and 8px in fullscreen.
+ Collapsed-sidebar preview reserves 88px on the left for macOS traffic lights
+ in windowed mode and 8px in fullscreen (D433).
## Consequences
diff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.md
index 7f8434b28..0373d981d 100644
--- a/docs/spec/04-ux/01-ui-ia.md
+++ b/docs/spec/04-ux/01-ui-ia.md
@@ -81,9 +81,12 @@ destination, chat as the home surface, tools and permissions inline.
bell instead (D130/D117). In work-panel preview mode, MainChat is unmounted
and 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
+ reserves the 88px 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.
+ the traffic lights or the preview controls. The inset is the shared
+ `--ds-window-lead-inset` token — the cluster's 76px right edge (from
+ `@pi-desktop/shared`) plus a 12px gap — and the main process positions the
+ buttons from that same shared geometry.
- **Work panel**: docked right column (not an overlay) opened by an artifact,
the viewport-fixed toggle, or `Cmd/Ctrl + J`. File, URL, browser-preview, and
successful workspace-edit artifacts create their resources atomically. The
diff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.md
index 48c0dc95b..ba61b608a 100644
--- a/docs/spec/04-ux/07-ui-design-system.md
+++ b/docs/spec/04-ux/07-ui-design-system.md
@@ -507,10 +507,13 @@ followed by a divider and compact Settings / Logs / Theme rows.
Toolbar rows are 46px. macOS places traffic lights at `{x:16,y:16}` and keeps
the expanded sidebar's Collapse sidebar icon button right-aligned
-in that same row. The macOS row omits the sidebar logo/title, reserves `76px`
+in that same row. The macOS row omits the sidebar logo/title, reserves `88px`
on the left for native chrome in windowed mode, and reclaims that padding in
-fullscreen. Windows/Linux keep the identity and sidebar actions in their first
-row and reserve the rightmost 120px for three frameless-window controls. The
+fullscreen. That reserve is the shared `--ds-window-lead-inset` token — the
+cluster's `76px` right edge (the same `@pi-desktop/shared` geometry the main
+process positions the buttons with) plus `12px` of breathing room. Windows/Linux
+keep the identity and sidebar actions in their first row and reserve the
+rightmost 120px for three frameless-window controls. The
controls retain 112px of full-height hit targets, while the outer band adds an
8px visual buffer before adjacent work-panel actions. The band paints an opaque
`bg-primary` surface so page content never shows through the controls, and its
@@ -1044,9 +1047,12 @@ retain the fade-and-slide exit.
Preview mode is a transient shell state: MainChat is unmounted and the work
panel 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
+Collapsed-sidebar preview reserves 88px on the left for macOS traffic lights in
+windowed mode and 8px in fullscreen. That reserve is the shared
+`--ds-window-lead-inset` token — the traffic-light cluster's 76px right edge
+(native geometry from `@pi-desktop/shared`, the same constants the main process
+positions the buttons with) plus a 12px gap. The maximized panel header retains
+that native reserve, then adds the preview action lane and an 8px gap before its
first tab.
### 10.1 Responsive collapse
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 5f344eb4e..174ca5a8b 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -66,8 +66,12 @@ Outer frame that positions Topbar, Sidebar, MainChat, and WorkPanel. Owns resize
- Work panel preview: the header maximize action temporarily unmounts MainChat
and 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.
+ window controls. On macOS, collapsed-sidebar preview reserves 88px on the
+ left in windowed mode and 8px in fullscreen for the traffic lights. That
+ reserve is the shared `--ds-window-lead-inset` token — the traffic-light
+ cluster's right edge (76px, from `@pi-desktop/shared`) plus a 12px gap — and
+ the main process places the buttons from that same shared geometry, so the
+ reserve and the buttons cannot drift apart.
- Work panel resize: its inner left-edge handle changes the committed panel
width in the renderer, so dragging left gives the panel more internal space
and dragging right returns space to MainChat (§5.4)
@@ -232,14 +236,14 @@ combined model × reasoning selection (§11).
frameless drag band
- Border: border-subtle bottom on every route-owned titlebar surface
- Position: absolute 46px frameless band; `-webkit-app-region: drag` with
- `no-drag` on interactive controls; macOS reserves the left ~76px for traffic
+ `no-drag` on interactive controls; macOS reserves the left 88px for traffic
lights (only when the sidebar is collapsed), Windows/Linux reserve the right
120px for native window controls (112px hit targets plus an 8px visual
buffer). The conversation titlebar also reserves the 28px work-panel toggle
while the panel is closed. While the panel is open, that 120px band plus the
toggle overlay the panel header instead, and the header ends its box before
the 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
+ In macOS windowed preview mode, a collapsed sidebar also adds the 88px
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.
diff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.md
index 128fa86c2..a2094f4d6 100644
--- a/docs/spec/04-ux/09-interaction-patterns.md
+++ b/docs/spec/04-ux/09-interaction-patterns.md
@@ -1097,8 +1097,10 @@ Work-panel and application-window resizing are implemented in MVP:
- Preview mode unmounts MainChat and lets the work panel fill the client area
beside 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.
+ panel header reserves the 88px windowed (8px fullscreen) traffic-light inset,
+ the preview action lane, and an 8px gap before its first tab. That 88px is the
+ shared `--ds-window-lead-inset` token: the traffic-light cluster's 76px right
+ edge (native geometry from `@pi-desktop/shared`) plus a 12px gap.
The expanded sidebar is fixed at 275px. Collapse/open changes only whether the
column is present; the historical resize handle is hidden and legacy width
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index 73bc3c825..533b7c03b 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -1648,7 +1648,7 @@ identify the platform validation still needed.
band renders instead (no chat top-bar controls) while retaining the same
surface and alignment. The bar is draggable to move the window; interactive
controls do not start a window drag.
- macOS leaves the left ~76px clear for traffic lights only while the sidebar is
+ macOS leaves the left 88px clear for traffic lights only while the sidebar is
collapsed (8px in fullscreen); Windows/Linux leave the right 120px clear for
native window controls.
- **Specs linked**: `04-ux/08-component-spec.md` (§2 Topbar)
@@ -12230,10 +12230,14 @@ plugin-form fixtures in an isolated temporary directory at runtime.
keeps whatever sidebar state the user chose last. The mode is transient: it is
not persisted and ends when the panel closes. Preview mode keeps the shell's
new-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. On non-fullscreen macOS with the sidebar collapsed, the preview row
+ renders the traffic-light lead inset (`--ds-window-lead-inset` — the cluster's
+ 76px right edge plus the 12px gap, so 88px) as its own left padding, and the
+ first preview action starts at or beyond that rendered value; the check reads
+ the resolved padding rather than restating the number. 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.
- **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
diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.md
index fd5e1f644..a60da7b27 100644
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@ -82,7 +82,7 @@ This log freezes previously open questions into concrete decisions.
| D405 | Ideographic comma opens the slash menu | **Amend D123 / D139 / ADR 0024: a `、` (U+3001) committed as the first character of an empty composer draft is rewritten to `/` before trigger detection, so a Chinese IME reaches the ordinary slash menu without switching input methods. Only that position is rewritten; a `、` anywhere else stays ordinary punctuation, and the `@` file menu is unaffected. Shared grammar and renderer only; no IPC, storage, or autocomplete-source change. See ADR 0231 and E2E-255.** | Reaching `/new`, `/compact`, a mode alias, or a Skill forced a Chinese IME user to switch to ASCII input mid-sentence and then switch back (issue #65). |
| D406 | Keep macOS DMG opening guidance text-only | **Amend D371 / ADR 0204: macOS DMGs expose the opening-help note as `If app won't open, read this.txt` and no longer include the executable `PI-Desktop-macOS-open.command`. macOS ZIP packages retain both the note and the helper. The note provides the narrow Terminal fallback for trusted unsigned builds; signed and notarized builds do not need it. See ADR 0232 and E2E-196b.** | The DMG should keep the normal app-to-Applications flow focused while still giving users a visible, actionable answer when an unsigned app does not open. |
| D407 | Restore archived projects after session import | **Additive renderer behavior for issue #250: when a core or plugin import adds a new project-bound session, the import-triggered session refresh normalizes its project path and clears the renderer's archived presentation state for that project. Pathless sessions, skipped imports, historical plugin paths without an active binding, and ordinary refreshes leave archive state unchanged. Host project rows, IPC channels, plugin methods, storage schema, and data formats do not change. See ADR 0236 and E2E-257.** | The host can successfully materialize an imported session under a project while the renderer still hides that project's sidebar row as archived. Restoring only the newly imported binding makes the result discoverable without weakening deliberate archive choices during ordinary refreshes (issue #250). |
-| D408 | Prioritize MainChat in the three-column shell | **Amend ADR 0226 / ADR 0151 / ADR 0033 for issue #267: MainChat keeps a hard 450px minimum, the work panel is capped by the live budget (`client width - 450px - expanded sidebar`, with no fixed maximum), and the expanded sidebar yields at that threshold — including while `sidebar-out` still occupies flex space. A manual sidebar reopen spends panel width first and otherwise targets 460px; closing the panel restores only a sidebar the layout collapsed. The native window never changes: the reservation seam stays at zero and no geometry is applied. Preview mode temporarily unmounts MainChat and uses a window-level chrome row; collapsed-sidebar macOS preview reserves 76px, or 8px in fullscreen, for traffic lights. See ADR 0238 and E2E-LAYOUT-three-column-width-priority.** | The fixed client area had no explicit width priority, so the side docks could pin MainChat to its floor and leave the composer unusable. Making the yield order explicit keeps the chat readable inside the fixed window without reintroducing native window growth (issue #267). |
+| D408 | Prioritize MainChat in the three-column shell | **Amend ADR 0226 / ADR 0151 / ADR 0033 for issue #267: MainChat keeps a hard 450px minimum, the work panel is capped by the live budget (`client width - 450px - expanded sidebar`, with no fixed maximum), and the expanded sidebar yields at that threshold — including while `sidebar-out` still occupies flex space. A manual sidebar reopen spends panel width first and otherwise targets 460px; closing the panel restores only a sidebar the layout collapsed. The native window never changes: the reservation seam stays at zero and no geometry is applied. Preview mode temporarily unmounts MainChat and uses a window-level chrome row; collapsed-sidebar macOS preview reserves 88px, or 8px in fullscreen, for traffic lights (D433). See ADR 0238 and E2E-LAYOUT-three-column-width-priority.** | The fixed client area had no explicit width priority, so the side docks could pin MainChat to its floor and leave the composer unusable. Making the yield order explicit keeps the chat readable inside the fixed window without reintroducing native window growth (issue #267). |
| D409 | Host-owned session collaboration messages | **Amend ADR 0237 / ADR 0165 / ADR 0213: Rust host-core owns a durable session-collaboration ledger keyed by message id and real source/target Session IDs. Plugin-mediated `spawn`, `send`, `status`, `result`, and `cancel` operations use the reviewed desktop-control gateway; the sender is bound to the active plugin Agent tool invocation, target turns retain their existing configuration, and each delivery is claimed by its actual durable turn. Completion callbacks are durable, at-most-once, and reference the settled turn. Provenance is persisted with transcript rows and cannot be forged, stripped, or edited through regeneration. The additive schema v16 migration retains queued work across restart without unattended replay, applies permission ceilings and bounded autonomous hops, and keeps the existing Task family unchanged. See ADR 0239 and E2E-PLUGIN-session-orchestrator-real-workers.** | The plugin's prior create/prompt polling path could infer neither a durable turn outcome nor a safe bidirectional sender identity. A host-owned ledger makes delivery, provenance, callback, cancellation, and restart behavior auditable without restoring the withdrawn A2A protocol. |
| D410 | Independent session discovery and navigable collaboration projections | **Amend ADR 0239: add the reviewed read operation `session/collaboration/list`, bounded to 100 non-deleted Agent sessions and redacted to Session IDs, titles, status, updated time, readable provider/model labels, and bounded creation links. Extend the sidebar projection with readable model labels and at most eight created-session references. Render creator/created-session references as keyboard-focusable navigation buttons; independent sessions do not receive fabricated creator links. No renderer storage ownership or collaboration mutation boundary changes. See ADR 0240, E2E-SESSION-independent-top-level-communication, and E2E-SESSION-hover-card-model-and-links.** | Existing Session IDs were valid send targets but could be undiscoverable when they were not created by the plugin, while the hover card exposed only IDs and non-interactive provenance. A bounded host directory and navigable projection make durable sessions communicable and explainable without exposing transcripts or credentials. |
| D413 | Skill market public-HTTPS catalog fetch | **Additive: Settings → Skills Market discovers SKILL.md catalogs in Electron main under a shared public-HTTPS policy (syntactic public host + DNS classification + per-hop redirect re-validation). The renderer does not fetch. Install remains `skills.create`. Catalog ids match host `valid_capability_id`. Expanded documents over 128 KiB are refused. Builtin titles are English. See ADR 0243, E2E-SKILL-MARKET-*, issue #287.** | Community skill discovery needs main-process egress without a plugin-marketplace host allowlist, and copied classifiers would collide with the MCP market. |
@@ -4848,7 +4848,7 @@ D193, and D194.
no panel width or x-offset geometry is applied.
- Preview mode unmounts MainChat and gives the client area to the work panel
beside the sidebar. AppShell supplies a window-level chrome row for shell
- actions and native controls; macOS reserves 76px in windowed mode and 8px in
+ actions and native controls; macOS reserves 88px in windowed mode and 8px in
fullscreen when the sidebar is collapsed.
- Decision D408 records the issue #267 behavior. See ADR 0238 and
E2E-LAYOUT-three-column-width-priority.
@@ -5443,3 +5443,40 @@ that was sitting at the bottom — including after the turn had finished.
- See ADR 0266, `07-plugins/03-plugin-api.md` §3,
`07-plugins/13-plugin-permissions-matrix.md` §6, and
E2E-PLUGIN-fs-root-follows-the-calling-session.
+
+## 2026-09-16 — The macOS traffic-light reserve has one source (D433)
+
+- The renderer's windowed lead-in for the macOS traffic lights was a hand-copied
+ `76px`: five declarations across `apps/desktop/src/styles/chrome.css` and
+ `apps/desktop/src/styles/work-panel.css` — `.main-titlebar-left` (`64px`, that
+ number minus the row's own 12px padding), `.conversation-topbar.ct-collapsed`
+ (`--ct-lead-inset`), `.sidebar-header`,
+ `.window-chrome-row:not(.sidebar-expanded)`, and the preview
+ `.work-panel-header` (`calc(76px + var(--ds-preview-action-lane-width))`) —
+ each with its own `[data-fullscreen="true"]` sibling. None of them was tied to
+ the `trafficLightPosition` the main process hands Electron, so either side
+ changing on its own would have drifted from the other.
+- The native geometry now has one home, `packages/shared/src/window-chrome.ts`:
+ `MAC_TRAFFIC_LIGHT_POSITION` (`{x:16,y:16}`) and
+ `MAC_TRAFFIC_LIGHT_CLUSTER_WIDTH_DIP` (`60`), with
+ `MAC_TRAFFIC_LIGHT_EDGE_DIP` (`16 + 60 = 76`) as the cluster's right edge. The
+ main process positions the buttons from those constants, and the renderer
+ injects the edge into `--ds-traffic-light-edge` at boot. Every consumer reads
+ `--ds-window-lead-inset`, which `chrome.css` composes once for
+ `:root[data-platform="darwin"]` as `--ds-traffic-light-edge` +
+ `--ds-traffic-light-gap` (`12px`) = `88px`.
+- The buttons used to sit flush against the green light, with a 0 gap. The
+ reserve now keeps `12px` of breathing room between the cluster's right edge and
+ the first shell control, which is why windowed mode moved from `76px` to
+ `88px`.
+- The per-selector `[data-fullscreen="true"]` overrides are gone. Fullscreen
+ hides the buttons, and the same token's `[data-fullscreen="true"]` rule drops
+ the reserve to the ordinary `8px` gutter for every consumer at once.
+- Windows and Linux are unchanged: `--ds-window-lead-inset` keeps its `0px`
+ default and those platforms still use the renderer-drawn controls in the 120px
+ right-side band. Plugin-panel windows create a plain frameless `BrowserWindow`
+ with no native traffic lights, so they are unaffected.
+- Renderer + shared constant only: no protocol, storage, host, permission, or
+ migration change, and no new default.
+- See `04-ux/08-component-spec.md`, `04-ux/09-interaction-patterns.md`, and
+ E2E-LAYOUT-three-column-width-priority.
diff --git a/docs/zh-CN/spec/04-ux/01-ui-ia.md b/docs/zh-CN/spec/04-ux/01-ui-ia.md
index f69511ddf..fa1f564af 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,9 @@
后接固定的 `+` 新建入口;关闭操作归属于各标签,因此 Windows 原生关闭
控件旁不再重复呈现第二个 `×`。工作面板预览模式会卸载 MainChat,
并在窗口级 46px chrome 行中保留新建任务、侧边栏和本机窗口控件。
- macOS 非全屏且侧边栏折叠时,左侧预留 76px(全屏为 8px),避免与交通灯重叠。
+ macOS 非全屏且侧边栏折叠时,左侧预留 88px(全屏为 8px),避免与交通灯重叠。
+ 该预留量是共享 token `--ds-window-lead-inset` —— 灯簇右缘 76px(来自
+ `@pi-desktop/shared`)加 12px 间隙 —— 主进程用同一份共享几何放置按钮。
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.md
index b6950d425..207e2ae63 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
@@ -464,9 +464,11 @@ WebKit 与 Chromium 会忽略伪元素,该表面退回为常显的原生滚动
工具栏行为 46 像素。 macOS 将交通信号灯放置在 `{x:16,y:16}` 处并保持
展开侧边栏的折叠侧边栏图标按钮右对齐
-在同一行。 macOS 行省略侧边栏 logo/title,保留 `76px`
+在同一行。 macOS 行省略侧边栏 logo/title,保留 `88px`
在窗口模式下的本机 chrome 左侧,并回收该填充
-全屏。 Windows/Linux 将身份和侧边栏操作保留在第一位置
+全屏。 该预留量是共享 token `--ds-window-lead-inset` —— 灯簇 `76px` 右缘
+(与主进程放置按钮所用的是同一份 `@pi-desktop/shared` 几何)加 `12px` 留白。
+Windows/Linux 将身份和侧边栏操作保留在第一位置
行并为三个无框窗口控件保留最右边的 112px。每个
control 拥有 46px 高保留带的全部份额。展开的工作面板标题使用可横向滚动的
标签条和固定 `+` 入口,每个标签拥有自己的关闭操作,避免在 Windows 原生
@@ -940,7 +942,10 @@ Linux 保留淡入淡出和滑动退出。
首选宽度。本机边缘调整窗口大小并重排 MainChat。
- 预览模式是临时的 shell 状态:卸载 MainChat,工作面板填充侧边栏之外的客户区。
窗口级 46px chrome 行保留拖动区域、新建任务、侧边栏和本机窗口控件。
- 侧边栏折叠时,macOS 窗口模式左侧预留 76px,全屏预留 8px 给交通灯。
+ 侧边栏折叠时,macOS 窗口模式左侧预留 88px,全屏预留 8px 给交通灯。
+ 该预留量是共享 token `--ds-window-lead-inset` —— 交通灯簇 76px 右缘
+ (来自 `@pi-desktop/shared` 的原生几何,与主进程放置按钮所用常量相同)
+ 加 12px 间隙。
- 外层外壳在每个平台上都保留原生边缘/角落调整大小。无边框标题栏的
拖动区域不会替代操作系统的调整大小所有权。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.md
index 06e91ce92..d57d79767 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -71,7 +71,10 @@
用外边距而非内边距——因为原生拖拽矩形就是边框盒。
- 工作面板预览:标题栏最大化操作会临时卸载 MainChat,并让面板填充侧边栏
之外的客户区。窗口级 46px chrome 行负责拖动区域、新建任务、侧边栏和本机
- 窗口控件。macOS 侧边栏折叠时,窗口模式左侧预留 76px,全屏预留 8px 给交通灯。
+ 窗口控件。macOS 侧边栏折叠时,窗口模式左侧预留 88px,全屏预留 8px 给交通灯。
+ 该预留量就是共享 token `--ds-window-lead-inset` —— 灯簇右缘(76px,来自
+ `@pi-desktop/shared`)加 12px 间隙 —— 主进程也用同一份共享几何放置按钮,
+ 因此预留量与按钮不会漂移。
- 工作面板调整大小:左边缘拖动手柄(§5.4)
- 窗口大小调整:本机边缘仅在打开作品时更改 MainChat 宽度
面板保持其承诺的宽度;响应式布局如下
@@ -197,8 +200,8 @@ Composer 拥有 Agent/Plan/Goal 控件以及组合的模型 × 推理选择(§
- 背景:bg-primary
- 边框:边框-微妙底部
- 位置:绝对46px无框带; `-webkit-app-region: drag` 与
- 交互式控件上的 `no-drag`; macOS 保留左侧约 76 像素的流量
- 灯亮(仅当侧边栏折叠时),Windows/Linux保留权利
+ 交互式控件上的 `no-drag`; macOS 仅在侧边栏折叠时保留左侧 88px 的交通
+ 灯空间,Windows/Linux保留权利
本机窗口控件为 112px
- 标题簇(任务标题)最多可显示前 10 个 Unicode
字符加省略号;完整标题保留在本机工具提示中。
diff --git a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md b/docs/zh-CN/spec/04-ux/09-interaction-patterns.md
index c83d76cd5..7d828e496 100644
--- a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md
+++ b/docs/zh-CN/spec/04-ux/09-interaction-patterns.md
@@ -853,7 +853,9 @@ Mode/provider/model/permission/shell 配置和新提示仍然存在
- 预览模式会卸载 MainChat,让工作面板填充侧边栏之外的客户区。窗口级 46px
chrome 行保留新建任务、侧边栏和本机窗口控件;侧边栏折叠时,macOS 窗口模式
- 左侧预留 76px,全屏预留 8px 给交通灯。
+ 左侧预留 88px,全屏预留 8px 给交通灯。这 88px 是共享 token
+ `--ds-window-lead-inset`:交通灯簇右缘 76px(来自 `@pi-desktop/shared` 的
+ 原生几何)加 12px 间隙。
展开侧边栏固定为 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.md
index 18d471636..207c14ed8 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
@@ -600,8 +600,8 @@ unit/integration 测试;代码 pull request 使用有选择且高价值的 E2E
侧边栏控件的重复)。在所有其他路线上均采用无框拖曳
band 会改为渲染(没有顶栏控件)。该栏可拖动以移动
窗户;交互式控件不会启动窗口拖动。
- macOS 仅在侧边栏打开时为交通灯保留左侧约 76px 的空间
- 折叠(全屏 8 像素); Windows/Linux 将右侧 112px 留空
+ macOS 仅在侧边栏折叠时为交通灯保留左侧 88px 的空间
+ (全屏 8 像素); Windows/Linux 将右侧 112px 留空
本机窗口控件。
- **链接规格**:`04-ux/08-component-spec.md`(§2 顶栏)
- **验收**:C (send/UI),质量
@@ -2023,8 +2023,10 @@ MainChat 弥补了缺口。 Maximized/fullscreen 调用保留最新的
被取代的成功不能带来陈旧的表现。没有过渡产生
第二次调整大小或位置漂移。
预览模式隐藏 MainChat,并将客户区宽度交给面板;本机窗口尺寸不变,分隔线不可操作。
- 预览外壳仍保留新建任务、侧边栏和系统窗口操作。macOS 非全屏且侧边栏折叠时,左侧第一个预览操作从
- 76px 交通灯安全内缩之后开始;全屏时恢复原始内边距。
+ 预览外壳仍保留新建任务、侧边栏和系统窗口操作。macOS 非全屏且侧边栏折叠时,预览行把交通灯引导内缩
+ (`--ds-window-lead-inset`,即灯簇右缘 76px 加 12px 间隙,共 88px)作为自身的左内边距渲染出来,
+ 左侧第一个预览操作从该渲染值起或之后开始;检查读取的是解析后的内边距,而不是重述这个数字。
+ 打开真实工作面板标签后,其第一个标签从预览操作组右侧至少 8px 处开始;全屏时使用 8px 原生内缩但保留该操作带。
以前的上下文面板覆盖不再存在。
- **链接规格**:`03-runtime/01-ipc-protocol.md`、`04-ux/01-ui-ia.md`、
`04-ux/07-ui-design-system.md`、`04-ux/08-component-spec.md`、
diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.md
index 59c52b903..7390c702a 100644
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@ -85,7 +85,7 @@
| D405 | 顿号打开斜杠菜单 | **修订 D123 / D139 / ADR 0024:当输入框为空时,第 1 个字符提交的「、」(U+3001)会在触发检测前改写为 `/`,中文输入法因此无需切换输入方式即可打开普通斜杠菜单。只改写该位置;其他位置的「、」仍是普通标点,`@` 文件菜单不受影响。仅共享语法与渲染器改动;不改 IPC、存储或补全数据源。见 ADR 0231 与 E2E-255。** | 要唤出 `/new`、`/compact`、模式别名或某个 Skill,中文输入法用户必须在书写中途切到 ASCII 输入再切回(issue #65)。 |
| D406 | macOS DMG 只保留打开说明 | **修订 D371 / ADR 0204:macOS DMG 以 Finder 名称 `If app won't open, read this.txt` 展示打开说明,不再包含或暴露可执行的 `PI-Desktop-macOS-open.command`。macOS ZIP 安装包保留说明和助手。说明为可信未签名构建提供范围明确的终端备用命令;已签名和公证版本无需执行。见 ADR 0232 与 E2E-196b。** | DMG 应保持应用拖入 Applications 的正常安装路径简洁,同时在未签名应用打不开时提供可见且可执行的处理指引。 |
| D407 | 导入会话后恢复已归档项目 | **针对 issue #250 的渲染器增量行为:核心或插件导入新增项目绑定会话时,导入触发的会话刷新会规范化项目路径,并清除该项目的渲染器归档状态。无路径会话、跳过的导入、没有活动绑定的插件历史路径和普通刷新保持归档状态不变。host 项目行、IPC 通道、插件方法、存储 schema 和数据格式不变。见 ADR 0236 与 E2E-257。** | host 可以在项目下成功生成导入会话,而渲染器仍将该项目侧边栏行隐藏为已归档。只恢复新导入绑定对应的项目,可以让结果可发现,同时不会在普通刷新时削弱用户的归档选择(issue #250)。 |
-| D408 | 三栏布局中优先保障 MainChat | **针对 issue #267 修订 ADR 0226 / ADR 0151 / ADR 0033:MainChat 保持 450px 硬下限;工作面板上限为动态预算(`客户端宽度 − 450px − 展开的左栏宽度`,无固定上限);中栏到达阈值时展开的左栏立即让位(`sidebar-out` 退场期间仍计入预算)。手动重开左栏优先占用右栏宽度,否则以 460px 为目标;关闭右栏只恢复由布局机制收起的左栏。原生窗口不变:预留 seam 保持 0 且不套用任何面板几何。预览模式临时卸载 MainChat 并使用窗口级 chrome 行;侧边栏折叠时,macOS 窗口模式预留 76px、全屏预留 8px 给交通灯。见 ADR 0238 与 E2E-LAYOUT-three-column-width-priority。** | 固定客户区此前没有明确的宽度优先级,侧边停靠可以把 MainChat 压到下限、使 composer 不可用;显式化让位顺序后聊天在固定窗口内保持可读,且不重新引入原生窗口增长(issue #267)。 |
+| D408 | 三栏布局中优先保障 MainChat | **针对 issue #267 修订 ADR 0226 / ADR 0151 / ADR 0033:MainChat 保持 450px 硬下限;工作面板上限为动态预算(`客户端宽度 − 450px − 展开的左栏宽度`,无固定上限);中栏到达阈值时展开的左栏立即让位(`sidebar-out` 退场期间仍计入预算)。手动重开左栏优先占用右栏宽度,否则以 460px 为目标;关闭右栏只恢复由布局机制收起的左栏。原生窗口不变:预留 seam 保持 0 且不套用任何面板几何。预览模式临时卸载 MainChat 并使用窗口级 chrome 行;侧边栏折叠时,macOS 窗口模式预留 88px、全屏预留 8px 给交通灯(D433)。见 ADR 0238 与 E2E-LAYOUT-three-column-width-priority。** | 固定客户区此前没有明确的宽度优先级,侧边停靠可以把 MainChat 压到下限、使 composer 不可用;显式化让位顺序后聊天在固定窗口内保持可读,且不重新引入原生窗口增长(issue #267)。 |
| D409 | 宿主拥有的会话协作消息 | **修订 ADR 0237 / ADR 0165 / ADR 0213:Rust host-core 拥有以消息 id 和真实源/目标 Session ID 为键的持久会话协作 ledger。插件驱动的 `spawn`、`send`、`status`、`result` 和 `cancel` 使用已审查的 desktop-control 网关;发送者绑定当前插件 Agent 工具调用,目标回合保留原有配置,每条投递由实际持久回合认领。完成回调持久化且最多一次,并引用已结算回合。来源信息随转录行持久化,不能在重生成中伪造、剥离或编辑。增量架构 v16 迁移在重启后保留排队工作但不无人值守重放,执行权限上限和有界自主跳数,同时保持既有 Task 系列不变。见 ADR 0239 与 E2E-PLUGIN-session-orchestrator-real-workers。** | 插件之前的创建/提示轮询路径既无法推断持久回合结果,也无法安全确认双向发送者身份。宿主拥有的 ledger 让投递、来源、回调、取消和重启行为可审计,同时不恢复已撤回的 A2A 协议。 |
| D410 | 独立会话发现与可导航协作投影 | **修订 ADR 0239:新增经审查的 `session/collaboration/list` 读取操作,限制为最多 100 个未删除 Agent 会话,并只返回 Session ID、标题、状态、更新时间、可读 provider/model 标签和有界创建关系。侧边栏投影增加可读模型标签和最多八个已创建会话引用。创建者/已创建会话引用渲染为可键盘聚焦的导航按钮;独立会话不伪造创建者链接。不改变渲染器存储归属或协作写入边界。见 ADR 0240、E2E-SESSION-independent-top-level-communication 和 E2E-SESSION-hover-card-model-and-links。** | 现有 Session ID 虽然是有效发送目标,但未由插件创建的会话可能不可发现;hover 卡片也只暴露 ID,来源信息不可交互。有界 host 目录和可导航投影让持久会话可通信、可解释,同时不暴露转录或凭据。 |
| D413 | 技能市场公网 HTTPS 目录拉取 | **增量:设置 → 技能市场由 Electron 主进程按共享公网 HTTPS 策略发现 SKILL.md(公网主机语法 + DNS 分类 + 逐跳 redirect)。渲染层不发网。安装仍走 `skills.create`。目录 id 与 host `valid_capability_id` 对齐。展开后超过 128 KiB 拒绝写入。内置标题为英文。见 ADR 0243、E2E-SKILL-MARKET-*、issue #287。** | 社区技能发现需要主进程出网,且不能复用插件市场的主机允许列表;复制分类器会与 MCP 市场撞名。 |
@@ -3981,7 +3981,7 @@ D193 和 D194。
- 手动重开左栏优先占用右栏宽度,否则以 460px 为目标。关闭右栏只恢复由布局机制收起的左栏;手动收起保持收起。
- 原生窗口不参与:预留 seam 保持 0,不套用任何面板宽度或 x 偏移几何。
- 预览模式卸载 MainChat,让工作面板填充侧边栏之外的客户区。AppShell 提供窗口级
- chrome 行承载 shell 操作和本机控件;侧边栏折叠时,macOS 窗口模式预留 76px,
+ chrome 行承载 shell 操作和本机控件;侧边栏折叠时,macOS 窗口模式预留 88px,
全屏预留 8px 给交通灯。
- 决策 D408 记录 issue #267 的行为。见 ADR 0238 与 E2E-LAYOUT-three-column-width-priority。
@@ -4212,3 +4212,13 @@ the retained upstream work-panel lifecycle. See
- 现在没有可见工作区时会话根也能解析,所以临时对话按会话各自继续工作,而不是所有会话一起失败;这种状态下的面板调用仍然失败关闭。于是 `workspace` 根的 `NOT_FOUND` 更窄:既没有解析出调用会话的项目,也没有可见工作区。
- 权限、realpath 包含、拒绝名单、声明范围与运行时同意这四类闸门都没有改动,插件 API 表面也未变化:`pi.workspace.get` 仍然以可见工作区及其项目组作答。
- 见 ADR 0266、`07-plugins/03-plugin-api.md` §3、`07-plugins/13-plugin-permissions-matrix.md` §6 与 E2E-PLUGIN-fs-root-follows-the-calling-session。
+
+## 2026-09-16 —— macOS 交通灯预留量只有一个来源(D433)
+
+- 渲染层为 macOS 交通灯留出的窗口模式引导内缩,原本是一个手抄的 `76px`:散在 `apps/desktop/src/styles/chrome.css` 与 `apps/desktop/src/styles/work-panel.css` 里的五处声明 —— `.main-titlebar-left`(`64px`,即该值减去行自身的 12px 内边距)、`.conversation-topbar.ct-collapsed`(`--ct-lead-inset`)、`.sidebar-header`、`.window-chrome-row:not(.sidebar-expanded)`,以及预览态的 `.work-panel-header`(`calc(76px + var(--ds-preview-action-lane-width))`)—— 每一处还各有一个 `[data-fullscreen="true"]` 分身。它们谁都没有和主进程交给 Electron 的 `trafficLightPosition` 建立关联,因此任一侧单独改动都会与另一侧漂移。
+- 原生几何现在只有一个归属地 `packages/shared/src/window-chrome.ts`:`MAC_TRAFFIC_LIGHT_POSITION`(`{x:16,y:16}`)与 `MAC_TRAFFIC_LIGHT_CLUSTER_WIDTH_DIP`(`60`),并由 `MAC_TRAFFIC_LIGHT_EDGE_DIP`(`16 + 60 = 76`)给出灯簇右缘。主进程用这些常量放置按钮,渲染层在启动时把右缘注入 `--ds-traffic-light-edge`。所有消费点都读 `--ds-window-lead-inset`,它由 `chrome.css` 针对 `:root[data-platform="darwin"]` 组合一次:`--ds-traffic-light-edge` + `--ds-traffic-light-gap`(`12px`)= `88px`。
+- 按钮此前紧贴绿灯右缘,间隙为 0。现在灯簇右缘与第一个 shell 控件之间保留了 `12px` 呼吸空间,这也是窗口模式从 `76px` 变为 `88px` 的原因。
+- 逐个选择器的 `[data-fullscreen="true"]` 覆盖规则已删除。全屏会隐藏按钮,同一个 token 的 `[data-fullscreen="true"]` 规则一次性把所有消费点的预留量降为普通的 `8px` 留白。
+- Windows 与 Linux 行为不变:`--ds-window-lead-inset` 保持 `0px` 默认值,这两个平台仍使用右侧 120px 带内由渲染层绘制的控件。插件面板窗口创建的是普通无框架 `BrowserWindow`,没有原生交通灯,因此不受影响。
+- 仅渲染层 + 共享常量:无协议、存储、宿主、权限或迁移改动,也没有新增默认值。
+- 见 `04-ux/08-component-spec.md`、`04-ux/09-interaction-patterns.md` 与 E2E-LAYOUT-three-column-width-priority。