Open
Conversation
1、Agent 模式下添加置顶会话功能。 2、用户可以通过右键当前会话以及点击会话右上角的pin图标,将当前会话置顶。 3、置顶会话支持折叠,节省空间。 4、置顶会话采用隔离工作区的方式,不同工作区不共享置顶会话。 1. **类型定义**:在 AgentSessionMeta 中添加 `pinned?: boolean` 字段 2. **服务层**:在 agent-session-manager.ts 中支持置顶/取消置顶操作,排序时置顶项优先 3. **IPC 层**:添加 TOGGLE_PIN 通道,在 ipc.ts 和 preload/index.ts 中实现 4. **UI 层**: - 侧边栏添加置顶会话区域(可展开/收起) - 头部添加置顶按钮 - 右键菜单支持置顶/取消置顶 - 置顶会话按工作区隔离(从 filteredAgentSessions 而非 agentSessions 中过滤) - packages/shared/src/types/agent.ts - apps/electron/src/main/lib/agent-session-manager.ts - apps/electron/src/main/ipc.ts - apps/electron/src/preload/index.ts - apps/electron/src/renderer/components/app-shell/LeftSidebar.tsx - apps/electron/src/renderer/components/agent/AgentHeader.tsx - [x] 右键会话,点击"置顶会话",会话移至置顶区域 - [x] 点击头部 Pin 按钮,当前会话置顶/取消置顶 - [x] 置顶会话在日期分组列表中显示,前面有 Pin 图标 - [x] 点击"置顶会话"标题,区域可展开/收起 - [x] 切换工作区,置顶会话按工作区隔离显示 - [x] 重启应用,置顶状态持久化保存 - [x] 右键置顶会话,点击"取消置顶",会话恢复普通状态
f864920 to
fd1999c
Compare
Contributor
Author
## Summary - 置顶会话按钮的 Pin 图标从16px调整到14px,与其他图标保持一致。 - 将"置顶会话"按钮与"新会话"按钮在视觉上进行对齐,统一界面风格。 ## 实现 1. Pin 图标大小从 16px 调整为 14px,与其他图标保持一致 2. "置顶对话"和"置顶会话"按钮从 SidebarItem 组件改为独立实现 3. 图标和文字间距统一为 `gap-2`(8px),与"新会话"按钮一致 4. 移除固定宽度图标容器 \`w-[18px]\`,使用与"新会话"按钮相同的结构 ## 变更文件 - apps/electron/src/renderer/components/app-shell/LeftSidebar.tsx ## Test Plan - [x] Pin 图标大小为 14px,与 Plus 图标大小一致 - [x] "置顶会话"按钮与"新会话"按钮视觉对齐 - [x] Chat 模式和 Agent 模式的置顶按钮样式一致 - [x] 按钮 hover 效果正常
Contributor
Author
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.




Summary
为 Agent 模式添加置顶会话功能,与 Chat 模式保持一致的交互体验。用户可以通过右上角按钮或右键菜单置顶/取消置顶会话,置顶的会话会在侧边栏置顶区域显示,并按置顶状态优先排序。
更新:优化了置顶按钮的样式,提升视觉体验和交互反馈。
实现
功能实现
AgentSessionMeta接口中添加pinned?: boolean字段updateAgentSessionMeta支持更新pinned字段listAgentSessions排序逻辑,置顶会话优先显示AGENT_IPC_CHANNELS.TOGGLE_PIN通道togglePinAgentSession处理器togglePinAgentSessionAPIAgentHeader:添加置顶按钮(位于右上角)LeftSidebar:样式优化
变更文件
packages/shared/src/types/agent.tsapps/electron/src/main/lib/agent-session-manager.tsapps/electron/src/main/ipc.tsapps/electron/src/preload/index.tsapps/electron/src/renderer/components/app-shell/LeftSidebar.tsxapps/electron/src/renderer/components/agent/AgentHeader.tsxTest Plan
其他
邮箱:fkufeng01@gmail.com