Skip to content

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

docs(spec): record the shared work-panel control gap

ZeroY2109b761da77
diff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.md
index 35c866b4b..178feb740 100644
--- a/docs/spec/04-ux/01-ui-ia.md
+++ b/docs/spec/04-ux/01-ui-ia.md
@@ -94,8 +94,10 @@ destination, chat as the home surface, tools and permissions inline.
the viewport-fixed toggle, or `Cmd/Ctrl + J`. File, URL, browser-preview, and
successful workspace-edit artifacts create their resources atomically. The
46px content header exposes a tablist and a fixed `+` trigger. Its tokenized
- 60px right-side safe lane plus separated action rail keep the trigger distinct
- from the viewport-fixed work-panel toggle. Clicking `+` creates and activates
+ 44px right-side safe lane (the 28px control, its 12px viewport inset, and the
+ header's 4px control gap) keeps the `+`, maximize, and viewport-fixed
+ work-panel toggle one button group, spaced by that same gap, while the trigger
+ keeps a distinct hit target. Clicking `+` creates and activates
a unique New launcher tab; its body presents the same data-driven Review and
plugin-view rows as buttons, so the user chooses a destination in the page
instead of opening a dropdown. Selecting a row replaces that launcher tab with
diff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.md
index 0842a8324..315997b52 100644
--- a/docs/spec/04-ux/07-ui-design-system.md
+++ b/docs/spec/04-ux/07-ui-design-system.md
@@ -223,7 +223,7 @@ opacity-only changes, so actions remain legible in dark and light themes.
Light-surface polish (D148):
- Docked work panel uses quiet inset paper (`#fafafa`) with a white header band and a combined create trigger in the header so the tool column stays on content without any divider (D297 removed the remaining edge rules).
-- The work-panel header keeps its add-tab action in a separated rail: a tokenized 60px safe lane reserves the viewport-fixed panel toggle, with at least 24px of visual separation between the two hit targets on supported window sizes.
+- The work-panel header spends one control gap (`--ds-work-panel-control-gap`, 4px) on the whole row: the tab strip to the action group, `+` to maximize, and — through the tokenized 44px safe lane the panel header reserves for the viewport-fixed panel toggle — the action group to that toggle. The three buttons read as one group with no divider between the maximize control and the collapse toggle. Because maximize sits between them, the `+` trigger still keeps more than 24px of visual separation from the toggle hit target on supported window sizes.
- Shared form fields, browser URL, settings segment tracks, and shortcut keycaps use `--ds-tile` fills with no stroke (D297); focus lifts to white with an accent-tinted ring. An Unbound shortcut uses a localized text state instead of an empty keycap and keeps its recorder and restore controls keyboard-focusable.
- Settings toggles keep a near-black on-track and force a white knob in light mode.
Off/on track and knob colours come from the `--ds-switch-*` theme tokens; a
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 33a295dd7..7ceb6ca4f 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -844,10 +844,15 @@ tab. The `+` button sits outside the scroller and remains visible when tabs
overflow. Clicking it creates and activates a unique New launcher tab. The
launcher body contains host-owned Review followed by every in-scope
`contributes.views` entry as buttons; Files and Browser are not hardcoded in
-the renderer (ADR 0104). The header reserves a tokenized 60px right-side safe
-lane for the viewport-fixed work-panel toggle. The `+` trigger also sits in a
-separated action rail, so it keeps a distinct hit target with at least 24px of
-visual gap on every supported platform.
+the renderer (ADR 0104). The header reserves a tokenized 44px right-side safe
+lane for the viewport-fixed work-panel toggle: the 28px control, its 12px
+viewport inset, and the header's own 4px control gap
+(`--ds-work-panel-control-gap`). That one gap spaces the whole row — the tab
+strip to the action group, `+` to maximize, and maximize to the viewport-fixed
+toggle — so the three panel buttons read as one group instead of a rail behind
+a divider. Because maximize sits between them, the `+` trigger still keeps a
+distinct hit target with more than 24px of visual gap on every supported
+platform.
With no resource the body remains open and becomes a concise **New** launcher.
An explicit New tab uses the same data-driven tool list, so selecting a row
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index bd6e80b4e..65aa5e768 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -7128,11 +7128,13 @@ identify the platform validation still needed.
1. Load the plugin as a development plugin. Confirm the Plugins page shows a
work-panel-views capability badge.
2. Press `Cmd/Ctrl + J` to reveal the work panel, then click `+` to create a
- New launcher tab. Confirm the fixed `+` trigger and the viewport-fixed
- work-panel toggle have separate, non-overlapping hit regions with at least
- 24px of visual gap. Confirm the launcher lists the built-in Review row and
- the plugin view's localized title and icon (or a lettered tile if the
- manifest names an unknown token).
+ New launcher tab. Confirm the fixed `+` trigger, the maximize control, and
+ the viewport-fixed work-panel toggle resolve to one button group — one
+ 4px control gap, no divider between maximize and the toggle — while the
+ `+` trigger and the toggle stay separate, non-overlapping hit regions with
+ more than 24px of visual gap. Confirm the launcher lists the built-in
+ Review row and the plugin view's localized title and icon (or a lettered
+ tile if the manifest names an unknown token).
3. Activate the plugin row. Confirm the plugin's page renders inside the panel body
with no window-control capsule and no reserved 46px band, and that its
button reaches the host toast.
@@ -12203,7 +12205,10 @@ plugin-form fixtures in an isolated temporary directory at runtime.
may keep growing afterwards. A manual reopen spends panel width first;
MainChat is preserved where possible and otherwise lands on the 460px reopen
target. Closing the panel restores only a sidebar the layout collapsed. The
- separator's ARIA minimum/maximum follow the same dynamic budget.
+ separator's ARIA minimum/maximum follow the same dynamic budget. The panel
+ header's `+`, maximize, and viewport-fixed collapse toggle resolve to a single
+ control gap (`--ds-work-panel-control-gap`) with no divider, inset, or margin
+ of the action group's own.
- **Specs linked**: `04-ux/01-ui-ia.md`, `04-ux/07-ui-design-system.md` §10,
`04-ux/08-component-spec.md` §1 and §5, `04-ux/09-interaction-patterns.md` §8,
ADR 0238
@@ -12212,7 +12217,8 @@ plugin-form fixtures in an isolated temporary directory at runtime.
- **Status**: Automated (`scripts/e2e-three-column-layout.mjs` via
`pnpm test:e2e:layout` — fixed-window width invariance, the 450px floor across
a pointer drag, the unfolded composer row at that floor, sidebar
- yield/restore, the 460px reopen target, and preview mode); unit coverage in
+ yield/restore, the 460px reopen target, the panel action group's shared
+ control gap, and preview mode); unit coverage in
`work-panel-resize.test.mjs`
#### E2E-LAYOUT-work-panel-maximize
diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.md
index f2088df8e..ac9d07d7f 100644
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@ -5521,3 +5521,28 @@ that was sitting at the bottom — including after the turn had finished.
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.
+
+## 2026-09-16 — The work-panel header's buttons are one group
+
+- The work-panel header read as two clusters: the action group inside the header
+ (`+` and maximize, 4px apart) and the viewport-fixed collapse toggle outside
+ it. The separator between them was compounded from four declarations on
+ `.work-panel-actions` — `margin-right: 8px`, `padding-right: 8px`, a 1px
+ `--ds-border-subtle` divider, and a separate `--ds-work-panel-toggle-gap: 20px`
+ lane token — for a real 37px gap plus a hairline rule, so the same three
+ 28px squares in the same 46px row looked like two unrelated clusters.
+- One token now spaces the whole row. `--ds-work-panel-control-gap: 4px`
+ replaces `--ds-work-panel-toggle-gap` and is the header's flex gap (tab strip
+ to action group), the `.work-panel-actions` gap (`+` to maximize), and — spent
+ by the header's right padding as
+ `calc(size + inset + control-gap)`, 44px — the gap from the action group to
+ the fixed collapse toggle. `.work-panel-actions` states spacing only: the
+ divider, inset, and margin are gone.
+- The lane still reserves the whole toggle, and the `+` trigger still clears the
+ toggle by 36px inside the lane (4px + the 28px maximize control + 4px), so the
+ `WORK_PANEL_HEADER_PROBE` 24px assertion and E2E-152's hit-region contract
+ still hold.
+- Renderer only: no protocol, storage, host, permission, or migration change,
+ and no new default. See `04-ux/08-component-spec.md` §5.2,
+ `04-ux/07-ui-design-system.md` §4.3, 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 65e22bbf6..ce1130a41 100644
--- a/docs/zh-CN/spec/04-ux/01-ui-ia.md
+++ b/docs/zh-CN/spec/04-ux/01-ui-ia.md
@@ -64,7 +64,9 @@
那里,包括全屏。当工作面板打开时,会话
窗格标题栏在右上角托管其折叠控件。面板标题栏改为可横向滚动的标签条,
后接固定的 `+` 新建入口;关闭操作归属于各标签,因此 Windows 原生关闭
- 控件旁不再重复呈现第二个 `×`。工作面板预览模式会卸载 MainChat,
+ 控件旁不再重复呈现第二个 `×`。头部为视口固定的折叠开关预留 44px 的右侧
+ 安全车道(28px 控件、12px 视口内缩与头部自身的 4px 控制间距),同一个间距
+ 把 `+`、最大化与折叠开关连成一组并保持 `+` 的独立命中区域。工作面板预览模式会卸载 MainChat,
并在窗口级 46px chrome 行中保留新建任务、侧边栏和本机窗口控件。
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
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 3f1061efd..3757e0b16 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
@@ -472,7 +472,10 @@ Windows/Linux 将身份和侧边栏操作保留在第一位置
行并为三个无框窗口控件保留最右边的 112px。每个
control 拥有 46px 高保留带的全部份额。展开的工作面板标题使用可横向滚动的
标签条和固定 `+` 入口,每个标签拥有自己的关闭操作,避免在 Windows 原生
-关闭控件旁重复第二个 `×`。主要、设置和
+关闭控件旁重复第二个 `×`。头部的 `+`、最大化与视口固定的折叠开关共用同一
+个控制间距(`--ds-work-panel-control-gap`,4px):标签条到动作组、`+` 到
+最大化,以及动作组到开关的车道预留(`calc(size + inset + gap)`,44px)。
+动作组不再有自己的分隔线、内缩或外边距,因此这三个按钮读作一组。主要、设置和
工作面板拖动区域必须在此保留之前终止,而不是
重叠它并仅依赖于后代 `no-drag`,因此每个可见控件
像素仍然可点击。终止是几何意义上的:区域在元素的
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 7c5c4323c..ee4f8821e 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -687,6 +687,11 @@ expanded/collapsed 侧边栏仍为 20px/18px 且启动画面为 64 像素。
- 面板主体采用静音插页纸(`#fafafa`); 46px 标题带和工具
chrome(审阅工具栏、浏览器chrome、文件查看器标题)保持白色
- 46px 标题是裁剪的标签条和紧贴的 `+` 入口。只有标签条滚动,入口始终固定。
+ 头部为视口固定的折叠开关预留 44px 的右侧安全车道(28px 控件 + 12px 视口内缩
+ + 头部自身的 4px 控制间距 `--ds-work-panel-control-gap`),这一个间距同时
+ 分隔整行:标签条到动作组、`+` 到最大化,以及最大化到开关。动作组不再有自己的
+ 分隔线、内缩或外边距,因此三个按钮读作一组;`+` 与开关之间仍隔着最大化控件,
+ 命中区域彼此独立且视觉间隔大于 24px。
菜单只有 Tools & panels 分组,Review 在前,插件视图按声明顺序排列;只有真实
存在的快捷键才显示快捷键标签。
- 标签在悬停、聚焦和活动时显示 `×`,中键也可关闭。面板溢出由标签条处理,
diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.md
index 31cc2e5b6..db85354f2 100644
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@ -4236,3 +4236,10 @@ the retained upstream work-panel lifecycle. See
- 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。
+
+## 2026-09-16 —— 工作面板头部的按钮现在是一组
+
+- 工作面板头部此前读起来是两簇:头部内部的动作组(`+` 与最大化,相距 4px),以及头部之外视口固定的折叠开关。它们之间的分隔由 `.work-panel-actions` 上的四条声明叠加而成 —— `margin-right: 8px`、`padding-right: 8px`、1px 的 `--ds-border-subtle` 分隔线,以及另一个车道 token `--ds-work-panel-toggle-gap: 20px` —— 实际间距 37px 外加一条细线,于是同一个 46px 行内同样的三个 28px 方块看起来像两簇毫不相干的控件。
+- 现在整行由同一个 token 控制间距。`--ds-work-panel-control-gap: 4px` 取代了 `--ds-work-panel-toggle-gap`,同时是头部的 flex 间距(标签条到动作组)、`.work-panel-actions` 的间距(`+` 到最大化),以及头部右侧内边距以 `calc(size + inset + control-gap)`(44px)形式花费的、动作组到固定折叠开关的间距。`.work-panel-actions` 只声明间距:分隔线、内缩与外边距都已移除。
+- 车道仍然为整个开关预留空间,`+` 触发按钮在车道内与开关之间仍有 36px(4px + 28px 的最大化控件 + 4px),因此 `WORK_PANEL_HEADER_PROBE` 的 24px 断言与 E2E-152 的命中区域契约依然成立。
+- 仅渲染层:无协议、存储、宿主、权限或迁移改动,也没有新增默认值。见 `04-ux/08-component-spec.md` §5.2、`04-ux/07-ui-design-system.md` §4.3 与 E2E-LAYOUT-three-column-width-priority。