Commit Graph

39 Commits

  • Merge branch 'main' into refactor/ui
    # Conflicts:
    #	src/components/skills/SkillsPage.tsx
  • feat(deeplink): add config file support for deeplink import
    Support importing provider configuration from embedded or remote config files.
    - Add base64 dependency for config content encoding
    - Support config, configFormat, and configUrl parameters
    - Make homepage/endpoint/apiKey optional when config is provided
    - Add config parsing and merging logic
  • Revert "feat(settings): add auto-launch on system startup feature"
    This reverts commit ba336fc416.
    
    Reason: Found issues that need to be addressed before reintroducing
    the auto-launch feature. Will reimplement with fixes.
  • feat(settings): add auto-launch on system startup feature
    Implement auto-launch functionality with proper state synchronization
    and error handling across Windows, macOS, and Linux platforms.
    
    Key changes:
    - Add auto_launch module using auto-launch crate 0.5
    - Define typed errors (AutoLaunchPathError, AutoLaunchEnableError, etc.)
    - Sync system state with settings.json on app startup
    - Only call system API when auto-launch state actually changes
    - Add UI toggle in Window Settings panel
    - Add i18n support for auto-launch settings (en/zh)
    
    Implementation details:
    - Settings file (settings.json) is the single source of truth
    - On startup, system state is synced to match settings.json
    - Error handling uses Rust type system with proper error propagation
    - Frontend optimized to avoid unnecessary system API calls
    
    Platform support:
    - Windows: HKEY_CURRENT_USER registry modification
    - macOS: AppleScript-based launch item (configurable to Launch Agent)
    - Linux: XDG autostart desktop file
  • feat(backend): add icon fields to Provider model and default mappings
    Extend Rust backend to support provider icon customization:
    
    ## Provider Model (src-tauri/src/provider.rs)
    - Add `icon: Option<String>` field for icon name
    - Add `icon_color: Option<String>` field for hex color
    - Use serde rename `iconColor` for frontend compatibility
    - Apply skip_serializing_if for clean JSON output
    - Update Provider::new() to initialize icon fields as None
    
    ## Provider Defaults (src-tauri/src/provider_defaults.rs) [NEW]
    - Define ProviderIcon struct with name and color fields
    - Create DEFAULT_PROVIDER_ICONS static HashMap with 23 providers:
      - AI providers: OpenAI, Anthropic, Claude, Google, Gemini,
        DeepSeek, Kimi, Moonshot, Zhipu, MiniMax, Baidu, Alibaba,
        Tencent, Meta, Microsoft, Cohere, Perplexity, Mistral, HuggingFace
      - Cloud platforms: AWS, Azure, Huawei, Cloudflare
    - Implement infer_provider_icon() with exact and fuzzy matching
    - Add unit tests for matching logic (exact, fuzzy, case-insensitive)
    
    ## Deep Link Support (src-tauri/src/deeplink.rs)
    - Initialize icon fields when creating Provider from deep link import
    
    ## Module Registration (src-tauri/src/lib.rs)
    - Register provider_defaults module
    
    ## Dependencies (Cargo.toml)
    - Add once_cell for lazy static initialization
    
    This backend support enables icon persistence and future features
    like auto-icon inference during provider creation.
  • feat(backend): add auto-launch functionality
    Implement system auto-launch feature to allow CC-Switch to start
    automatically on system boot, improving user convenience.
    
    Backend Implementation:
    - auto_launch.rs: New module for auto-launch management
      * Cross-platform support using auto-launch crate
      * Enable/disable auto-launch with system integration
      * Proper error handling for permission issues
      * Platform-specific implementations (macOS/Windows/Linux)
    
    Command Layer:
    - Add get_auto_launch command to check current status
    - Add set_auto_launch command to toggle auto-start
    - Integrate commands with settings API
    
    Settings Integration:
    - Extend Settings struct with auto_launch field
    - Persist auto-launch preference in settings store
    - Automatic state synchronization on app startup
    
    Dependencies:
    - Add auto-launch ^0.5.0 to Cargo.toml
    - Update Cargo.lock with new dependency tree
    
    Technical Details:
    - Uses platform-specific auto-launch mechanisms:
      * macOS: Login Items via LaunchServices
      * Windows: Registry Run key
      * Linux: XDG autostart desktop files
    - Handles edge cases like permission denials gracefully
    - Maintains settings consistency across app restarts
    
    This feature enables users to have CC-Switch readily available
    after system boot without manual intervention, particularly useful
    for users who frequently switch between API providers.
  • chore(release): bump version to v3.7.0 and rebrand to include Gemini CLI
    - Update version from 3.6.2 to 3.7.0 across all config files
    - Update project description to "All-in-One Assistant for Claude Code, Codex & Gemini CLI"
    - Update Chinese description to "Claude Code / Codex / Gemini CLI 全方位辅助工具"
    - Sync version in package.json, Cargo.toml, tauri.conf.json
    - Update branding in README.md, README_ZH.md and i18n locale files
  • feat: add model configuration support and fix Gemini deeplink bug (#251)
    * feat(providers): add notes field for provider management
    
    - Add notes field to Provider model (backend and frontend)
    - Display notes with higher priority than URL in provider card
    - Style notes as non-clickable text to differentiate from URLs
    - Add notes input field in provider form
    - Add i18n support (zh/en) for notes field
    
    * chore: format code and clean up unused props
    
    - Run cargo fmt on Rust backend code
    - Format TypeScript imports and code style
    - Remove unused appId prop from ProviderPresetSelector
    - Clean up unused variables in tests
    - Integrate notes field handling in provider dialogs
    
    * feat(deeplink): implement ccswitch:// protocol for provider import
    
    Add deep link support to enable one-click provider configuration import via ccswitch:// URLs.
    
    Backend:
    - Implement URL parsing and validation (src-tauri/src/deeplink.rs)
    - Add Tauri commands for parse and import (src-tauri/src/commands/deeplink.rs)
    - Register ccswitch:// protocol in macOS Info.plist
    - Add comprehensive unit tests (src-tauri/tests/deeplink_import.rs)
    
    Frontend:
    - Create confirmation dialog with security review UI (src/components/DeepLinkImportDialog.tsx)
    - Add API wrapper (src/lib/api/deeplink.ts)
    - Integrate event listeners in App.tsx
    
    Configuration:
    - Update Tauri config for deep link handling
    - Add i18n support for Chinese and English
    - Include test page for deep link validation (deeplink-test.html)
    
    Files: 15 changed, 1312 insertions(+)
    
    * chore(deeplink): integrate deep link handling into app lifecycle
    
    Wire up deep link infrastructure with app initialization and event handling.
    
    Backend Integration:
    - Register deep link module and commands in mod.rs
    - Add URL handling in app setup (src-tauri/src/lib.rs:handle_deeplink_url)
    - Handle deep links from single instance callback (Windows/Linux CLI)
    - Handle deep links from macOS system events
    - Add tauri-plugin-deep-link dependency (Cargo.toml)
    
    Frontend Integration:
    - Listen for deeplink-import/deeplink-error events in App.tsx
    - Update DeepLinkImportDialog component imports
    
    Configuration:
    - Enable deep link plugin in tauri.conf.json
    - Update Cargo.lock for new dependencies
    
    Localization:
    - Add Chinese translations for deep link UI (zh.json)
    - Add English translations for deep link UI (en.json)
    
    Files: 9 changed, 359 insertions(+), 18 deletions(-)
    
    * refactor(deeplink): enhance Codex provider template generation
    
    Align deep link import with UI preset generation logic by:
    - Adding complete config.toml template matching frontend defaults
    - Generating safe provider name from sanitized input
    - Including model_provider, reasoning_effort, and wire_api settings
    - Removing minimal template that only contained base_url
    - Cleaning up deprecated test file deeplink-test.html
    
    * style: fix clippy uninlined_format_args warnings
    
    Apply clippy --fix to use inline format arguments in:
    - src/mcp.rs (8 fixes)
    - src/services/env_manager.rs (10 fixes)
    
    * style: apply code formatting and cleanup
    
    - Format TypeScript files with Prettier (App.tsx, EnvWarningBanner.tsx, formatters.ts)
    - Organize Rust imports and module order alphabetically
    - Add newline at end of JSON files (en.json, zh.json)
    - Update Cargo.lock for dependency changes
    
    * feat: add model name configuration support for Codex and fix Gemini model handling
    
    - Add visual model name input field for Codex providers
      - Add model name extraction and update utilities in providerConfigUtils
      - Implement model name state management in useCodexConfigState hook
      - Add conditional model field rendering in CodexFormFields (non-official only)
      - Integrate model name sync with TOML config in ProviderForm
    
    - Fix Gemini deeplink model injection bug
      - Correct environment variable name from GOOGLE_GEMINI_MODEL to GEMINI_MODEL
      - Add test cases for Gemini model injection (with/without model)
      - All tests passing (9/9)
    
    - Fix Gemini model field binding in edit mode
      - Add geminiModel state to useGeminiConfigState hook
      - Extract model value during initialization and reset
      - Sync model field with geminiEnv state to prevent data loss on submit
      - Fix missing model value display when editing Gemini providers
    
    Changes:
      - 6 files changed, 245 insertions(+), 13 deletions(-)
  • 添加Claude和Codex环境变量检查 (#242)
    * feat(env): add environment variable conflict detection and management
    
    实现了系统环境变量冲突检测与管理功能:
    
    核心功能:
    - 自动检测会影响 Claude/Codex 的系统环境变量
    - 支持 Windows 注册表和 Unix shell 配置文件检测
    - 提供可视化的环境变量冲突警告横幅
    - 支持批量选择和删除环境变量
    - 删除前自动备份,支持后续恢复
    
    技术实现:
    - Rust 后端: 跨平台环境变量检测与管理
    - React 前端: EnvWarningBanner 组件交互界面
    - 国际化支持: 中英文界面
    - 类型安全: 完整的 TypeScript 类型定义
    
    * refactor(env): remove unused imports and function
    
    Remove unused HashMap and PathBuf imports, and delete the unused get_source_description function to clean up the code.
  • Feat/claude skills management (#237)
    * feat(skills): add Claude Skills management feature
    
    Implement complete Skills management system with repository discovery,
    installation, and lifecycle management capabilities.
    
    Backend:
    - Add SkillService with GitHub integration and installation logic
    - Implement skill commands (list, install, uninstall, check updates)
    - Support multiple skill repositories with caching
    
    Frontend:
    - Add Skills management page with repository browser
    - Create SkillCard and RepoManager components
    - Add badge, card, table UI components
    - Integrate Skills API with Tauri commands
    
    Files: 10 files changed, 1488 insertions(+)
    
    * feat(skills): integrate Skills feature into application
    
    Integrate Skills management feature with complete dependency updates,
    configuration structure extensions, and internationalization support.
    
    Dependencies:
    - Add @radix-ui/react-visually-hidden for accessibility
    - Add anyhow, zip, serde_yaml, tempfile for Skills backend
    - Enable chrono serde feature for timestamp serialization
    
    Backend Integration:
    - Extend MultiAppConfig with SkillStore field
    - Implement skills.json migration from legacy location
    - Register SkillService and skill commands in main app
    - Export skill module in commands and services
    
    Frontend Integration:
    - Add Skills page route and dialog in App
    - Integrate Skills UI with main navigation
    
    Internationalization:
    - Add complete Chinese translations for Skills UI
    - Add complete English translations for Skills UI
    
    Code Quality:
    - Remove redundant blank lines in gemini_mcp.rs
    - Format log statements in mcp.rs
    
    Tests:
    - Update import_export_sync tests for SkillStore
    - Update mcp_commands tests for new structure
    
    Files: 16 files changed, 540 insertions(+), 39 deletions(-)
    
    * style(skills): improve SkillsPage typography and spacing
    
    Optimize visual hierarchy and readability of Skills page:
    - Reduce title size from 2xl to lg with tighter tracking
    - Improve description spacing and color contrast
    - Enhance empty state with better text hierarchy
    - Use explicit gray colors for better dark mode support
    
    * feat(skills): support custom subdirectory path for skill scanning
    
    Add optional skillsPath field to SkillRepo to enable scanning skills
    from subdirectories (e.g., "skills/") instead of repository root.
    
    Changes:
    - Backend: Add skillsPath field with subdirectory scanning logic
    - Frontend: Add skillsPath input field and display in repo list
    - Presets: Add cexll/myclaude repo with skills/ subdirectory
    - Code quality: Fix clippy warnings (dedup logic, string formatting)
    
    Backward compatible: skillsPath is optional, defaults to root scanning.
    
    * refactor(skills): improve repo manager dialog layout
    
    Optimize dialog structure with fixed header and scrollable content:
    - Add flexbox layout with fixed header and scrollable body
    - Remove outer border wrapper for cleaner appearance
    - Match SkillsPage design pattern for consistency
    - Improve UX with better content hierarchy
  • refactor(prompt): extract file path logic and implement auto-import on first launch (#214)
    - Extract prompt file path logic to dedicated prompt_files module
    - Refactor PromptService to use centralized path resolution
    - Implement auto-import for existing prompt files on first startup
    - Add comprehensive unit tests for auto-import functionality
  • chore(release): prepare for v3.6.1 release
    - Bump version to 3.6.1 across all config files
      - package.json, Cargo.toml, tauri.conf.json
      - README.md and README_ZH.md version badges
      - Auto-updated Cargo.lock
    - Add release notes documentation
      - docs/release-note-v3.6.0-en.md (archive)
      - docs/release-note-v3.6.1-zh.md (cumulative format)
      - docs/release-note-v3.6.1-en.md (cumulative format)
    - Enlarge PackyCode sponsor logo by 50% (100px → 150px)
    - Update roadmap checklist (homebrew support marked as done)
  • Release v3.6.0: Major architecture refactoring and feature enhancements
    New Features:
    - Provider duplication and manual sorting via drag-and-drop
    - Custom endpoint management for aggregator providers
    - Usage query with auto-refresh interval and test script API
    - Config editor improvements (JSON format button, real-time TOML validation)
    - Auto-sync on directory change for WSL environment support
    - Load live config when editing active provider to protect manual modifications
    - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax
    - Partner promotion mechanism (Zhipu GLM Z.ai)
    
    Architecture Improvements:
    - Backend: 5-phase refactoring (error handling → command split → services → concurrency)
    - Frontend: 4-stage refactoring (tests → hooks → components → cleanup)
    - Testing: 100% hooks unit test coverage, integration tests for critical flows
    
    Documentation:
    - Complete README rewrite with detailed architecture overview
    - Separate Chinese (README_ZH.md) and English (README.md) versions
    - Comprehensive v3.6.0 changelog with categorized changes
    - New bilingual screenshots and partner banners
    
    Bug Fixes:
    - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync)
    - Fixed usage query interval timing and refresh button animation
    - Fixed UI issues (edit mode alignment, language switch state)
    - Fixed endpoint speed test and provider duplicate insertion position
    - Force exit on config error to prevent silent fallback
    
    Technical Details:
    - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x
    - Removed legacy v1 migration logic for better startup performance
    - Standardized command parameters (unified to camelCase `app`)
    - Result pattern for graceful error handling
  • refactor(mcp): preserve TOML formatting when syncing to Codex
    Switch from `toml` to `toml_edit` crate for incremental TOML editing,
    preserving user-written comments, whitespace, and key ordering in
    Codex config.toml.
    
    Changes:
    - Add toml_edit 0.22 dependency for preserving-style TOML editing
    - Refactor sync_enabled_to_codex() to use toml_edit::DocumentMut API
    - Implement smart style detection: inherit existing mcp.servers or
      mcp_servers style, with fallback to sensible defaults
    - Add deduplication logic to prevent both styles coexisting
    - Add tests for format preservation and style inheritance
    - Fix unused_mut and nonminimal_bool compiler warnings
    - Apply cargo fmt to all modified files
    
    Benefits:
    - User comments and formatting are no longer lost during sync
    - Respects user's preferred TOML structure (nested vs toplevel)
    - Non-MCP fields in config.toml remain untouched
    - Minimal surprise principle: only modifies necessary sections
    
    Testing:
    - All 47 tests passing (unit + integration)
    - Clippy clean (0 warnings, 0 errors)
    - Release build successful
    - New tests verify comment preservation and style detection
  • refactor(backend): phase 1 - unified error handling with thiserror
    Introduce AppError enum to replace Result<T, String> pattern across
    the codebase, improving error context preservation and type safety.
    
    ## Changes
    
    ### Core Infrastructure
    - Add src/error.rs with AppError enum using thiserror
    - Add thiserror dependency to Cargo.toml
    - Implement helper functions: io(), json(), toml() for ergonomic error creation
    - Implement From<PoisonError> for automatic lock error conversion
    - Implement From<AppError> for String to maintain Tauri command compatibility
    
    ### Module Migrations (60% complete)
    - config.rs: Full migration to AppError
      - read_json_file, write_json_file, atomic_write
      - archive_file, copy_file, delete_file
    - claude_mcp.rs: Full migration to AppError
      - get_mcp_status, read_mcp_json, upsert_mcp_server
      - delete_mcp_server, validate_command_in_path
      - set_mcp_servers_map
    - codex_config.rs: Full migration to AppError
      - write_codex_live_atomic with rollback support
      - read_and_validate_codex_config_text
      - validate_config_toml
    - app_config.rs: Partial migration
      - MultiAppConfig::load, MultiAppConfig::save
    - store.rs: Partial migration
      - AppState::save now returns Result<(), AppError>
    - commands.rs: Minimal changes
      - Use .map_err(Into::into) for compatibility
    - mcp.rs: Minimal changes
      - sync_enabled_to_claude uses Into::into conversion
    
    ### Documentation
    - Add docs/BACKEND_REFACTOR_PLAN.md with detailed refactoring roadmap
    
    ## Benefits
    - Type-safe error handling with preserved error chains
    - Better error messages with file paths and context
    - Reduced boilerplate code (118 Result<T, String> instances to migrate)
    - Automatic error conversion for seamless integration
    
    ## Testing
    - All existing tests pass (4/4)
    - Compilation successful with no warnings
    - Build time: 0.61s (no performance regression)
    
    ## Remaining Work
    - claude_plugin.rs (7 functions)
    - migration.rs, import_export.rs
    - Add unit tests for error.rs
    - Complete commands.rs migration after dependent modules
    
    Co-authored-by: Claude <claude@anthropic.com>
  • feat: add provider usage query with JavaScript scripting support (#101)
    * feat: add provider usage query functionality
    
    - Updated `Cargo.toml` to include `regex` and `rquickjs` dependencies for usage script execution.
    - Implemented `query_provider_usage` command in `commands.rs` to handle usage queries.
    - Created `UsageScript` and `UsageData` structs in `provider.rs` for managing usage script configurations and results.
    - Added `execute_usage_script` function in `usage_script.rs` to run user-defined scripts for querying usage.
    - Enhanced `ProviderList` component to include a button for configuring usage scripts and a modal for editing scripts.
    - Introduced `UsageFooter` component to display usage information and status.
    - Added `UsageScriptModal` for editing and testing usage scripts with preset templates.
    - Updated Tauri API to support querying provider usage.
    - Modified types in `types.ts` to include structures for usage scripts and results.
    
    * feat(usage): support multi-plan usage display for providers
    
    - 【Feature】
      - Update `UsageResult` to support an array of `UsageData` for displaying multiple usage plans per provider.
      - Refactor `query_provider_usage` command to parse both single `UsageData` objects (for backward compatibility) and arrays of `UsageData`.
      - Enhance `usage_script` validation to accept either a single usage object or an array of usage objects.
    - 【Frontend】
      - Redesign `UsageFooter` to iterate and display details for all available usage plans, introducing `UsagePlanItem` for individual plan rendering.
      - Improve usage display with color-coded remaining balance and clear plan information.
      - Update `UsageScriptModal` test notification to summarize all returned plans.
      - Remove redundant `isCurrent` prop from `UsageFooter` in `ProviderList`.
    - 【Build】
      - Change frontend development server port from `3000` to `3005` in `tauri.conf.json` and `vite.config.mts`.
    
    * feat(usage): enhance query flexibility and display
    - 【`src/types.ts`, `src-tauri/src/provider.rs`】Make `UsageData` fields optional and introduce `extra` and `invalidMessage` for more flexible reporting.
      - `expiresAt` replaced by generic `extra` field.
      - `isValid`, `remaining`, `unit` are now optional.
      - Added `invalidMessage` to provide specific reasons for invalid status.
    - 【`src-tauri/src/usage_script.rs`】Relax usage script result validation to accommodate optional fields in `UsageData`.
    - 【`src/components/UsageFooter.tsx`】Update UI to display `extra` field and `invalidMessage`, and conditionally render `remaining` and `unit` based on availability.
    - 【`src/components/UsageScriptModal.tsx`】
      - Add a new `NewAPI` preset template demonstrating advanced extractor logic for complex API responses.
      - Update script instructions to reflect optional fields and new variable syntax (`{{apiKey}}`).
      - Remove old "DeepSeek" and "OpenAI" templates.
      - Remove basic syntax check for `return` statement.
    - 【`.vscode/settings.json`】Add `dish-ai-commit.base.language` setting.
    - 【`src-tauri/src/commands.rs`】Adjust usage logging to handle optional `remaining` and `unit` fields.
    
    * chore(config): remove VS Code settings from version control
    
    - delete .vscode/settings.json to remove editor-specific configurations
    - add /.vscode to .gitignore to prevent tracking of local VS Code settings
    - ensure personalized editor preferences are not committed to the repository
    
    * fix(provider): preserve usage script during provider update
    
    - When updating a provider, the `usage_script` configuration within `ProviderMeta` was not explicitly merged.
    - This could lead to the accidental loss of `usage_script` settings if the incoming `provider` object in the update request did not contain this field.
    - Ensure `usage_script` is cloned from the existing provider's meta when merging `ProviderMeta` during an update.
    
    * refactor(provider): enforce base_url for usage scripts and update dev ports
    - 【Backend】
        - `src-tauri/src/commands.rs`: Made `ANTHROPIC_BASE_URL` a required field for Claude providers and `base_url` a required field in `config.toml` for Codex providers when extracting credentials for usage script execution. This improves error handling by explicitly failing if these critical URLs are missing or malformed.
    - 【Frontend】
        - `src/App.tsx`, `src/components/ProviderList.tsx`: Passed `appType` prop to `ProviderList` component to ensure `updateProvider` calls within `handleSaveUsageScript` correctly identify the application type.
    - 【Config】
        - `src-tauri/tauri.conf.json`, `vite.config.mts`: Updated development server ports from `3005` to `3000` to standardize local development environment.
    
    * refactor(usage): improve usage data fetching logic
    
    - Prevent redundant API calls by tracking last fetched parameters in `useEffect`.
    - Avoid concurrent API requests by adding a guard in `fetchUsage`.
    - Clear usage data and last fetch parameters when usage query is disabled.
    - Add `queryProviderUsage` API declaration to `window.api` interface.
    
    * fix(usage-script): ensure usage script updates and improve reactivity
    
    - correctly update `usage_script` from new provider meta during updates
    - replace full page reload with targeted provider data refresh after saving usage script settings
    - trigger usage data fetch or clear when `usageEnabled` status changes in `UsageFooter`
    - reduce logging verbosity for usage script execution in backend commands and script execution
    
    * style(usage-footer): adjust usage plan item layout
    
    - Decrease width of extra field column from 35% to 30%
    - Increase width of usage information column from 40% to 45%
    - Improve visual balance and readability of usage plan items
  • chore: bump version to v3.5.0 and update roadmap
    Version Changes:
    - Update version to 3.5.0 in package.json, Cargo.toml, and tauri.conf.json
    
    Changelog Updates:
    - Add v3.5.0 release notes with comprehensive feature list
    - Document MCP management system implementation
    - Document configuration import/export functionality
    - Document endpoint speed testing feature
    - List all improvements, bug fixes, and technical enhancements
    
    Roadmap Updates:
    - Mark MCP manager as completed 
    - Mark i18n (internationalization) as completed 
    - Add new planned features: memory management, cloud sync
    - Reorganize feature priorities
  • feat: Implement Speed Test Function
    * feat: add unified endpoint speed test for API providers
    
    Add a comprehensive endpoint latency testing system that allows users to:
    - Test multiple API endpoints concurrently
    - Auto-select the fastest endpoint based on latency
    - Add/remove custom endpoints dynamically
    - View latency results with color-coded indicators
    
    Backend (Rust):
    - Implement parallel HTTP HEAD requests with configurable timeout
    - Handle various error scenarios (timeout, connection failure, invalid URL)
    - Return structured latency data with status codes
    
    Frontend (React):
    - Create interactive speed test UI component with auto-sort by latency
    - Support endpoint management (add/remove custom endpoints)
    - Extract and update Codex base_url from TOML configuration
    - Integrate with provider presets for default endpoint candidates
    
    This feature improves user experience when selecting optimal API endpoints,
    especially useful for users with multiple provider options or proxy setups.
    
    * refactor: convert endpoint speed test to modal dialog
    
    - Transform EndpointSpeedTest component into a modal dialog
    - Add "Advanced" button next to base URL input to open modal
    - Support ESC key and backdrop click to close modal
    - Apply Linear design principles: minimal styling, clean layout
    - Remove unused showBaseUrlInput variable
    - Implement same modal pattern for both Claude and Codex
    
    * fix: prevent modal cascade closing when ESC is pressed
    
    - Add state checks to prevent parent modal from closing when child modals (endpoint speed test or template wizard) are open
    - Update ESC key handler dependencies to track all modal states
    - Ensures only the topmost modal responds to ESC key
    
    * refactor: unify speed test panel UI with project design system
    
    UI improvements:
    - Update modal border radius from rounded-lg to rounded-xl
    - Unify header padding from px-6 py-4 to p-6
    - Change speed test button color to blue theme (bg-blue-500) for consistency
    - Update footer background from bg-gray-50 to bg-gray-100
    - Style "Done" button as primary action button with blue theme
    - Adjust footer button spacing and hover states
    
    Simplify endpoint display:
    - Remove endpoint labels (e.g., "Current Address", "Custom 1")
    - Display only URL for cleaner interface
    - Clean up all label-related logic:
      * Remove label field from EndpointCandidate interface
      * Remove label generation in buildInitialEntries function
      * Remove label handling in useEffect merge logic
      * Remove label generation in handleAddEndpoint
      * Remove label parameters from claudeSpeedTestEndpoints
      * Remove label parameters from codexSpeedTestEndpoints
    
    * refactor: improve endpoint list UI consistency
    
    - Show delete button for all endpoints on hover for uniform UI
    - Change selected state to use blue theme matching main interface:
      * Blue border (border-blue-500) for selected items
      * Light blue background (bg-blue-50/dark:bg-blue-900/20)
      * Blue indicator dot (bg-blue-500/dark:bg-blue-400)
    - Switch from compact list (space-y-px) to card-based layout (space-y-2)
    - Add rounded corners to each endpoint item for better visual separation
    
    * feat: persist custom endpoints to settings.json
    
    - Extend AppSettings to store custom endpoints for Claude and Codex
    - Add Tauri commands: get/add/remove/update custom endpoints
    - Update frontend API with endpoint persistence methods
    - Modify EndpointSpeedTest to load/save custom endpoints via API
    - Track endpoint last used time for future sorting/cleanup
    - Store endpoints per app type in settings.json instead of localStorage
    
    * - feat(types): add Provider.meta and ProviderMeta (snake_case) with custom_endpoints map
    
    - feat(provider-form): persist custom endpoints on provider create by merging EndpointSpeedTest’s custom URLs into meta.custom_endpoints on submit
    
    - feat(endpoint-speed-test): add onCustomEndpointsChange callback emitting normalized custom URLs; wire it for both Claude/Codex modals
    
    - fix(api): send alias param names (app/appType/app_type and provider_id/providerId) in Tauri invokes to avoid “missing providerId” with older backends
    
    - storage: custom endpoints are stored in ~/.cc-switch/config.json under providers[<id>].meta.custom_endpoints (not in settings.json)
    
    - behavior: edit flow remains immediate writes; create flow now writes once via addProvider, removing the providerId dependency during creation
    
    * feat: add endpoint candidates support and code formatting improvements
    
    - Add endpointCandidates field to ProviderPreset and CodexProviderPreset interfaces
    - Integrate preset endpoint candidates into speed test endpoint selection
    - Add multiple endpoint options for PackyCode providers (Claude & Codex)
    - Apply consistent code formatting (trailing commas, line breaks)
    - Improve template value type safety and readability
    
    * refactor: improve endpoint management button UX
    
    Replace ambiguous "Advanced" text with intuitive "Manage & Test" label accompanied by Zap icon, making the endpoint management panel entry point more discoverable and self-explanatory for both Claude and Codex configurations.
    
    * - merge: merge origin/main, resolve conflicts and preserve both feature sets
    - feat(tauri): register import/export and file dialogs; keep endpoint speed test and custom endpoints
    - feat(api): add updateTrayMenu and onProviderSwitched; wire import/export APIs
    - feat(types): extend global API declarations (import/export)
    - chore(presets): GLM preset supports both new and legacy model keys
    - chore(rust): add chrono dependency; refresh lockfile
    
    ---------
    
    Co-authored-by: Jason <farion1231@gmail.com>
  • add: local config import and export (#84)
    * add: local config import and export
    
    * Fix import refresh flow and typings
    
    * Clarify import refresh messaging
    
    * Limit stored import backups
    
    ---------
    
    Co-authored-by: Jason <farion1231@gmail.com>
  • chore: bump version to 3.4.0
    - Add i18next internationalization with Chinese/English support
    - Add Claude plugin sync alongside VS Code integration
    - Extend provider presets with new models (DeepSeek-V3.2-Exp, Qwen3-Max, GLM-4.6)
    - Support portable mode and single instance enforcement
    - Add tray minimize and macOS Dock visibility management
    - Improve Settings UI with scrollable layout and save icon
    - Fix layout shifts and provider toggle consistency
    - Remove unnecessary OpenAI auth requirement
    - Update Windows MSI installer to target per-user LocalAppData
  • release: bump version to v3.3.1
    Add support for DeepSeek-V3.1-Terminus model with emergency hotfix release
  • release: bump version to 3.3.0
    Update version across all package files and add comprehensive changelog for v3.3.0 release featuring VS Code integration, shared config snippets, enhanced Codex wizard, and cross-platform improvements.
  • feat: add config directory override support for WSL
    - Add persistent app settings with custom Claude Code and Codex config directories
    - Add config directory override UI in settings modal with manual input, browse, and reset options
    - Integrate tauri-plugin-dialog for native directory picker
    - Support WSL and other special environments where config paths need manual specification
    
    Changes:
    - settings.rs: Implement settings load/save and directory override logic
    - SettingsModal: Add config directory override UI components
    - API: Add get_config_dir and pick_directory commands
  • feat: add common config snippet management system
    - Add settings module for managing common configuration snippets
    - Implement UI for creating, editing, and deleting snippets
    - Add tauri-plugin-fs for file operations
    - Replace co-authored setting with flexible snippet system
    - Enable users to define custom config snippets for frequently used settings
  • feat(updater): 优化更新体验与 UI
    - ui: UpdateBadge 使用 Tailwind 内置过渡,支持点击打开设置,保留图标动画
    
    - updater: 新增 UpdateContext 首启延迟检查,忽略版本键名命名空间化(含旧键迁移),并发保护
    
    - settings: 去除版本硬编码回退;检测到更新时复用 updateHandle 下载并安装,并新增常显“更新日志”入口
    
    - a11y: 更新徽标支持键盘触达(Enter/Space)
    
    - refactor: 移除未使用的 runUpdateFlow 导出
    
    - chore: 类型检查通过,整体行为与权限边界未改变
  • feat(updater): 集成 Rust 侧 Updater/Process 插件与权限配置
    - Cargo 依赖:tauri-plugin-updater、tauri-plugin-process
    - 插件注册:process 顶层 init,updater 于 setup 中注册
    - 权限配置:capabilities 增加 updater:default、process:allow-restart
    - 配置:tauri.conf.json 启用 createUpdaterArtifacts 与 updater 占位(pubkey/endpoints)
  • security(tauri): remove unused shell plugin and capability
    - Remove tauri-plugin-shell from Cargo.toml
    - Drop tauri_plugin_shell::init() from src-tauri/src/lib.rs
    - Delete "shell:allow-open" from src-tauri/capabilities/default.json
    - No runtime behavior change; opener plugin still handles links/paths
    - Motivation: reduce permissions surface and slightly shrink bundle
  • chore: prepare v3.0.0 release
    - Bump version to 3.0.0 across all files
    - Update Cargo.toml with proper package metadata
    - Rename crate from 'app' to 'cc-switch'
    - Use Rust edition 2024 with minimum rust-version 1.85.0
    - Update library name to cc_switch_lib
  • feat(macos): implement transparent titlebar with custom background color
    - Add transparent titlebar configuration in tauri.conf.json
    - Implement macOS titlebar background color matching main UI banner (#3498db)
    - Replace deprecated cocoa crate with modern objc2-app-kit
    - Preserve native window functionality (drag, traffic lights)
    - Remove all deprecation warnings from build process
    
    The titlebar now seamlessly matches the application's blue theme while
    maintaining all native macOS window management features.
  • chore(tauri): remove dead code warnings and drop unused uuid dep
    - Delete unused Provider::new, ProviderManager::get_current_provider
    - Delete unused AppState::reload
    - Remove uuid crate and related imports
    - Keep functionality unchanged; frontend uses ID string for current provider
  • feat: upgrade Rust code to full Tauri 2.0 compatibility
    - Add tauri-plugin-shell and tauri-plugin-opener dependencies
    - Update permissions configuration to support shell and opener operations
    - Refactor open_config_folder and open_external commands to use secure plugin APIs
    - Remove unsafe direct std::process::Command usage
    - Initialize necessary Tauri plugins
    - Ensure all external operations comply with Tauri 2.0 security standards
  • fix: 修复 Rust 编译错误并成功启动 Tauri 应用
    - 修复 commands.rs 中的重复导入问题
    - 清理未使用的导入
    - 统一 Vite 和 Tauri 配置的端口为 3000
    - 添加 Tauri 前端依赖包
    - 应用已成功编译并运行