Commit Graph

16 Commits

  • feat(ui): implement dark mode with system preference support
    - Add useDarkMode hook for managing theme state and persistence
    - Integrate dark mode toggle button in app header
    - Update all components with dark variant styles using Tailwind v4
    - Create centralized style utilities for consistent theming
    - Support system color scheme preference as fallback
    - Store user preference in localStorage for persistence
  • refactor(types): introduce Settings and apply in API
    - style(prettier): format src files
    - style(rustfmt): format Rust sources
    - refactor(tauri-api): type-safe getSettings/saveSettings
    - refactor(d.ts): declare window.api with Settings
    
    [skip ci]
  • feat(settings): add minimal settings panel
    - Add settings icon button next to app title
    - Create SettingsModal component with:
      - Show in Dock option (macOS)
      - Version info and check for updates button
      - Config file location with open folder button
    - Add settings-related APIs in tauri-api
    - Update type definitions for new API methods
  • feat: refactor ProviderForm component with new subcomponents (#13)
    * feat: refactor ProviderForm component with new subcomponents
    
    - Introduced PresetSelector, ApiKeyInput, ClaudeConfigEditor, and CodexConfigEditor for improved modularity and readability.
    - Simplified preset selection logic for both Claude and Codex configurations.
    - Enhanced API Key input handling with dedicated components for better user experience.
    - Removed redundant code and improved state management in the ProviderForm component.
    
    * feat: add Kimi model selection to ProviderForm component
    
    - Introduced KimiModelSelector for enhanced model configuration options.
    - Implemented state management for Kimi model selection, including initialization and updates based on preset selection.
    - Improved user experience by conditionally displaying the Kimi model selector based on the selected preset.
    - Refactored related logic to ensure proper handling of Kimi-specific settings in the ProviderForm.
    
    * feat: enhance API Key input and model selection in ProviderForm
    
    - Added toggle functionality to show/hide API Key in ApiKeyInput component for improved user experience.
    - Updated placeholder text in ProviderForm to provide clearer instructions based on the selected preset.
    - Enhanced KimiModelSelector to display a more informative message when API Key is not provided.
    - Refactored provider presets to remove hardcoded API Key values for better security practices.
    
    * fix(kimi): optimize debounce implementation in model selector
    
    - Fix initial state: use empty string instead of apiKey.trim()
    - Refactor fetchModels to fetchModelsWithKey with explicit key parameter
    - Ensure consistent behavior between auto-fetch and manual refresh
    - Eliminate mental overhead from optional parameter fallback logic
    
    * fix(api-key): remove custom masking logic, use native password input
    
    - Remove getDisplayValue function with custom star masking
    - Use native browser password input behavior for better UX consistency
    - Simplify component logic while maintaining show/hide toggle functionality
    
    * chore: format code with prettier
    
    - Apply consistent code formatting across all TypeScript files
    - Fix indentation and spacing according to project style guide
    
    ---------
    
    Co-authored-by: Jason <farion1231@gmail.com>
  • feat: 系统托盘 (#12)
    * feat: 系统托盘
    
    1. 添加系统托盘
    2. 托盘添加切换供应商功能
    3. 整理组件目录
    
    * feat: 优化系统托盘菜单结构
    
    - 扁平化Claude和Codex的菜单结构,直接将所有供应商添加到主菜单,简化用户交互。
    - 添加无供应商时的提示信息,提升用户体验。
    - 更新分隔符文本以增强可读性。
    
    * feat: integrate Tailwind CSS and Lucide icons
    
    - Added Tailwind CSS for styling and layout improvements.
    - Integrated Lucide icons for enhanced UI elements.
    - Updated project structure by removing unused CSS files and components.
    - Refactored configuration files to support new styling and component structure.
    - Introduced new components for managing providers with improved UI interactions.   
    
    * fix: 修复类型声明和分隔符实现问题
    
    - 修复 updateTrayMenu 返回类型不一致(Promise<void> -> Promise<boolean>)
    - 添加缺失的 UnlistenFn 类型导入
    - 使用 MenuBuilder.separator() 替代文本分隔符
    
    ---------
    
    Co-authored-by: farion1231 <farion1231@gmail.c
  • feat(config): backup v1 file before v2 migration
    - Add timestamped backup at `~/.cc-switch/config.v1.backup.<ts>.json`
    - Keep provider files untouched; only cc-switch metadata is backed up
    - Remove UI notification plan; backup only as requested
    - Update CHANGELOG with migration backup notes
  • revert: restore app/appType param compatibility and revert segmented-thumb pointer-events change
    - Restore backend commands to accept app_type/app/appType with priority app_type
    - Frontend invoke() now passes both { app_type, app } again
    - Revert CSS change that set pointer-events: none on segmented-thumb
    - Keep minor fix: open_config_folder signature uses handle + respects both names
    
    Note: warnings for non_snake_case (appType) are expected for compatibility.
  • - feat(codex): 引入 Codex 应用与供应商切换(管理 auth.json/config.toml,支持备份与恢复)
    - feat(core): 多应用配置 v2(claude/codex)与 ProviderManager;支持 v1→v2 自动迁移
    - feat(ui): 新增 Codex 页签与双编辑器表单;统一 window.api 支持 app 参数
    - feat(tauri): 新增 get_config_status/open_config_folder/open_external 命令并适配 Codex
    - fix(codex): 主配置缺失时不执行默认导入(对齐 Claude 行为)
    - chore: 配置目录展示与重启提示等细节优化
  • chore: format code and fix bundle identifier for v3.0.0 release
    - Format all TypeScript/React code with Prettier
    - Format all Rust code with cargo fmt
    - Fix bundle identifier from .app to .desktop to avoid macOS conflicts
    - Prepare codebase for v3.0.0 Tauri release
  • fix: 修复 Tauri 重构导致的配置读取与渲染问题
    - 前端:始终绑定 ,避免环境判断失误造成白屏
    - 后端: 仅初始化一次,并通过  注入,避免双实例不一致
    - 配置: 兼容  回退,提高旧配置兼容性
    - 结果:主页面数据正常加载,底部配置路径组件恢复显示
  • - fix(types): 统一导入到 src/types.ts,移除 shared/types 残留路径
    - chore(tsconfig): 将 include 扩展为 src/**/* 覆盖迁移后的源文件
    - feat(build): Vite 设置 root 为 src,并将 build.outDir 设为 ../dist 以匹配 Tauri frontendDist
    - refactor(api): 去除未使用的 plugin-shell import;统一 electronAPI 类型定义至 vite-env.d.ts
    - build: 验证 renderer 构建通过,产物输出至 dist/
  • refactor: 清理 Electron 遗留代码并优化项目结构
    - 删除 Electron 主进程代码 (src/main/)
    - 删除构建产物文件夹 (build/, dist/, release/)
    - 清理 package.json 中的 Electron 依赖和脚本
    - 删除 TypeScript 配置中的 Electron 相关文件
    - 优化前端代码结构至 Tauri 标准结构 (src/renderer → src/)
    - 删除移动端图标和不必要文件
    - 更新文档说明技术栈变更为 Tauri