Commit Graph

10 Commits

Author SHA1 Message Date
83e9793dce feat: add chat history import and export functionality
Implemented full chat history import/export with JSON format:
- Export button saves current conversation to JSON file
- Import button loads conversation from JSON file
- File dialog integration using tauri-plugin-dialog
- Message count feedback on successful import
- Automatic history reload after import
- Preserves all message data including swipes and timestamps
- Smart error handling (ignores cancelled dialogs)

Backend (Rust):
- export_chat_history: Opens save dialog, writes JSON to selected path
- import_chat_history: Opens file picker, parses JSON, saves to current character
- Message migration for backward compatibility
- Returns helpful feedback (file path on export, message count on import)

Frontend (JavaScript):
- Export/import buttons in header with up/down arrow icons
- Status updates during operations
- Auto-reload chat view after import
- Error handling with user-friendly messages

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 18:03:34 -07:00
4694114ff9 feat: add message timestamps with smart formatting
- Added timestamp field to Message struct in Rust backend
- Timestamps automatically captured on message creation
- Smart relative time formatting (Just now, Xm ago, time, date)
- Timestamps display below message content with subtle styling
- Fixed avatar squishing issue with flex-shrink: 0
- Backward compatible with existing messages via serde(default)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 12:07:19 -07:00
0712b1c422 feat: expand character editor to show all v2/v3 character card fields
Added support for all v2/v3 character card fields in the character editor UI:
- Description (10-row textarea)
- Scenario
- Message Example
- Post-History Instructions
- Alternate Greetings (one per line)
- Tags (comma-separated)
- Creator
- Character Version
- Creator Notes

Updated frontend to load and save all fields, and backend update_character
command to accept all new parameters. This allows imported v3 character cards
to display their full details, especially the description field which contains
the main character information.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 08:42:29 -07:00
62a0e387d2 fix: implement manual PNG chunk parser for reliable character card import
- Added read_png_text_chunks() function that manually parses PNG file structure
- Reads PNG chunks directly instead of relying on png crate's Info struct
- More reliable extraction of tEXt chunks with "chara" keyword
- Added debug logging (eprintln) to help diagnose import issues
- Updated read_character_card_from_png() to use manual parser as primary method
- Fixes "missing 'chara' chunk" error even when chunk exists in file
- Successfully imports both v2 and v3 character cards
2025-10-14 08:37:17 -07:00
56b9c0b266 feat: add v3 character card support
- Added CharacterCardV3 struct to handle v3 format
- Created From<CharacterCardV3> for CharacterCardV2Data conversion
- Updated read_character_card_from_png() to detect and parse both v2 and v3 specs
- V3 cards have top-level fields + nested data object
- Maintains full backward compatibility with v2 cards
- Export still uses v2 format for maximum compatibility
2025-10-14 08:24:58 -07:00
f31e3fb28a feat: add v2 character card import/export
- Expanded Character struct with all v2 spec fields (description, scenario, mes_example, post_history_instructions, alternate_greetings, character_book, tags, creator, character_version, creator_notes, extensions)
- Created CharacterCardV2 serialization structs following spec at github.com/malfoyslastname/character-card-spec-v2
- Implemented PNG metadata utilities:
  * read_character_card_from_png() - extracts and decodes character data from PNG tEXt chunks
  * write_character_card_to_png() - embeds character data into PNG files
  * create_placeholder_png() - generates gradient placeholder images for avatarless characters
- Added Tauri commands:
  * import_character_card - opens file picker, imports PNG with automatic name conflict handling
  * export_character_card - exports character as v2 PNG card with embedded metadata
- Added Import/Export buttons to character settings UI
- Full backward compatibility with existing characters using serde defaults
- Added dependencies: png 0.17, base64 0.21, image 0.24
2025-10-14 08:19:57 -07:00
f82ec6f6a8 feat: add swipe functionality for multiple response alternatives
- Added swipe system to Message struct with backward compatibility
- Implemented swipe navigation UI with left/right arrows and counter
- Added generate_response_only and generate_response_stream commands
- Swipes persist properly when navigating between alternatives
- Updated message rendering to support swipe controls
2025-10-13 22:29:58 -07:00
90bbeb4468 feat: add character avatars with upload and zoom functionality
- Add avatar upload with file picker dialog
- Display avatars in header, chat messages, and settings
- Implement clickable avatars with full-screen zoom modal
- Enable asset protocol for local file access in Tauri config
- Add tauri-plugin-dialog for native file selection
- Store avatars in ~/.config/claudia/avatars/
- Support PNG, JPG, JPEG, and WEBP formats
- Modal closes on overlay click or ESC key
2025-10-13 18:49:34 -07:00
6a8f1e0996 feat: add streaming responses with optional toggle
- Add server-sent events (SSE) streaming support for real-time token display
- Implement progressive markdown rendering during streaming
- Add stream toggle in API settings (defaults to disabled for compatibility)
- Add visual streaming indicator with pulsing animation
- Graceful fallback to non-streaming mode when disabled
- Fix character saving bug (camelCase parameter naming)

Backend changes:
- New chat_stream command with SSE parsing
- Added futures and bytes dependencies
- Emit chat-token events progressively to frontend
- Support for OpenAI-compatible and Anthropic streaming formats

Frontend changes:
- Dual code paths for streaming/non-streaming
- Real-time markdown and syntax highlighting during streaming
- Stream status indicator with animation
2025-10-12 11:38:40 -07:00
04b490b5b9 feat: initial commit of Claudia v0.1.0 2025-10-11 16:21:11 -07:00