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(sidebar): default running activity to count badge (#1749)
Lan42fb8b7b3d9e
diff --git a/apps/desktop/src/lib/api.ts b/apps/desktop/src/lib/api.tsindex f0b17ff01..79ed9b38f 100644--- a/apps/desktop/src/lib/api.ts+++ b/apps/desktop/src/lib/api.ts@@ -420,6 +420,9 @@ export type SessionHistoryReadOptions = {export function normalizeSettings(settings: AppSettings): AppSettings {return {...settings,+ sidebarRunningIndicators: settings.sidebarRunningIndicators !== false,+ sidebarRunningBadge: settings.sidebarRunningBadge !== false,+ sidebarRunningRail: settings.sidebarRunningRail === true,defaultMode: normalizeMode((settings as { defaultMode?: unknown }).defaultMode),infiniteProviderRetry:(settings as { infiniteProviderRetry?: unknown }).infiniteProviderRetry === true,diff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.mdindex 9575762cf..5ac86219d 100644--- a/docs/spec/04-ux/01-ui-ia.md+++ b/docs/spec/04-ux/01-ui-ia.md@@ -239,8 +239,11 @@ destination, chat as the home surface, tools and permissions inline.the header while the group is collapsed, plus a matching count.Remote host groups carry the same pair. Settings → General → Sidebar ownsone master switch (`AppSettings.sidebarRunningIndicators`) gating two- sub-switches (`sidebarRunningBadge`, `sidebarRunningRail`); absent values- mean on, so existing installs keep the affordances without a migration.+ sub-switches (`sidebarRunningBadge`, `sidebarRunningRail`). When unset, the+ master and Count badge resolve on while Activity rail resolves off; explicit+ saved values remain authoritative. The master gates both affordances, and+ turning it off leaves the saved sub-switch choices intact. No settings+ migration is required.Motion is decoration only: `prefers-reduced-motion` keeps both staticshapes legible with the animation removed.- **Project actions**: open folder reveals the primary project directory; Editdiff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.mdindex 04da01524..abf6daaae 100644--- a/docs/spec/04-ux/06-settings-ia.md+++ b/docs/spec/04-ux/06-settings-ia.md@@ -177,10 +177,12 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (- **Sidebar** card: one master switch for project running activity(`AppSettings.sidebarRunningIndicators`) plus independently gated**Count badge** and **Activity rail** switches- (`sidebarRunningBadge`, `sidebarRunningRail`). Absent values mean on. The- sub-switches are disabled while the master switch is off and keep their- stored value, so re-enabling the master restores the previous choice- instead of resetting it. The affordances themselves are described in+ (`sidebarRunningBadge`, `sidebarRunningRail`). When unset, the master and+ Count badge resolve on while Activity rail resolves off; explicit saved+ values remain authoritative. The sub-switches are disabled while the master+ switch is off and keep their stored value, so re-enabling the master restores+ the previous choice instead of resetting it. The affordances themselves are+ described in[01-ui-ia.md §3.2](01-ui-ia.md#32-sidebar-project-groups).- **Network** card:- **Proxy**: a segmented control — System, Direct, Custom. System is thediff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 7bb2cf76c..fc3b8c260 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -18154,15 +18154,17 @@ host-created files. The full app's file-preview viewer is covered separately.remote host's project.4. Open Settings → General → Sidebar and turn off **Show running activityon projects**, then re-check the sidebar.- 5. Turn the master switch back on, turn off **Count badge** only, and- re-check. Repeat with **Activity rail** only.- 6. Enable the OS "reduce motion" setting and re-check the rail.+ 5. Turn the master switch back on and turn on **Activity rail**.+ 6. Turn off **Count badge** only and re-check; turn it back on.+ 7. Turn off **Activity rail** only and re-check; turn it back on.+ 8. Enable the OS "reduce motion" setting and re-check the rail.- **Expected**: A project with live work marks its header — the collapsed- header keeps showing the count badge and the activity rail, so the project- is identifiable without expanding it. Running and permission-waiting counts- are separate figures and never merge into one number. The remote host group- shows the same pair. The master switch removes both affordances at once and- leaves the two sub-switches disabled but retaining their stored value, so+ header shows only the count badge by default; the activity rail is off.+ Running and permission-waiting counts are separate figures and never merge+ into one number. The remote host group shows the same default. Turning on the+ activity rail displays it alongside the badge. The master switch removes+ both affordances at once and leaves the two sub-switches disabled while+ retaining their stored value, sore-enabling the master restores the previous choice. Each sub-switch hidesonly its own affordance. Under reduced motion both affordances stay visiblewith their animation removed. Settings persist across a renderer reload.@@ -18171,12 +18173,12 @@ host-created files. The full app's file-preview viewer is covered separately.- **Acceptance**: The "is anything running under here?" answer is availablefrom a collapsed project group, and each affordance can be switched offindependently through a persisted setting.-- **Status**: Draft. Unit coverage in- `apps/desktop/test/sidebar-project-runs.test.mjs` covers the count- classification, the master/sub-switch gating, both render call sites, and- the theme-token and reduced-motion guarantees; the interactive sidebar- scenario remains a manual validation scenario run in a capable- environment.+- **Status**: Draft. Existing unit coverage in+ `apps/desktop/test/sidebar-project-runs.test.mjs` covers count+ classification, master/sub-switch gating, both render call sites, and+ theme-token and reduced-motion guarantees. It does not exercise settings+ API default normalization or the full interaction; those remain manual+ validation in a capable environment.### E2E-267: A plugin follows the selected session and opens its own viewdiff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex 541acec87..72603777f 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -71,6 +71,7 @@ This log freezes previously open questions into concrete decisions.| D020 | Auto-update | **Post-MVP** || D021 | First-run onboarding | **Inline checklist (not modal wizard)** || D022 | Local telemetry | **Local logs only in MVP (no remote telemetry)** |+| D664 | Sidebar running activity defaults | **When unset, the master and Count badge resolve on while Activity rail resolves off. Explicit saved values remain authoritative. The master continues gating both affordances; turning it off does not rewrite either child preference. No schema or migration change.** |## C. Provider & model coverage decisions (0.3.4)@@ -7766,3 +7767,14 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.`apps/desktop/test/composer-chip-descenders.test.mjs`, and the composerslots and thinking contracts. See `04-ux/08-component-spec.md` §11 andUS-UI-73.++## 2026-10-18 — Default sidebar running activity to the count badge (D664)++- When the three optional sidebar activity settings are absent, the master and+ Count badge resolve on while Activity rail resolves off. Explicitly saved+ values remain authoritative, and the master still gates both affordances+ without rewriting either child preference.+- The count keeps live work discoverable without making the animated rail a+ default. Settings reads apply these defaults through renderer API+ normalization; no persisted schema or migration change is required. See+ `04-ux/01-ui-ia.md`, `04-ux/06-settings-ia.md`, and E2E-266.diff --git a/docs/zh-CN/spec/04-ux/01-ui-ia.md b/docs/zh-CN/spec/04-ux/01-ui-ia.mdindex 4b5229529..b48419d05 100644--- a/docs/zh-CN/spec/04-ux/01-ui-ia.md+++ b/docs/zh-CN/spec/04-ux/01-ui-ia.md@@ -178,6 +178,12 @@collapse/expand 仅影响子级可见性,相邻组形成一个密集的树而不是分离的卡片。悬停或聚焦项目标题揭示完整的项目路径。+- **运行活动**:有任务正在运行的项目组会在标题上显示状态,因为折叠组会隐藏所有会话行状态。+ 项目名后面的**数量徽标**把运行中和等待权限的会话数分开显示;左侧的**活动流光**+ 则是带有移动脉冲的 2px 轨道,展开时沿会话列表显示,折叠时收缩至标题。远程项目组使用相同显示。+ “设置 → 常规 → 侧边栏”控制一个总开关及两个子开关。未设置时总开关和数量徽标默认开启,+ 活动流光默认关闭;已保存的值优先生效。关闭总开关会隐藏两种提示,但保留子开关的已保存选项。+ 减少动态效果时两种提示都保持静态且可辨识。- **项目操作**:打开文件夹显示项目目录;重命名只修改renderer 本地显示名称,规范化路径仍是项目身份;pin/unpin更改演示优先级;archive/restore 隐藏或恢复组;close 删除保留的diff --git a/docs/zh-CN/spec/04-ux/06-settings-ia.md b/docs/zh-CN/spec/04-ux/06-settings-ia.mdindex 88b7a4b58..39a02e805 100644--- a/docs/zh-CN/spec/04-ux/06-settings-ia.md+++ b/docs/zh-CN/spec/04-ux/06-settings-ia.md@@ -88,6 +88,11 @@`AppSettings.keepAwakeWhileRunning` 和 `AppSettings.preventScreenSleep`,切换立即生效、启动时恢复,关闭对应开关或退出应用时分别释放阻止器。手动睡眠和合盖遵循系统设置。+- **侧边栏**卡片:一个项目运行活动总开关+ (`AppSettings.sidebarRunningIndicators`) 与独立的**数量徽标**和**活动流光**开关+ (`sidebarRunningBadge`、`sidebarRunningRail`)。未设置时总开关和数量徽标默认开启,活动流光默认关闭;+ 已保存的值优先生效。总开关关闭时两个子开关置灰并保留各自已保存的选项,重新开启后恢复原选择。+ 提示样式见 [`01-ui-ia.md` §3.2](01-ui-ia.md#32-侧边栏项目组)。- **网络**卡:- **代理**:分段控件 — 系统 / 直连 / 自定义。默认是系统(Chromium 跟随操作系统代理)。直连禁用代理。自定义将一个 HTTP、HTTPS 或 SOCKS5 URL 应用到应用自有出站请求(模型调用、扩展市场、更新、模型目录、插件 `net.fetch`、内置浏览器)。工作区 Bash 和 OAuth 用的系统浏览器不会被改写。- 自定义显示代理 URL(含 `user:pass@`)、默认 `localhost,127.0.0.1,::1,<local>,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16` 的绕过列表(本机、本地模型与所有局域网服务直连,不被代理吞掉),以及一次走该代理的测试。带认证的 URL 通过回环 SOCKS5 中继交给 Chromium(issue #490)。选择持久化为可选 `AppSettings.networkProxy`;系统/直连模式下同样保留用户填写的 `url` 与 `bypass`(只有 `mode` 决定谁生效),因此再次选择自定义会恢复它们而不是内置的 `socks5://127.0.0.1:1080`(issue #1541)。无协议/存储版本升级(D340 / ADR 0177)。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.mdindex bfbfd76b2..6783212d8 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@@ -9748,3 +9748,20 @@ host-created files. The full app's file-preview viewer is covered separately.- **关联规格**:`04-ux/06-settings-ia.md`、`04-ux/09-interaction-patterns.md`、ADR 0294、D659、issue #1653。- **验收**:仅在 Host 项目激活成功后,渲染层才恢复该规范化路径的本地归档元数据。- **状态**:`apps/desktop/test/app-store-sidebar.test.mjs` 与 `apps/desktop/test/project-create-dialog.test.mjs` 有源码契约覆盖;完整 UI 场景仍为草稿,仅在明确请求且环境可用时运行。++### E2E-266:项目折叠时标题显示运行活动++- **前提条件**:至少两个带会话的本地项目组,其中一个有运行中的回合(也可另有等待权限的会话);另有一个已连接且存在运行会话的远程主机项目组。设置 → 常规 → 侧边栏使用默认值。+- **步骤**:+ 1. 在一个项目中启动回合并折叠该项目组。+ 2. 检查折叠标题,再展开项目组。+ 3. 在另一个项目中启动并行回合,并在远程主机项目中启动回合。+ 4. 打开设置 → 常规 → 侧边栏,关闭“在项目上显示运行状态”,再检查侧边栏。+ 5. 重新开启总开关,并开启“活动流光”。+ 6. 只关闭“数量徽标”并检查效果,然后重新开启徽标。+ 7. 只关闭“活动流光”并检查效果,然后重新开启活动流光。+ 8. 开启操作系统的“减少动态效果”并检查活动流光。+- **预期**:默认时有运行活动的项目标题只显示数量徽标,活动流光关闭;运行中与等待权限的数量分开呈现。远程主机项目也遵循相同默认值。启用活动流光后,它与徽标同时显示。关闭总开关会隐藏两种提示,子开关置灰但保留已存值;重新开启后恢复此前选择。每个子开关只隐藏自身提示。减少动态效果时两种提示仍可见,但不播放动画。设置在渲染进程重载后保留。+- **关联规格**:`04-ux/01-ui-ia.md` §3.2、`04-ux/06-settings-ia.md`(常规 → 侧边栏卡片)。+- **验收**:项目折叠时仍能回答“这里是否有正在运行的工作”,且两种提示可从持久化设置独立控制。+- **状态**:草稿。现有 `apps/desktop/test/sidebar-project-runs.test.mjs` 覆盖数量分类、总开关与子开关门控、两种渲染入口,以及主题令牌和减少动态效果保证;它不覆盖设置 API 缺省值规范化或完整交互,相关场景仍需在可用环境手动验证。diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.mdindex 8077aca65..fbc570ab8 100644--- a/docs/zh-CN/spec/08-meta/decisions-log.md+++ b/docs/zh-CN/spec/08-meta/decisions-log.md@@ -73,6 +73,7 @@| D020 | 自动更新 | **后MVP** || D021 | 首次运行新手引导 | **内联清单(不是模式向导)** || D022 | 本地遥测 | **仅在 MVP 中记录本地日志(无远程遥测)** |+| D664 | 侧边栏运行活动默认值 | **未设置时,总开关和数量徽标默认开启,活动流光默认关闭。已保存的值优先生效。总开关仍控制两种提示;关闭总开关不会改写任一子开关偏好。不更改 schema 或执行迁移。** |## C. 提供商和模型覆盖决策 (0.3.4)@@ -5479,3 +5480,11 @@ Markdown 源码,不是 `text/html` 负载;对禁用行内 HTML 的外部编由 `apps/desktop/test/composer-mode-menu.test.mjs`、`apps/desktop/test/composer-chip-descenders.test.mjs` 以及 composer 插槽与思考等级契约覆盖。见 `04-ux/08-component-spec.md` §11 与 US-UI-73。++## 2026-10-18 —— 侧边栏运行活动默认只显示数量徽标(D664)++- 三个可选侧边栏活动设置都缺失时,总开关和数量徽标默认开启,活动流光默认关闭。+ 已保存的值优先生效;总开关仍控制两种提示,但不会改写任一子开关的偏好。+- 数量徽标保留运行状态的可发现性,同时避免动画轨道成为默认界面。不需要更改持久化+ schema 或迁移。设置读取通过渲染层 API 规范化应用这些默认值。见+ `04-ux/01-ui-ia.md`、`04-ux/06-settings-ia.md` 与 E2E-266。