【已审核】feat(sidebar): 侧边栏重构为手风琴折叠结构#1023
Open
climashscape wants to merge 1 commit into
Open
Conversation
5a5f931 to
0c3ea29
Compare
Collaborator
|
@climashscape 这个我还没想好,等我们在随着开发发展发展,后续可能 Cherry pick 一部分来实现 |
Contributor
Author
|
哈哈收到不急。用上之后确实顺手多了——折叠状态终于存住了,以前整理好的侧边栏重启就全弹回去,现在关哪个记哪个;自动任务也从项目列表里剥出来独立一区,不再混在一堆项目里;整个侧边栏"置顶/自动任务/项目"三段,一眼能分清哪是哪。 |
d54136a to
cee6b31
Compare
2a12751 to
4ce9218
Compare
4ce9218 to
e093e42
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
给侧边栏做了一次"大扫除"——把原来挤在一起的各种东西拆开,各自安家。
之前的问题
打开侧边栏,你看到的是一个大杂烩:自动任务假装自己是"项目"混在项目列表里,点击项目标题既切换工作区又折叠列表,想做一件事却触发了另一件。更糟的是,想折叠当前项目?做不到——因为你已经在这个项目上了,点击无效。
改了什么
现在侧边栏变成了三层独立结构,像三个抽屉各管各的:
具体来说:
🧹 自动任务终于"独立"了:不再伪装成项目混在列表里,而是搬到自己的独立区域。它的委派子会话直接在母会话下面展开——之前这些子会话会重复出现在项目列表里,现在一劳永逸解决。
📁 每个项目一个"手风琴":点哪个项目,哪个展开。折叠状态会记住,刷新不丢。项目之间加了分割线,一眼能看出边界。
🎯 标题只做一件事:点击标题 = 折叠/展开,不切工作区。想换工作区?点下拉菜单 →「设为当前项目」。职责单一,不再"买一送一"。
🔘 新建按钮聪明了:有工作区时显示「新会话 ▾」——主体一键开聊,箭头下拉能「新建项目」。没工作区时就是简简单单的「新建项目」。
👁️ 活跃会话不会被藏起来:即使你把某个项目折叠了,如果里面有正在跑或卡住的会话,侧边栏会自动展开它——重要的东西不会因为你的折叠偏好而消失在视野里。
📌 置顶区有了存在感:加了 Pin 图标和会话计数,一条分割线把它和下面内容分开,不再是"附在列表上的便签"。
🧽 顺带清理的代码:移除了
automationGroupOrderAtom(自动任务不再参与排序)、toggleSetEntry/deleteSetEntry/collapsedWorkspaceIds(状态已迁移到持久化 atom)、noopVoid/noopAsync(不再需要为合成组填假回调)、AUTOMATION_GROUP_ID等相关逻辑。项目拖拽排序也简化了——不再需要处理合成组的特殊穿插。设计取舍
改动文件
apps/electron/src/renderer/atoms/agent-atoms.tsautomationGroupOrderAtomapps/electron/src/renderer/atoms/sidebar-atoms.tsapps/electron/src/renderer/components/app-shell/LeftSidebar.tsxapps/electron/src/renderer/main.tsxautomationGroupOrder初始化与设置读取apps/electron/src/types/settings.tsagentAutomationGroupOrder类型测试
bun run typecheck— 全包通过紧急度
低 — UI 重构,非紧急 bugfix。不改变功能逻辑,不影响现有数据。折叠状态从无持久化改为持久化,老用户首次升级后看到的和之前一样是默认展开,无破坏性变化。