Skip to content

Conversation

@sanggggg
Copy link
Collaborator

@sanggggg sanggggg commented Dec 2, 2025

Summary

Adds a GUI interface for importing chat sessions from preset provider directories (Claude, Gemini, Codex), complementing the existing file-based import functionality. Users can now click the Import button to choose between manual file selection or importing from configured provider directories.

Changes

Backend (Tauri/Rust)

  • New Tauri Command: import_from_provider for batch importing from preset providers
    • Accepts provider names: all, claude, gemini, codex
    • Returns detailed import statistics (files, sessions, messages, errors)
  • ImportStats Struct: Clean parameter management (fixes clippy too-many-arguments warning)
  • Integration: Uses existing ImportService and provider configuration system
  • Architecture: Follows established patterns with proper error handling and logging

Frontend (React)

  • Import Method Dialog: Modal for choosing import method on button click
    • Option 1: Import from Files (existing file picker functionality)
    • Option 2: Import from Preset (new provider directory import)
  • Provider Selection UI:
    • "All Providers" option for importing from all configured directories
    • Individual provider cards: Claude (/.claude), Gemini (/.gemini), Codex (custom)
    • Hover effects and intuitive icons
  • User Experience:
    • Toast notifications for progress and results
    • Auto-refresh session list after import
    • Detailed error messages
    • Keyboard shortcut support (⌘O)

Technical Details

Code Quality

  • ✓ Passes cargo clippy -- -D warnings
  • ✓ Passes pnpm biome:check
  • ✓ Properly formatted with cargo fmt and biome format
  • ✓ Follows project architecture (Service layer pattern)

File Changes

  • src-tauri/src/commands/file.rs (+203 lines): New command and helper function
  • src-tauri/src/lib.rs (+1 line): Register new command
  • ui-react/src/components/session-manager.tsx (+175 lines): Dialog and UI
  • Minor formatting fixes in session.rs and dto.rs

Testing Checklist

  • Click Import → Choose "Import from Files" → Works as before
  • Click Import → Choose "All Providers" → Imports from all directories
  • Click Import → Choose "Claude" → Imports from ~/.claude/projects
  • Click Import → Choose "Gemini" → Imports from ~/.gemini/tmp
  • Click Import → Choose "Codex" → Shows appropriate message
  • Verify toast notifications show correct stats
  • Verify session list refreshes after import
  • Test with no files in provider directories
  • Test with non-existent provider directories

Related Work

This feature brings the CLI preset import functionality (cargo run -- sync claude, etc.) to the GUI, making it more accessible to users who prefer graphical interfaces.


Generated with Claude Code

Co-Authored-By: Claude [email protected]

sanggggg and others added 7 commits December 2, 2025 22:17
Add graphical interface for importing chat sessions from preset provider
directories, complementing existing file-based import functionality.

Backend changes:
- Add import_from_provider Tauri command supporting all/claude/gemini/codex
- Implement ImportStats struct for cleaner parameter management
- Integrate with existing ImportService and provider configs
- Support batch importing from multiple provider directories

Frontend changes:
- Add import method selection dialog with file and preset options
- Create provider selection UI with All/Claude/Gemini/Codex cards
- Add toast notifications for import progress and results
- Auto-refresh session list after successful imports

Technical notes:
- Passes cargo clippy -- -D warnings
- Passes pnpm biome:check
- Follows existing architecture patterns

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Improvements based on code review:

1. Concurrency Control:
   - Add isImporting state to prevent concurrent imports
   - Show warning toast if import attempted while one is in progress
   - Disable all import buttons during import operation

2. Enhanced Error Messages:
   - Show detailed error information for failed imports
   - Display first 3 failed files with their error messages
   - Add "+N more" indicator if more than 3 failures

3. Accessibility:
   - Add descriptive ARIA labels to all import buttons
   - Labels describe what each button does for screen readers
   - Include provider directory paths in labels

4. User Experience:
   - Buttons visually disabled during import (opacity + cursor)
   - Better error context for debugging issues
   - More informative toast notifications

Technical notes:
- Passes pnpm biome:check
- All functionality tested and verified

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Remove verbose error details from toast notifications.
Now shows: 'Imported 5/10 files (50 sessions, 200 messages)'
instead of listing individual file errors.

Error details are still logged to console for debugging.
Remove slide and zoom animations from dialog.
Now uses simple opacity fade for cleaner appearance.

Before: Dialog slid in from top-left with zoom
After: Dialog fades in at center position
Keep the standard shadcn Dialog component with original animations.
The default behavior works well for most use cases.
Remove slide and zoom animations from Dialog component.
Now uses simple opacity fade for cleaner UX.

Changes:
- Removed slide-in/out animations
- Removed zoom-in/out effects
- Kept fade-in/out for smooth transitions
Increase animation duration from 200ms to 300ms.
Makes the fade transition smoother and less jarring.
@sanggggg sanggggg merged commit 7fec611 into main Dec 2, 2025
5 checks passed
@sanggggg sanggggg deleted the feature/preset-import-gui branch December 2, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants