Commit Graph

51 Commits

  • 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
  • feat(mcp): add option to mirror MCP config to other app
    - Add syncOtherSide parameter to upsert_mcp_server_in_config command
    - Implement checkbox UI in McpFormModal for cross-app sync
    - Automatically sync enabled MCP servers to both Claude and Codex when option is checked
    - Add i18n support for sync option labels and hints
  • refactor(mcp): improve data structure with metadata/spec separation
    - Separate MCP server metadata from connection spec for cleaner architecture
    - Add comprehensive server entry fields: name, description, tags, homepage, docs
    - Remove legacy format compatibility logic from extract_server_spec
    - Implement data validation and filtering in get_servers_snapshot_for
    - Add strict id consistency check in upsert_in_config_for
    - Enhance import logic with defensive programming for corrupted data
    - Simplify frontend by removing normalization logic (moved to backend)
    - Improve error messages with contextual information
    - Add comprehensive i18n support for new metadata fields
  • fix: align Tauri arg names and improve export UX
    - Match frontend camelCase keys to backend snake_case params
    - Show error toast when save dialog is cancelled
  • feat(provider): use live config for edit and backfill SSOT after switch
    - Edit modal (Claude+Codex): when editing the current provider, initialize form from live files (Claude: ~/.claude/settings.json; Codex: ~/.codex/auth.json + ~/.codex/config.toml) instead of SSOT.
    - Switch (Claude): after writing live settings.json for the target provider, read it back and update the provider’s SSOT to match live.
    - Switch (Codex): keep MCP sync to config.toml, then read back TOML and update the target provider’s SSOT (preserves mcp.servers/mcp_servers schema).
    - Add Tauri command read_live_provider_settings for both apps, register handler, and expose window.api.getLiveProviderSettings.
    - Types updated accordingly; cargo check and pnpm typecheck pass.
  • feat(mcp): import Codex MCP from ~/.codex/config.toml
    - Support both TOML schemas: [mcp.servers.<id>] and [mcp_servers.<id>]
    - Non-destructive merge of imported servers (enabled=true only)
    - Preserve existing TOML schema when syncing (prefer mcp_servers)
    - Remove both mcp and mcp_servers when no enabled items
    
    feat(ui): auto-import Codex MCP on panel init (app=codex)
    
    chore(tauri): add import_mcp_from_codex command and register
    
    chore(types): expose window.api.importMcpFromCodex and typings
    
    fix(ui): remove unused variable for typecheck
  • feat(mcp): app-aware MCP panel and Codex MCP sync to config.toml
    - Make MCP panel app-aware; pass appType from App and call APIs with current app
    - Show active app in title: “MCP Management · Claude Code/Codex”
    - Add sync_enabled_to_codex: project enabled servers from SSOT to ~/.codex/config.toml as [mcp.servers.*]
    - Sync on enable/disable, delete, and provider switch (post live write)
    - Add Tauri command sync_enabled_mcp_to_codex and expose window.api.syncEnabledMcpToCodex()
    - Fix Rust borrow scopes in switch_provider to avoid E0502
    - Add TS declarations for new Codex sync API
  • refactor(mcp): improve UI consistency and i18n
    - Add MCP-specific green button style (buttonStyles.mcp)
    - Unify MCP panel and form buttons with emerald theme
    - Adjust MCP entry button width to match AppSwitcher (px-3)
    - Reduce JSON editor height from h-64 to h-48
    - Update translations: "Add/Edit Server" → "Add/Edit MCP"
    - Change form label to "MCP Title (Unique)" for clarity
    - Move config wizard button to right side of JSON label
    - Fix McpListItem enabled state check (explicit true check)
  • fix(mcp): remove SSE support; keep stdio default when type is omitted
    - Backend: reject "sse" in validators; accept missing type as stdio; require url only for http (mcp.rs, claude_mcp.rs)
    - Frontend: McpServer.type narrowed to "stdio" | "http" (optional) (src/types.ts)
    - UI: avoid undefined in list item details (McpListItem)
    - Claude-only sync after delete to update ~/.claude.json (commands.rs)
    
    Notes:
    - Ran typecheck and cargo check: both pass
    - Clippy shows advisory warnings unrelated to this change
    - Prettier check warns on a few files; limited scope changes kept minimal
  • feat(mcp): use project config as SSOT and sync enabled servers to ~/.claude.json
    - Add McpConfig to MultiAppConfig and persist MCP servers in ~/.cc-switch/config.json
    - Add Tauri commands: get_mcp_config, upsert_mcp_server_in_config, delete_mcp_server_in_config, set_mcp_enabled, sync_enabled_mcp_to_claude, import_mcp_from_claude
    - Only write enabled MCPs to ~/.claude.json (mcpServers) and strip UI-only fields (enabled/source)
    - Frontend: update API wrappers and MCP panel to read/write via config.json; seed presets on first open; import from ~/.claude.json
    - Fix warnings (remove unused mut, dead code)
    - Verified with cargo check and pnpm typecheck
  • refactor(mcp): redesign MCP management panel UI
    - Redesign MCP panel to match main interface style
    - Add toggle switch for each MCP server to enable/disable
    - Use emerald theme color consistent with MCP button
    - Create card-based layout with one MCP per row
    - Add dedicated form modal for add/edit operations
    - Implement proper empty state with friendly prompts
    - Add comprehensive i18n support (zh/en)
    - Extend McpServer type to support enabled field
    - Backend already supports enabled field via serde_json::Value
    
    Components:
    - McpPanel: Main panel container with header and list
    - McpListItem: Card-based list item with toggle and actions
    - McpFormModal: Independent modal for add/edit forms
    - McpToggle: Emerald-themed toggle switch component
    
    All changes passed TypeScript type checking and production build.
  • refactor(mcp): switch to user-level config ~/.claude.json and remove project-level logic
    - Read/write ~/.claude.json (preserve unknown fields) for mcpServers
    - Remove settings.local.json and mcp.json handling
    - Drop enableAllProjectMcpServers command and UI toggle
    - Update types, Tauri APIs, and MCP panel to reflect new status fields
    - Keep atomic write and command validation behaviors
  • feat(mcp): add front-end API wrappers and types
    - Add McpServer and McpStatus types
    - Add window.api wrappers for MCP commands
    - Extend vite-env.d.ts global typings for MCP APIs
  • refactor: improve error handling and code formatting
    - Enhanced error messages in Rust backend to include file paths
    - Improved provider switching error handling with detailed messages
    - Added MCP button placeholder in UI (functionality TODO)
    - Applied code formatting across frontend components
    - Extended error notification duration to 6s for better readability
  • fix(frontend): align Tauri invoke param names to backend (snake_case)
    - pick_directory: pass `default_path` instead of `defaultPath` (src/lib/tauri-api.ts:156)
    - export_config_to_file/import_config_from_file: pass `file_path` instead of `filePath` (src/lib/tauri-api.ts:394, 408)
    - save_file_dialog: pass `default_name` instead of `defaultName` (src/lib/tauri-api.ts:418)
    
    - reason: Tauri commands match params by exact name; camelCase caused missing args and runtime failures in directory picker, import/export, and save dialog
    - verify: pnpm typecheck OK; cargo check OK; command signatures confirmed (pick_directory at src-tauri/src/commands.rs:584, export/import/save dialog at src-tauri/src/import_export.rs:84, 102, 140)
    - follow-ups: run `pnpm format`; consider Clippy cleanups; short-circuit same provider switch
  • 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>
  • fix: eliminate layout shift when switching between Claude and Codex
    - Wrap VS Code sync button in fixed-width container to maintain stable layout
    - Only render the container in Codex mode to avoid unnecessary space in Claude mode
    - Change card transition from 'all' to specific properties (border-color, box-shadow) to prevent layout animations
    - These changes prevent the horizontal position jumping of provider cards during app switching
  • feat: support minimizing window to tray on close (#41)
    fix: grant set_skip_taskbar permission through default capability
    
    chore: align settings casing and defaults between Rust and frontend
    
    Co-authored-by: Jason <farion1231@gmail.com>
  • feat: add portable mode support and improve update handling
    - Add portable.ini marker file creation in GitHub Actions for portable builds
    - Implement is_portable_mode() command to detect portable execution
    - Redirect portable users to GitHub releases page for manual updates
    - Change update URL to point to latest releases page
    - Integrate portable mode detection in Settings UI
  • 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
  • - fix(linux): disable modal backdrop blur on Linux (WebKitGTK/Wayland) to prevent freeze when opening Add Provider panel
    - refactor(ui): add runtime platform detector and conditionally apply blur only on non-Linux platforms
    - chore: verify typecheck and renderer build succeed; no functional regression expected
  • - refactor(utils): extract Codex base_url parsing into shared helpers
    - refactor(ProviderList): use shared base_url helpers
    - refactor(App): reuse shared base_url helpers for VS Code sync
    - fix(auto-sync): global shared VS Code auto-apply state (localStorage + event broadcast)
    - feat(tray): auto-apply to VS Code on Codex provider-switched when enabled
    - behavior: manual Apply enables auto-sync; manual Remove disables; official providers clear managed keys only
    - chore(typecheck): pass pnpm typecheck
  • fix: prevent layout shift when switching providers
    - Keep 'Current' badge always rendered with invisible class when not active
    - Keep 'Apply to VS Code' button always rendered with invisible class when not active
    - Use consistent border width (1px) for both selected and unselected cards
    - Remove ring utility that was causing extra space outside elements
    
    This ensures all provider cards maintain the same height regardless of selection state
  • - feat(codex): Add “Apply to VS Code/Remove from VS Code” button on current Codex provider card
    - feat(tauri): Add commands to read/write VS Code settings.json with cross-variant detection (Code/Insiders/VSCodium/OSS)
    - fix(vscode): Use top-level keys “chatgpt.apiBase” and “chatgpt.config.preferred_auth_method”
    - fix(vscode): Handle empty settings.json (skip deletes, direct write) to avoid “Can not delete in empty document”
    - fix(windows): Make atomic writes robust by removing target before rename
    - ui(provider-list): Improve error surfacing when applying/removing
    - chore(types): Extend window.api typings and tauri-api wrappers for VS Code commands
    - deps: Add jsonc-parser
  • 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
  • refactor(settings): rename Dock setting to system tray (showInDock → showInTray)
    - compat: map legacy showInDock to showInTray when loading settings
    - ui(copy): clarify “system tray (menu bar)” vs Dock in SettingsModal
    - tauri(settings): return showInTray in get_settings; adjust default fallback
    - docs(comment): align comments to “system tray” terminology across code
    - note: no functional change yet; tray visibility toggle remains unimplemented
  • feat(updater): 优化更新体验与 UI
    - ui: UpdateBadge 使用 Tailwind 内置过渡,支持点击打开设置,保留图标动画
    
    - updater: 新增 UpdateContext 首启延迟检查,忽略版本键名命名空间化(含旧键迁移),并发保护
    
    - settings: 去除版本硬编码回退;检测到更新时复用 updateHandle 下载并安装,并新增常显“更新日志”入口
    
    - a11y: 更新徽标支持键盘触达(Enter/Space)
    
    - refactor: 移除未使用的 runUpdateFlow 导出
    
    - chore: 类型检查通过,整体行为与权限边界未改变
  • 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/