Skip to content

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

Merge branch 'main' into feat/chat-wide-layout

vastsae57bdac8e702
diff --cc docs/adr/0274-draggable-chat-content-width.md
index 48d46d97b,000000000..dc31c945b
mode 100644,000000..100644
--- a/docs/adr/0274-draggable-chat-content-width.md
+++ b/docs/adr/0274-draggable-chat-content-width.md
@@@ -1,62 -1,0 +1,62 @@@
- # ADR 0273: Draggable Chat Content Width
++# ADR 0274: Draggable Chat Content Width
+
+- Status: Accepted
+- Date: 2026-09-16
+- Deciders: PI-Desktop desktop UI maintainers
+- Amends: D058, D101, the collapsed-sidebar 640px band
+- Related: [04-ux/01-ui-ia](../spec/04-ux/01-ui-ia.md) ·
+ [04-ux/07-ui-design-system](../spec/04-ux/07-ui-design-system.md) ·
+ [04-ux/08-component-spec](../spec/04-ux/08-component-spec.md) ·
+ [08-meta/decisions-log](../spec/08-meta/decisions-log.md) (D439) ·
+ E2E-CHAT-content-width-handles · E2E-208
+
+## Context
+
+The conversation column, empty-home stack, and composer were capped at
+760–768px (640px while the sidebar was collapsed) so a wide shell would not
+become a low-density reading surface. Code, tables, diagrams, and tool output
+then wrapped inside a second 720px assistant cap, and there was no way to
+spend the extra pane width when the user wanted it.
+
+A Comfort/Wide toggle was rejected: two presets cannot match monitor size,
+work-panel squeeze, or a one-off wider reading of a diff.
+
+## Decision
+
+1. The transcript, empty-home stack, and composer share one preferred max
+ width, default **760px**, persisted as `AppSettings.chatContentMaxWidth`.
+ Absent or invalid values keep 760. The live band is always
+ `min(available pane minus 24px gutters, preferred)`, so a squeezed
+ sidebar or work panel compresses the band without rewriting the
+ preference.
+2. Two 12px handles sit on the left and right edges of that centered band,
+ from the top of `.chat-surface` down to the composer dock. Both handles
+ change the same width (1px pointer → 2px band) so the column stays
+ centered. Drag minimum is **560px**, or the available pane if smaller.
+3. Rest: the handles are invisible. Hover/focus: a soft glow. Drag: a 1px
+ hairline plus glow on **both** edges. Double-click resets to 760.
+ Arrow keys step 16px (Shift 32px); Home restores 760; End expands to the
+ pane; Escape cancels an in-flight drag.
+4. User bubbles stay `min(82%, 600px)`. Assistant, tool, permission, ask,
+ review, and turn-outcome rows follow `--chat-prose-max-width`, which
+ tracks the band. The collapsed-sidebar 640px ceiling is removed.
+5. Renderer only: no protocol, storage schema, host, or IPC change. Host-core
+ already preserves unknown settings keys.
+
+## Consequences
+
+- Users who never touch the handles keep today's 760px column, including
+ after collapsing the sidebar (the pane grows; the band does not jump to
+ 640px).
+- A saved 1100px preference on a large window compresses cleanly when the
+ work panel opens, then returns when it closes.
+- Handle hit targets can sit near the minimap when the band is almost full
+ pane width; the 24px gutter keeps both usable.
+
+## Rejected alternatives
+
+- **Comfort / Wide presets:** cannot match the live pane or a one-off width.
+- **Independent left/right insets:** un-centers the column and fights the
+ composer, which is also centered.
+- **Full-bleed to the pane edge by default:** reopens the over-wide reading
+ surface the 760px cap was there to prevent.
diff --cc docs/adr/README.md
index 2d8543fb4,50df04fc9..bba01dd4d
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@@ -299,4 -299,4 +299,5 @@@ Each ADR includes
| 0269 | [Move capability documents between the global and project levels](0269-capability-level-transfer.md) | Accepted for implementation (amends ADR 0112) |
| 0268 | Remove quotes, annotations, and side chats | Accepted (supersedes message-quotes-and-side-chats / response-annotations / floating-annotation-index) |
| 0272 | [Judge a public-network address on the route the request will dial](0272-connection-time-public-network-route.md) | Accepted for implementation (amends ADR 0243; issue #419 / PR #473) |
- | 0273 | [Draggable chat content width](0273-draggable-chat-content-width.md) | Accepted (D439) |
+ | 0273 | [Git checkout as a Create project source](0273-git-checkout-create-project-source.md) | Accepted for implementation (amends ADR 0233; ADR 0247) |
++| 0274 | [Draggable chat content width](0274-draggable-chat-content-width.md) | Accepted (D439) |
diff --cc docs/spec/04-ux/08-component-spec.md
index 2fff4c681,ff9ba3ffc..5d22b1e51
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@@ -1461,16 -1465,10 +1465,16 @@@ Single message render — either user (
### 8.3 Layout
-- Max content band: 760px thread column; assistant body max 720px
-- When the sidebar is collapsed, the centered thread column and composer band
- use a 640px ceiling. The outer main pane remains fluid and the width
- transition follows the sidebar dock transition.
+- Max content band: 760px default, user-resizable via dual edge handles
- (D439 / ADR 0273). Assistant, tool, and decision rows follow the band.
++ (D439 / ADR 0274). Assistant, tool, and decision rows follow the band.
+ User plates stay `min(82%, 600px)`.
+- The live band is `min(available pane, preferred)`. Collapsing the sidebar
+ no longer tightens a 640px ceiling; the outer pane stays fluid and the
+ width transition follows the sidebar dock.
+- Dual 12px handles sit on the band edges: invisible at rest, glow on hover
+ or focus, 1px hairline plus glow while dragging. Double-click resets to
+ 760px. Arrow keys step the width; Home restores the default; End fills the
+ pane.
- User: right-aligned, theme-neutral soft plate (`color-mix` on primary ink,
never a fixed accent tint), borderless, `radius-lg-plus` with a tighter
bottom-right corner, capped at `min(82%, 600px)` so short prompts read as
diff --cc docs/spec/06-delivery/04-e2e-test-plan.md
index c83335137,316512b9f..e68063ecb
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@@ -4233,38 -4233,18 +4233,38 @@@ identify the platform validation still
composer band with the sidebar expanded. 2) Collapse the sidebar. 3) Inspect
the same content band while the dock transition runs and after it settles.
4) Expand the sidebar and inspect the return transition.
-- **Expected**: The outer main pane fills the space released by the sidebar,
- while the centered chat content band transitions from its expanded
- 760–768px ceiling to a 640px ceiling in the collapsed state. The transcript,
- empty-home stack, and Composer use the same collapsed width envelope; no
- content jumps, horizontal overflow, or clipped controls appear. Expanding
- restores the expanded ceiling.
+- **Expected**: The outer main pane fills the space released by the sidebar.
+ The centered chat content band stays at its preferred 760px ceiling (or
+ `min(available, preferred)` if the pane is narrower). It does not jump to
+ 640px. The transcript, empty-home stack, and Composer share that envelope.
- **Specs linked**: `04-ux/01-ui-ia.md`, `04-ux/07-ui-design-system.md`,
- `04-ux/08-component-spec.md`, ADR 0273, D439
- `04-ux/08-component-spec.md`
++ `04-ux/08-component-spec.md`, ADR 0274, D439
- **Acceptance**: Quality
- **Milestone**: M5
-- **Status**: Unit-covered (`sidebar-collapse-animation.test.mjs`); rendered
- interaction scenario Draft
+- **Status**: Unit-covered (`sidebar-collapse-animation.test.mjs`,
+ `chat-content-width.test.mjs`); rendered interaction scenario Draft
+
+#### E2E-CHAT-content-width-handles: Dual edge handles resize the centered chat band
+
+- **Preconditions**: PI-Desktop is open on chat (empty home or a transcript)
+ at a viewport wider than 760px. Reduced motion off.
+- **Steps**: 1) Confirm no divider is visible at rest. 2) Hover the left
+ content edge and confirm a glow, then the right edge. 3) Drag the right
+ handle outward and confirm both edges move, the composer matches, and a
+ hairline is visible while dragging. 4) Open the work panel or expand the
+ sidebar until the pane is narrower than the new preference; the band
+ compresses without a horizontal scroll. 5) Close the panel / collapse the
+ sidebar and confirm the preference returns. 6) Double-click a handle to
+ restore 760px. 7) Repeat with Arrow keys on a focused handle.
+- **Expected**: Default 760px. Drag floor 560px (or the pane if smaller).
+ User bubbles stay compact. Handles stay keyboard-accessible
+ (`role="separator"`). Preference persists as `chatContentMaxWidth`.
+- **Specs linked**: `04-ux/01-ui-ia.md`, `04-ux/08-component-spec.md`,
- ADR 0273, D439
++ ADR 0274, D439
+- **Acceptance**: C (conversation), Quality
+- **Milestone**: M5
+- **Status**: Unit-covered (`chat-content-width.test.mjs`,
+ `packages/shared/src/chat-content-width.test.ts`); rendered scenario Draft
#### E2E-UI-tooltip-never-outlives-its-trigger: A themed tooltip always retreats
diff --cc docs/spec/08-meta/decisions-log.md
index bedec8af0,7d83ae5ac..bae9b38e2
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@@ -5736,16 -5736,25 +5736,39 @@@ that was sitting at the bottom — incl
`04-ux/11-asktool-question-card.md`, `04-ux/07-ui-design-system.md` §6.4, and
E2E-078.
+ ## 2026-09-17 — A git checkout is a Create project source (D438)
+
+ - The Create project dialog only collected a project name and local folders
+ (ADR 0233), and the home switcher's Clone git project entry renders inside the
+ hero of a project-bound session. A fresh installation therefore had to open an
+ unrelated local folder before any repository could be cloned.
+ - The dialog now owns a source selector with two equal peers: This computer and
+ Git repository. The git source keeps the one name field (seeded from the
+ repository name until the user types), adds a repository URL field and one
+ clone destination row, and parses URLs with the switcher's `parseGitCloneUrl`
+ rules, so private, loopback, link-local, credential-bearing, and malformed
+ remotes keep Create disabled (ADR 0247).
+ - Main exposes additive `project/cloneCheckout({ url, parentPath })`: it clones
+ into the explicit parent folder and returns `{ path, name }` without touching
+ the active workspace and without opening a picker. `project/clone` keeps its
+ native-picker behavior for the home switcher.
+ - Project creation is unchanged: both sources call one project-slice helper,
+ `project-group/create` still writes the only durable record, and a checkout
+ becomes the primary root of the same logical group (ADR 0233).
+ - Renderer plus one narrow main-process capability: no protocol, schema, host
+ RPC, permission, storage, or preference change. See ADR 0273,
+ `03-runtime/01-ipc-protocol.md` §9, `04-ux/08-component-spec.md`, and E2E-258.
++
+## 2026-09-16 — Draggable chat content width (D439)
+
+- The centered conversation band, empty-home stack, and composer share one
+ preferred max width, default 760px, persisted as
+ `AppSettings.chatContentMaxWidth`. Dual edge handles (invisible at rest,
+ glow on hover, hairline while dragging) change that width together so the
+ column stays centered. Drag floor is 560px.
+- The live used width is `min(available pane minus 24px gutters, preferred)`,
+ so a squeezed sidebar or work panel compresses the band without rewriting
+ the preference. The collapsed-sidebar 640px ceiling is removed.
+- Assistant, tool, and decision rows follow the band. User plates stay
- `min(82%, 600px)`. Renderer only. See ADR 0273, E2E-208, and
++ `min(82%, 600px)`. Renderer only. See ADR 0274, E2E-208, and
+ E2E-CHAT-content-width-handles.
diff --cc docs/zh-CN/spec/08-meta/decisions-log.md
index 91b977c7b,b3109d52d..4b5906eda
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@@ -4323,9 -4323,10 +4323,17 @@@ that amendment are retired by ADR 0268
(`NATIVE_MENU_ACTIONS`)、E2E-072 与
`apps/desktop/test/window-toggle-shortcut.test.mjs`。
+ ## 2026-09-17 — Git 检出成为新建项目的来源(D438)
+
+ - 新建项目对话框此前只收集项目名称与本地文件夹(ADR 0233),而首页「克隆 Git 项目」入口只在绑定项目的会话 hero 中渲染。全新安装因此必须先打开一个无关的本地文件夹才能克隆仓库。
+ - 对话框现在拥有两种对等来源:此电脑与 Git 仓库。Git 来源保留同一个名称字段(在用户输入前用仓库名预填),增加仓库地址输入框和一个克隆保存位置行,并复用切换器的 `parseGitCloneUrl` 规则,因此私网、回环、链路本地、带凭据与非法远程都会让创建按钮保持禁用(ADR 0247)。
+ - 主进程新增可加的 `project/cloneCheckout({ url, parentPath })`:它克隆到显式指定的父目录并返回 `{ path, name }`,不更改当前工作空间、也不弹出选择器。`project/clone` 为首页切换器保留原有的原生选择器行为。
+ - 项目创建语义不变:两种来源调用同一个项目 slice 助手,`project-group/create` 仍写入唯一的持久记录,检出目录成为同一逻辑项目组的主要根(ADR 0233)。
+ - 渲染器加一条窄的主进程能力:协议、schema、host RPC、权限、存储与偏好均无变化。见 ADR 0273、`03-runtime/01-ipc-protocol.md` §9、`04-ux/08-component-spec.md` 与 E2E-258。
++
+## 2026-09-16 —— 可拖拽的对话内容宽度(D439)
+
+- 居中的对话带、空首页和输入框共用一个首选最大宽度,默认 760px,持久化为
+ `AppSettings.chatContentMaxWidth`。左右边缘各一条手柄(静止不可见、悬停光晕、拖拽时显示细线)同步改这个宽度,列保持居中。拖拽下限 560px。
+- 实际宽度是 `min(可用窗格减去两侧 24px, 首选值)`,侧栏或工作区挤压时自适应压缩,不改写偏好。收起侧栏不再把内容带到 640px。
- - 助手/工具/决策行跟随内容带;用户气泡仍是 `min(82%, 600px)`。仅渲染器。见 ADR 0273、E2E-208、E2E-CHAT-content-width-handles。
++- 助手/工具/决策行跟随内容带;用户气泡仍是 `min(82%, 600px)`。仅渲染器。见 ADR 0274、E2E-208、E2E-CHAT-content-width-handles。