Skip to content

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

Merge remote-tracking branch 'origin/main'

vastsa46284266e2cd
diff --cc docs/adr/README.md
index bba01dd4d,7b9042175..c75e283df
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@@ -300,4 -300,5 +300,8 @@@ Each ADR includes
| 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 | [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) |
+ | 0274 | [A development plugin is reviewed before it is loaded](0274-development-plugin-permission-review.md) | Accepted for implementation (amends ADR 0005) |
+ | 0275 | [A floating widget placement for plugin panels](0275-plugin-panel-floating-widget.md) | Accepted for implementation (amends ADR 0093 §4; ADR 0092 / ADR 0110) |
++<!-- In flight on feat/chat-wide-layout: claims 0274, which main has since taken. The
++ owner renumbers it (0276) when that branch lands; this row is not rewritten here. -->
++| (pending 0276) | [Draggable chat content width](0274-draggable-chat-content-width.md) | Accepted (D439) |
diff --cc docs/spec/08-meta/decisions-log.md
index bae9b38e2,a73fbd445..c8cae6c6e
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@@ -5759,16 -5791,37 +5791,51 @@@ that was sitting at the bottom — incl
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 0274, E2E-208, and
+ E2E-CHAT-content-width-handles.
++
+ ## 2026-09-17 — Session and project rows delete on the second click (D441)
+
+ - The sidebar's session item and both project menus (sidebar and Projects index)
+ removed the row on the first click of Delete. Every other destructive row
+ action — the settings provider rows, vendor accounts, and the capability
+ tables — arms first and relabels the control, so the two most destructive
+ actions were the only ones that fired on a single click.
+ - `hooks/use-armed-delete.ts` now owns that pattern for the whole renderer: one
+ `ARMED_DELETE_MS` (3200ms) expiry and one `useArmedDelete()`. The capability
+ pages keep importing it from `AgentCapabilityLayout`, which re-exports the
+ shared hook instead of holding a second copy with a timeout of its own, so the
+ pattern cannot drift between the settings rows and the two menus.
+ - A session item arms on `session.id`; both project menus arm on a
+ `project:`-prefixed key, so a session and a project can never share an arm. An
+ armed item carries `data-armed="true"`, a danger wash, and the label
+ `nav.deleteTaskConfirm` / `project.deleteMenuConfirm` ("Delete?" / "确认删除?")
+ in all eight catalogs. The menu stays open between the two clicks, and an
+ outside press, Escape, or the expiry clears the arm without removing anything.
+ - Amends D431 for the idle case: a project whose turn is still live still opens
+ `ProjectDeleteDialog`, which names those sessions and stops them before it
+ deletes, and the host's 1008 / `CONFLICT` refusal is still mapped to
+ `project.deleteRunningBlocked` on both paths. A project with no live turn is
+ removed by the same store action the dialog used, with the same success toast,
+ so its second click is the confirmation the user already gave.
+ - The number is D441 because D438 was already claimed twice — by the
+ window-toggle merge (#360, D438 with the D439 rebind) and by the
+ Git-checkout decision (ADR 0273), which this log flags to move to D440.
+ This entry does not rewrite another decision's text.
+ - Renderer only: no protocol, storage, host, permission, or migration change,
+ and no new default. The folder on disk is still never touched. See
+ `04-ux/09-interaction-patterns.md`, D421, D431,
+ `06-delivery/04-e2e-test-plan.md`
+ E2E-PROJECT-delete-removes-project-and-owned-sessions, and
+ `apps/desktop/test/two-step-delete.test.mjs`.
diff --cc docs/zh-CN/spec/08-meta/decisions-log.md
index 4b5906eda,15eb5d209..6c0ba3bf0
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@@ -4331,9 -4332,37 +4332,44 @@@ that amendment are retired by ADR 0268
- 项目创建语义不变:两种来源调用同一个项目 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 0274、E2E-208、E2E-CHAT-content-width-handles。
++
+ ## 2026-09-17 —— 窗口开关键避开 macOS 的关闭窗口组合键(#360,D439)
+
+ - D438 把两个键合并到了 `Mod+W`,但这个键不能作为*系统级*全局加速键的默认值:
+ macOS 把 `Cmd+W` 用于自己的「关闭窗口」命令,全局占用它等于从所有其它应用程序
+ 手里把这个组合键抢走,而不只是关闭本窗口。因此 `Mod+W` 正是开关键唯一不能持有的键。
+ - 快捷键目录现在把 `toggleWindow` 发布在 `Alt+Shift+W` 上 —— 不含平台修饰键,因此在
+ macOS、Windows 与 Linux 上是同一个组合键 —— 它与任何发布默认值、保留的编辑组合键
+ 以及平台命令都不冲突。合并本身、隐藏/显示语义、以及退役的
+ `closeWindow`/`summonWindow` 覆盖项的折叠规则,完全保持 D438 定义的样子。
+ - 在 macOS 上 `Mod+W` 现在也拒绝交给插件(`isReservedKeybinding`),因此即使应用不再
+ 使用它,平台仍然独占它自己的这个组合键。
+ - 只重复「本版本发布默认值」或「已被取代的默认值」的 `toggleWindow` 存储值不携带用户
+ 意图,折叠时会丢弃:曾经持久化过那个短命 `Mod+W` 默认值的配置会迁移到
+ `Alt+Shift+W`,而不是把 macOS 的组合键冻结住;真实改绑(`Ctrl+Alt+T`)与明确的
+ 「未绑定」(`null`)原样保留,退役项的自定义值也仍然优先于被丢弃的旧默认值。
+ - 编号取 D439,因为 D435 与 D437 已被其它在途工作占用。**注意**:本日志当前有两处
+ `D438` —— 本文件上方的窗口开关键合并决策(#360,重绑前)与紧随其后的 Git 检出决策
+ (ADR 0273)。后者是在开关键 D438 合入之后才追加的,编号需要由其作者改到 D440 或
+ 之后的可用号;本条不代为改写他人决策正文。
+ - 见 ADR 0211(再次修订)、`04-ux/09-interaction-patterns.md` §1.1 与 §1.4、
+ `04-ux/06-settings-ia.md`(快捷键选项卡)、`07-plugins/03-plugin-api.md`、
+ `07-plugins/04-plugin-security.md`、E2E-072 与
+ `apps/desktop/test/window-toggle-shortcut.test.mjs`。
+
+ ## 2026-09-17 —— 会话与项目行在第二次点击时才删除(D441)
+
+ - 侧边栏的会话菜单项与两个项目菜单(侧边栏与项目索引)此前在第一次点击「删除」时就移除该行。应用内其他所有破坏性行操作 —— 设置里的模型服务行、厂商账户行以及能力表格 —— 都先武装再改写控件标签,于是最不能撤销的两个动作反而是唯一单击即生效的。
+ - 这一模式现在由 `hooks/use-armed-delete.ts` 为整个渲染层拥有:同一个 `ARMED_DELETE_MS`(3200ms)失效时间与同一个 `useArmedDelete()`。能力页面继续从 `AgentCapabilityLayout` 导入它,而该布局改为再导出这个共享 hook,不再保留一份带自己超时的副本,因此这一模式不会在设置行与两个菜单之间漂移。
+ - 会话菜单项以 `session.id` 作为武装键;两个项目菜单则以 `project:` 前缀的键武装,因此会话与项目永远不会共用一次武装。被武装的菜单项带 `data-armed="true"`、危险色淡底,并在八种语言里都把标签换成 `nav.deleteTaskConfirm` / `project.deleteMenuConfirm`("Delete?" / "确认删除?")。两次点击之间菜单保持打开;点击外部、按 Escape 或武装超时都会解除武装且不移除任何内容。
+ - 这是对 D431 在空闲场景下的修订:仍有运行中轮次的项目依然打开 `ProjectDeleteDialog`,由它指明这些会话并先停止它们再删除;宿主的 1008 / `CONFLICT` 拒绝在两条路径上仍映射为 `project.deleteRunningBlocked`。没有运行中轮次的项目由对话框原本使用的同一个 store 动作移除,并发出同样的成功 toast,因此它的第二次点击就是用户已经给出的确认。
+ - 编号取 D441:D438 已被两处占用 —— 窗口开关键合并(#360,D438 与后续的
+ D439 重绑)与 Git 检出决策(ADR 0273),后者本日志已标明要改到 D440。本条不
+ 代为改写他人决策正文。
+ - 仅渲染层:无协议、存储、宿主、权限或迁移改动,也没有新增默认值。磁盘上的文件夹仍永远不被触碰。见 `04-ux/09-interaction-patterns.md`、D421、D431、`06-delivery/04-e2e-test-plan.md` 的 E2E-PROJECT-delete-removes-project-and-owned-sessions,以及 `apps/desktop/test/two-step-delete.test.mjs`。