Open
Conversation
- 添加 ShortcutBehavior 类型(new-conversation | current-conversation) - 添加 ShortcutConfig 接口(accelerator, enabled, behavior) - 添加默认配置常量(DEFAULT_CHAT_SHORTCUT, DEFAULT_AGENT_SHORTCUT) - 在 AppSettings 接口中添加 chatShortcut 和 agentShortcut 字段 - 扩展 SETTINGS_IPC_CHANNELS 常量(REGISTER_SHORTCUTS, UNREGISTER_SHORTCUTS, VALIDATE_SHORTCUT) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 创建 GlobalShortcutService 管理全局快捷键 - 实现 registerShortcuts() 注册快捷键 - 实现 unregisterShortcuts() 注销快捷键 - 实现 validateShortcut() 验证快捷键可用性 - 实现窗口显示和聚焦逻辑 - 处理 Chat 和 Agent 快捷键触发事件 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 导入 DEFAULT_CHAT_SHORTCUT 和 DEFAULT_AGENT_SHORTCUT - 在 getSettings() 中添加快捷键默认值处理 - 文件不存在时返回默认快捷键配置 - 从文件读取时使用默认值填充缺失的快捷键配置 - 读取失败时返回默认快捷键配置 - updateSettings() 已支持快捷键字段(通过展开运算符) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 注册全局快捷键 - 注销全局快捷键 - 验证快捷键可用性
Task 5 & 6: - 创建快捷键 Atoms (shortcut-atoms.ts) - 扩展 Preload 桥接暴露快捷键 IPC 方法 - 支持加载、更新、验证快捷键配置
- 实现键盘事件监听 - 支持快捷键格式化(Electron accelerator 格式) - 添加冲突检测提示 - 支持清除快捷键
- 使用 SettingsSection/SettingsCard/SettingsRow 组件 - 集成快捷键录制组件 - 支持启用/禁用开关 - 支持行为选项配置(新对话/当前对话) - 添加 macOS 权限提示
- 在 settings-tab.ts 中添加 'shortcuts' 类型 - 在 SettingsPanel.tsx 中添加快捷键标签页 - 在 index.ts 中导出 ShortcutSettings - 使用 Keyboard 图标
- 在 app.whenReady() 中设置主窗口引用并注册快捷键
- 在 app.on('before-quit') 中注销快捷键
- 确保应用启动时快捷键立即生效
- 添加 onChatShortcut 和 onAgentShortcut 事件监听器 - 监听主进程发送的 shortcut:chat 和 shortcut:agent 事件 - 返回清理函数用于取消订阅
Task 11 & 12: 完成快捷键功能的渲染进程集成 - 创建 ShortcutInitializer 组件 - Task 12: 应用启动时加载快捷键配置 - Task 11: 监听 Chat/Agent 快捷键触发事件 - 根据 behavior 执行相应操作: - new-conversation: 创建新对话/会话 - current-conversation: 打开当前对话/会话(无则创建) - 自动切换到对应模式和视图
问题3和4修复: - 触发时重新读取最新设置,确保使用最新的 behavior 配置 - 注册前先注销所有旧快捷键,确保配置更新生效 - 禁用的快捷键不再触发
问题2修复: - 创建新对话/会话后立即刷新列表 - 确保左侧对话框立即显示,无需等待发送消息
问题1修复: - 添加 formatAccelerator 函数格式化显示 - macOS: CommandOrControl → Cmd, Alt → Option - Windows/Linux: CommandOrControl → Ctrl - 显示更简洁友好,如 'Cmd+Shift+C' 而不是 'CommandOrControl+Shift+C'
1. Agent 会话现在正确关联工作区 - 快捷键创建的会话传递 currentWorkspaceId 参数 - 会话现在可以在对应工作区中找到 2. 快捷键录制器现在能区分 Command 和 Control 键 - 分别检测 metaKey 和 ctrlKey - 用户可以设置 Mac 专用的 Command 快捷键或跨平台的 Control 快捷键 - 更新 formatAccelerator 支持新格式 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
修复问题2和问题3: - 添加 validateChatShortcut 和 validateAgentShortcut 函数 - 在录制快捷键时检测与另一个快捷键的冲突 - 如果冲突,显示"快捷键已被占用"提示 - 防止设置相同的快捷键给 Chat 和 Agent Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
问题:当没有选中的对话时(currentConversationId 为 null), 但历史对话列表不为空(conversations.length > 0), 快捷键不会创建新对话也不会打开任何对话。 修复: - 添加 currentConversationId 和 currentAgentSessionId 的读取 - 修改逻辑为三种情况: 1. 没有任何对话 → 创建新对话 2. 有对话但没有选中 → 打开第一个对话 3. 已经有选中的对话 → 保持不变 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
问题:使用打开当前对话行为时,如果当前工作区没有会话, 但其他工作区有会话,代码会打开其他工作区的会话, 导致在当前工作区左侧看不到这个会话。 根本原因:代码直接使用全局 agentSessions[0], 没有考虑工作区过滤。 修复:先过滤出当前工作区的会话,然后再判断: - 当前工作区没有会话 → 创建新会话 - 当前工作区有会话但没有选中 → 打开第一个 - 已经有选中的会话 → 保持不变 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
功能概述
实现了全局快捷键功能,用户可以在设置中自定义快捷键来快速打开 Chat/Agent 对话。
实现的功能
核心功能
用户体验优化
技术实现
架构设计
关键实现
测试计划
快捷键设置测试
Chat 模式快捷键测试
Agent 模式快捷键测试
已修复的问题
相关文件
新增文件
修改文件
其他
邮箱:fkufeng01@gmail.com