Skip to content

【已审核】feat(sidebar): 侧边栏重构为手风琴折叠结构#1023

Open
climashscape wants to merge 1 commit into
proma-ai:mainfrom
climashscape:feat/sidebar-accordion-restructure
Open

【已审核】feat(sidebar): 侧边栏重构为手风琴折叠结构#1023
climashscape wants to merge 1 commit into
proma-ai:mainfrom
climashscape:feat/sidebar-accordion-restructure

Conversation

@climashscape

@climashscape climashscape commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

概述

给侧边栏做了一次"大扫除"——把原来挤在一起的各种东西拆开,各自安家。

之前的问题

打开侧边栏,你看到的是一个大杂烩:自动任务假装自己是"项目"混在项目列表里,点击项目标题既切换工作区又折叠列表,想做一件事却触发了另一件。更糟的是,想折叠当前项目?做不到——因为你已经在这个项目上了,点击无效。

改了什么

现在侧边栏变成了三层独立结构,像三个抽屉各管各的:

┌──────────────────┐
│  🤖 自动任务区    │  ← 可折叠,委派子会话在母会话下树形展开
├──────────────────┤
│  📌 置顶会话      │  ← 会话计数 + 分割线,视觉区隔
├──────────────────┤
│  📁 项目 A       │  ← 每个项目独立折叠/展开
│  📁 项目 B       │
│  📁 项目 C       │
└──────────────────┘

具体来说:

🧹 自动任务终于"独立"了:不再伪装成项目混在列表里,而是搬到自己的独立区域。它的委派子会话直接在母会话下面展开——之前这些子会话会重复出现在项目列表里,现在一劳永逸解决。

📁 每个项目一个"手风琴":点哪个项目,哪个展开。折叠状态会记住,刷新不丢。项目之间加了分割线,一眼能看出边界。

🎯 标题只做一件事:点击标题 = 折叠/展开,不切工作区。想换工作区?点下拉菜单 →「设为当前项目」。职责单一,不再"买一送一"。

🔘 新建按钮聪明了:有工作区时显示「新会话 ▾」——主体一键开聊,箭头下拉能「新建项目」。没工作区时就是简简单单的「新建项目」。

👁️ 活跃会话不会被藏起来:即使你把某个项目折叠了,如果里面有正在跑或卡住的会话,侧边栏会自动展开它——重要的东西不会因为你的折叠偏好而消失在视野里。

📌 置顶区有了存在感:加了 Pin 图标和会话计数,一条分割线把它和下面内容分开,不再是"附在列表上的便签"。

🧽 顺带清理的代码:移除了 automationGroupOrderAtom(自动任务不再参与排序)、toggleSetEntry/deleteSetEntry/collapsedWorkspaceIds(状态已迁移到持久化 atom)、noopVoid/noopAsync(不再需要为合成组填假回调)、AUTOMATION_GROUP_ID 等相关逻辑。项目拖拽排序也简化了——不再需要处理合成组的特殊穿插。

设计取舍

取舍 选择 理由
折叠状态持久化? 是,但活跃会话强制展开 记住你的布局偏好,但不藏起重要状态
标题点击行为? 仅折叠/展开,不切换工作区 单一职责;切换走下拉菜单,不会误触
委派子会话在哪渲染? 自动任务区母会话下树形展开 语义归属清晰,不在项目列表里"分身"
折叠持久化范围? 四种状态全覆盖 项目/自动任务/置顶委派/项目内委派,刷新后和刷新前一模一样

改动文件

文件 增减 说明
apps/electron/src/renderer/atoms/agent-atoms.ts -2 移除 automationGroupOrderAtom
apps/electron/src/renderer/atoms/sidebar-atoms.ts +24 新增 4 个持久化折叠 atom
apps/electron/src/renderer/components/app-shell/LeftSidebar.tsx +399/-260 手风琴重构核心文件
apps/electron/src/renderer/main.tsx -6/+1 移除 automationGroupOrder 初始化与设置读取
apps/electron/src/types/settings.ts -2 移除 agentAutomationGroupOrder 类型

测试

  • bun run typecheck — 全包通过
  • BDD 自审查 — 两轮通过(初轮审查→修复→最终通过)

紧急度

低 — UI 重构,非紧急 bugfix。不改变功能逻辑,不影响现有数据。折叠状态从无持久化改为持久化,老用户首次升级后看到的和之前一样是默认展开,无破坏性变化。

@climashscape climashscape marked this pull request as ready for review June 30, 2026 19:05
@climashscape climashscape changed the title 【施工中】feat(sidebar): restructure sidebar into accordion sections 【自审中】feat(sidebar): restructure sidebar into accordion sections Jun 30, 2026
@climashscape climashscape marked this pull request as draft June 30, 2026 19:07
@climashscape climashscape changed the title 【自审中】feat(sidebar): restructure sidebar into accordion sections 【等待审核】feat(sidebar): restructure sidebar into accordion sections Jun 30, 2026
@climashscape climashscape changed the title 【等待审核】feat(sidebar): restructure sidebar into accordion sections 【等待审核】feat(侧边栏): 重构为手风琴折叠结构 Jun 30, 2026
@climashscape climashscape changed the title 【等待审核】feat(侧边栏): 重构为手风琴折叠结构 【等待审核】feat(sidebar): 重构为手风琴折叠结构 Jun 30, 2026
@climashscape climashscape force-pushed the feat/sidebar-accordion-restructure branch 3 times, most recently from 5a5f931 to 0c3ea29 Compare July 3, 2026 16:38
@ErlichLiu

Copy link
Copy Markdown
Collaborator

@climashscape 这个我还没想好,等我们在随着开发发展发展,后续可能 Cherry pick 一部分来实现

@climashscape

Copy link
Copy Markdown
Contributor Author

哈哈收到不急。用上之后确实顺手多了——折叠状态终于存住了,以前整理好的侧边栏重启就全弹回去,现在关哪个记哪个;自动任务也从项目列表里剥出来独立一区,不再混在一堆项目里;整个侧边栏"置顶/自动任务/项目"三段,一眼能分清哪是哪。

@climashscape climashscape force-pushed the feat/sidebar-accordion-restructure branch 3 times, most recently from d54136a to cee6b31 Compare July 12, 2026 02:23
@climashscape climashscape changed the title 【等待审核】feat(sidebar): 重构为手风琴折叠结构 【等待审核】feat(sidebar): 侧边栏重构为手风琴折叠结构 Jul 12, 2026
@climashscape climashscape force-pushed the feat/sidebar-accordion-restructure branch 8 times, most recently from 2a12751 to 4ce9218 Compare July 12, 2026 07:14
@climashscape climashscape force-pushed the feat/sidebar-accordion-restructure branch from 4ce9218 to e093e42 Compare July 12, 2026 07:49
@climashscape climashscape changed the title 【等待审核】feat(sidebar): 侧边栏重构为手风琴折叠结构 【已审核】feat(sidebar): 侧边栏重构为手风琴折叠结构 Jul 12, 2026
@climashscape climashscape marked this pull request as ready for review July 12, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants