Commit Graph

5 Commits

  • i18n: complete internationalization for settings panel
    - Add missing translation keys for all hint texts and descriptions
    - Remove all hardcoded defaultValue parameters from components
    - Add translations for window behavior, directory settings, and theme settings
    - Add translations for provider-related UI elements
    - Improve consistency across Chinese and English translations
    
    Translation additions:
    - common.toggleTheme
    - settings.windowBehaviorHint, claudeConfigDirDescription, codexConfigDirDescription
    - provider.* (12 new keys)
    - providerForm.* (15 new keys)
    - providerPreset.* (4 new keys)
    
    Modified files: 10
    Lines changed: +132 -74
  • fix: add scrollbars to provider dialogs and simplify theme toggle
    ## Changes
    
    ### Add scrollbars to provider dialogs
    - **AddProviderDialog.tsx**: Add max-h-[90vh], flex flex-col layout, and scrollable content wrapper
    - **EditProviderDialog.tsx**: Add max-h-[90vh], flex flex-col layout, and scrollable content wrapper
    - Both dialogs now follow the same scrolling pattern as other dialogs in the app
    - Wrap ProviderForm in `<div className="flex-1 overflow-y-auto -mx-6 px-6">` for proper scrolling
    
    ### Simplify theme toggle
    - **mode-toggle.tsx**: Change from dropdown menu to direct toggle button
    - Remove DropdownMenu and related imports
    - Click now directly toggles between light and dark mode
    - Simpler UX: one click to switch themes instead of opening a menu
    - Remove "system" theme option from quick toggle (still available in settings if needed)
    
    ## Benefits
    - **Consistent scrolling**: All dialogs now have proper scroll behavior when content exceeds viewport height
    - **Better UX**: Theme toggle is faster and more intuitive with direct click
    - **Code simplification**: Removed unnecessary dropdown menu complexity from theme toggle
    
    All TypeScript type checks and Prettier formatting checks pass.
  • feat: complete stage 4 cleanup and code formatting
    This commit completes stage 4 of the refactoring plan, focusing on cleanup
    and optimization of the modernized codebase.
    
    ## Key Changes
    
    ### Code Cleanup
    - Remove legacy `src/lib/styles.ts` (no longer needed)
    - Remove old modal components (`ImportProgressModal.tsx`, `ProviderList.tsx`)
    - Streamline `src/lib/tauri-api.ts` from 712 lines to 17 lines (-97.6%)
      - Remove global `window.api` pollution
      - Keep only event listeners (`tauriEvents.onProviderSwitched`)
      - All API calls now use modular `@/lib/api/*` layer
    
    ### Type System
    - Clean up `src/vite-env.d.ts` (remove 156 lines of outdated types)
    - Remove obsolete global type declarations
    - All TypeScript checks pass with zero errors
    
    ### Code Formatting
    - Format all source files with Prettier (82 files)
    - Fix formatting issues in 15 files:
      - App.tsx and core components
      - MCP management components
      - Settings module components
      - Provider management components
      - UI components
    
    ### Documentation Updates
    - Update `REFACTORING_CHECKLIST.md` with stage 4 progress
    - Mark completed tasks in `REFACTORING_MASTER_PLAN.md`
    
    ## Impact
    
    **Code Reduction:**
    - Total: -1,753 lines, +384 lines (net -1,369 lines)
    - tauri-api.ts: 712 → 17 lines (-97.6%)
    - Removed styles.ts: -82 lines
    - Removed vite-env.d.ts declarations: -156 lines
    
    **Quality Improvements:**
    -  Zero TypeScript errors
    -  Zero TODO/FIXME comments
    -  100% Prettier compliant
    -  Zero `window.api` references
    -  Fully modular API layer
    
    ## Testing
    - [x] TypeScript compilation passes
    - [x] Code formatting validated
    - [x] No linting errors
    
    Stage 4 completion: 100%
    Ready for stage 5 (testing and bug fixes)