summaryrefslogtreecommitdiff
path: root/internal/gui/app.go
AgeCommit message (Collapse)Author
2026-03-08test(task-374): fix errcheck issues in tests and support codePaul Buetow
2026-03-08fix: complete code-quality task queue (373-378)Paul Buetow
2026-01-21Fix: Auto-play only regenerated audio (front or back, not both) for bg-bg cardsv0.8.0Paul Buetow
- Removed duplicate fyne.KeyA handler that was triggering both front and back audio - Added SetAudioFileNoAutoPlay() method for controlled playback - Front audio (a key) now auto-plays only front audio - Back audio (A key) now auto-plays only back audio - Refactored startPlayback to use startPlaybackForFile for better control - Fixed icon reset when playback finishes for each audio type separately
2026-01-21cleanup: remove temporary debug codePaul Buetow
2026-01-21debug: add debug output to audio regeneration functionsPaul Buetow
Add console debug output to understand which side (front/back) is being regenerated for audio A and P key presses.
2026-01-21simplify: remove Space key, use P/Shift+P for audio playbackPaul Buetow
- Remove Space key handler from handleShortcutKey Space is not needed - use P/Shift+P instead - Clarify hotkeys help text p/п = play front audio P/П = play back audio (bg-bg only) The SetOnTypedRune handler already correctly handles case-sensitive keys (p vs P, a vs A) for both playback and regeneration.
2026-01-21improve: Space hotkey for back audio and consistent button iconsPaul Buetow
- Add Space key as primary hotkey to play back audio (bg-bg cards only) More intuitive than Shift+P for playing the second audio - Change back audio button icon from MediaSkipNextIcon to MediaPlayIcon Both front and back buttons now use the same play icon for consistency - Update hotkeys help dialog to document Space key Mark P/П as legacy (kept for backward compatibility) This makes the UI more consistent and the Space key is more natural for playing the back audio without using Shift.
2026-01-21improve: better audio player UI and debugging for bg-bg cardsPaul Buetow
- Add debug logging to navigation.go to diagnose audio file loading issues Prints paths being checked and whether files are found - Improve AudioPlayer UI for Bulgarian-Bulgarian cards: - Add labels showing 'Front' and 'Back' for bg-bg audio buttons - Labels only show when audio files are actually loaded - Better visual distinction between the two playable audios - Reorganized button layout with VBox for cleaner appearance - Track bg-bg state in AudioPlayer (isBgBg field) - Automatically set when back audio file is loaded - Used to determine when to show labels This makes it clearer that Bulgarian-Bulgarian cards have two independently playable audio outputs, and helps debug why audio isn't being loaded.
2025-08-02add timestamps to .apkg exports and num of cardsv0.7.5Paul Buetow
2025-07-22Fix race conditions in background processing and prevent deletion of active ↡Paul Buetow
cards - Fix race condition where images, audio, and phonetic info could be saved to wrong flashcard when navigating quickly between cards - Add pre-determined card directory that's passed to all background operations - Track active operations per word to prevent deletion during generation - Block deletion of cards that are queued or being processed - Show appropriate error messages when deletion is blocked This ensures files are always saved to the correct card directory and prevents data loss from deleting cards with active operations. πŸ€– Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-22Add Cyrillic 'Π²' support for archive hotkeyPaul Buetow
- Add 'Π²' and 'Π’' (Cyrillic) key handling for archive functionality - Ensures archive works with both Latin 'v' and Cyrillic 'Π²' keyboards πŸ€– Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-22Add archive hotkey and update GUI iconsPaul Buetow
- Add 'v' hotkey for archive all cards functionality - Change regenerate image icon to ColorPaletteIcon (artistic palette) - Change random image icon to ViewRefreshIcon (refresh symbol) - Update help dialog to include archive hotkey in Export & Archive section - Add hotkey hint to archive button tooltip πŸ€– Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-22Reorganize assets and bump version to 0.7.3v0.7.3Paul Buetow
- Move totalrecall.desktop, install-icon.sh, and config.yaml.example to assets/ directory - Update all references in README.md and install-icon.sh - Add file organization guidelines to AGENTS.md - Clean up root directory structure πŸ€– Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-22lowercasePaul Buetow
2025-07-22Fix GUI background image generation race conditionsPaul Buetow
- Add file.Sync() after image download to ensure data is flushed to disk - Add double-checking in UI updates to prevent wrong card updates - Fix background job completion to reload files when user navigates back - Add file size validation in image display widget - Improve error messages for image loading failures This fixes two issues: 1. 'png: invalid format: not enough pixel data' error when navigating during generation 2. Images not updating when navigating back to a card after background generation completes
2025-07-22Remove audio cache feature to simplify codebase and avoid cache-related issuesPaul Buetow
πŸ€– Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-21feat: Enhanced bulk import, archive functionality, and export improvementsPaul Buetow
## Bulk Import Enhancements - Added support for three flexible batch file formats: - `BULGARIAN = ENGLISH` - Both provided, no translation needed - `= ENGLISH` - Only English provided, auto-translated to Bulgarian - `BULGARIAN` - Only Bulgarian provided, auto-translated to English - Implemented smart file checking to skip already processed words - Check all required files (word.txt, translation.txt, phonetic.txt, audio/image files and their attribution/metadata) - Added batch processing summary with statistics ## Archive Functionality - Renamed --clear flag to --archive for clarity - Archive cards directory to ~/.local/state/totalrecall/archive/cards-TIMESTAMP - Added archive button to GUI toolbar with folder icon - Archive confirmation dialog supports keyboard shortcuts (y/n/c/ESC) ## Export Improvements - Anki exports now show full file path in output - Changed default export location to home directory (~) for both CLI and GUI - Auto-adjust image size to 1024x1024 when DALL-E 3 is selected ## Other Improvements - Added TranslateEnglishToBulgarian method for reverse translation - Enhanced batch processing with better error handling and progress reporting - Improved file integrity checking for complete word processing πŸ€– Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-21fix(gui): Display phonetic info immediately when fetchedv0.7.1Paul Buetow
- Update phonetic display as soon as data is available, not after image generation - Apply fix to both single word and batch processing modes - Improves user experience by showing IPA transcription without delay - Bump version to 0.7.1 πŸ€– Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-21more on thisPaul Buetow
2025-07-21feat: improve consistency between CLI and GUI modesPaul Buetow
- Fix batch mode to store cards in ~/.local/state/totalrecall/cards/ matching GUI behavior - Add --no-auto-play flag to disable automatic audio playback (enabled by default) - Simplify phonetic fetching in CLI to match GUI (IPA only, no detailed explanations) - Remove redundant --gui flag as GUI is already the default mode - Align image generation settings: both modes now use DALL-E 2 with 512x512 resolution πŸ€– Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-21Release v0.7.0: Add auto-play feature and improve keyboard navigationv0.7.0Paul Buetow
New Features: - Added auto-play feature for audio with 'u'/'Ρƒ' hotkey toggle - Auto-play is enabled by default on app startup - Automatically plays audio when new files are generated - Automatically plays audio when navigating between cards - Added Escape key support to unfocus all input fields - Works for Bulgarian word input - Works for English translation input - Works for image prompt multi-line input Improvements: - Increased default window size by 10% (800x700 β†’ 880x770) - Fixed duplicate hotkey handling for 'u', 'h', and 'l' keys - Fixed tooltip initialization error by deferring audio player tooltips Bug Fixes: - Fixed Fyne threading errors in audio playback - Fixed tooltip layer initialization order issue - Removed duplicate keyboard shortcut handlers The auto-play feature enhances the learning experience by automatically playing pronunciation audio when cards are generated or when navigating through existing cards. Users can toggle this feature on/off at any time using the 'u' or 'Ρƒ' hotkey.
2025-07-20feat: add quit confirmation dialogPaul Buetow
- Added confirmation dialog when pressing 'q' to quit the application - Supports y/ъ to confirm, n/Π½ or ESC to cancel - Prevents accidental app closure - Consistent with delete confirmation dialog pattern πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-20feat: add ESC key support for all dialogsPaul Buetow
- Added ESC key to close help dialog - Added ESC key to close/cancel export dialog - Updated dialog instructions to show ESC option - ESC already supported for delete confirmation and unfocusing text areas πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-20feat: change help hotkey to ? and add vim-style navigationPaul Buetow
- Changed help screen hotkey from 'h' to '?' - Added vim-style navigation keys: h/Ρ… for previous, l/Π» for next - Updated help dialog to reflect new key bindings - Updated button tooltips with new shortcuts πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19feat: improve flashcard storage and audio regenerationv0.6.0Paul Buetow
- Change default card storage from ~/Downloads to ~/.local/state/totalrecall/cards/ - Keep .apkg exports in ~/Downloads for user convenience - Fix audio regeneration to use random voice and speed (0.9-1.0) - Fix GNOME dock icon by updating StartupWMClass to "Totalrecall" - Fix navigation to properly find cards in new XDG state directory - Ensure config defaults are properly filled when using GUI mode - Bump version to 0.6.0 πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19feat: improve button icons for image generationPaul Buetow
- Generate image: Changed from ViewRefreshIcon to FileImageIcon for clearer image representation - Random image: Changed from MediaPhotoIcon to ColorPaletteIcon to suggest creativity/variety These icons better represent their functions and improve UI clarity. πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19feat: add context cancellation for card operationsPaul Buetow
- Add per-card context tracking to cancel ongoing operations - Cancel audio/image generation when card is deleted - Keep delete button enabled during generation for cancellation - Add cleanup hook to remove recreated directories after deletion This allows users to cancel in-progress card generation by deleting the card, preventing orphaned API calls and file creation. πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19feat: improve export functionality and fix configuration issuesPaul Buetow
- Add custom export directory selection in GUI export dialog - Change default export directory from ~/.local/state/totalrecall to ~/Downloads - Remove broken voice configuration from config file (voice is always random) - Fix discrepancies between code defaults and example config - Remove unimplemented image cache settings from example config The voice configuration was not working due to a bug where it only read from config if the command-line flag was set to "nova" (but default was empty string). Since voices are randomly selected anyway, this configuration option has been removed. πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19feat: add app icon and change default output directoryPaul Buetow
- Add custom app icon with memory/brain theme - Icon now displays in GNOME app menu, window title bar, and process list - Change default output directory to ~/.local/state/totalrecall/ - Make output directory configurable via CLI flag, config file, or env var - Add desktop entry file for GNOME integration - Add install script for easy icon installation - Update README with icon display and default directory information - Bump version to 0.5.1 πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19feat: improve GUI layout and add Cyrillic keyboard supportv0.5.0Paul Buetow
- Move navigation buttons to top toolbar - Increase window height (600β†’700px) and phonetic info area (100β†’180px) - Fix file check ticker race condition - Remove File menu, add export/help icons to toolbar - Add comprehensive Cyrillic keyboard support for all hotkeys - Support Cyrillic keys in all dialogs (help, export, delete confirmation) - Add project page link to help dialog - Bump version to 0.5.0 πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18chore: bump version to 0.4.2Paul Buetow
- Fix Fyne tooltip layer error by deferring tooltip setup after layer creation - Add phonetic information generation to batch mode processing - Fix GUI not displaying phonetic info for batch-generated cards - Add debug logging for phonetic file loading - Fix checkForMissingFiles to handle placeholder text in phonetic display πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18feat: multiple improvements to GUI and codebasePaul Buetow
- Add random voice speed between 0.90-1.00 for more natural audio - Display voice and speed info in GUI audio player - Implement automatic retry loading for missing files (checks every 2 seconds) - Fix voice/speed info persistence during audio playback - Remove image caching functionality for cleaner codebase - Rename prompt.txt to image_prompt.txt for clarity - Fix GUI to recognize newly added cards during runtime (rescan on navigation) - Update README to reflect removed image cache These changes improve the user experience by making the audio more natural, providing better feedback about audio generation parameters, and ensuring the GUI stays synchronized with externally added cards. πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18fix: ensure single directory per card with consistent IDPaul Buetow
- Fixed issue where multiple directories were created for the same word - Added findCardDirectory to check for existing directories before creating new ones - Updated all file creation functions to reuse existing card directories - Applied fix to both GUI and CLI code - Added phonetic fetching to processing counter in generateMaterials - Now each card gets one directory with all its files πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18fix: use timestamp+hash naming for directories in CLI to match GUIPaul Buetow
- Updated CLI code to use internal.GenerateCardID() for directory names - Changed file naming to match GUI: word.txt, translation.txt, audio.mp3, image.jpg/png - Created internal/utils.go with shared GenerateCardID and SanitizeFilename functions - Fixed all references to use the new naming system consistently - Ensures both CLI and GUI use the same directory and file naming convention πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18feat: improve GUI usability with tooltips and reorganized layoutPaul Buetow
- Remove button captions in favor of icon-only buttons - Add comprehensive keyboard shortcuts dialog (File->Hotkeys) - Move toolbar with action buttons to top of window - Add hover tooltips to all buttons showing function and shortcut - Change export hotkey from 'E' to 'e' - Replace audio regenerate icon with more appropriate record icon - Add fyne-tooltip dependency for tooltip functionality πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18refactor: improve UI by removing unnecessary dialogsPaul Buetow
- Remove "Export Complete" dialog after exporting, use status bar instead - Remove Preferences menu item and dialog (not implemented) - Simplify File menu to only contain Export and Quit options πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18fix: improve APKG export functionalityv0.4.0Paul Buetow
- Fix Anki import errors by adding missing deck fields (newToday, revToday, etc.) - Fix media files not displaying/playing by using original filenames in cards - Add phonetic information to notes field with proper line breaks - Add 'e' hotkey for quick APKG export - Increment version to 0.4.0 πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18feat: export all cards from anki_cards folder, not just current sessionPaul Buetow
- Changed GUI export to scan entire anki_cards directory - Uses GenerateFromDirectory to load all cards from subdirectories - Shows accurate count of total cards with audio/image stats - Works for both APKG and CSV export formats - No longer limited to cards from current session (savedCards) This ensures users can export their complete collection at any time, even after restarting the application. πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18feat: major refactor - APKG export support and subdirectory organizationPaul Buetow
Major Features: - Added native .apkg (Anki package) export format with embedded media - Reorganized file structure to use subdirectories per word - Enhanced GUI export dialog with format selection (APKG/CSV) APKG Export Implementation: - Created apkg_generator.go with full SQLite-based Anki package generation - Includes custom card templates with professional CSS styling - Front side: Image + English word - Back side: Image + Bulgarian word + Audio + Notes - All media files automatically embedded in package - Custom deck names supported via --deck-name flag Directory Structure Changes: - Each word now gets its own subdirectory (e.g., anki_cards/ябълка/) - All related files (audio, images, translations, prompts) stored together - Cleaner organization and easier management - Prevents file naming conflicts GUI Updates: - Export dialog no longer shows file browser, exports directly to anki_cards - Format selection between APKG (recommended) and CSV (legacy) - Fixed navigation to properly load image prompts from subdirectories - Delete function now moves entire word directory to trash CLI Updates: - --anki flag now generates APKG by default - --anki-csv flag for legacy CSV format - All file generation uses subdirectory structure Bug Fixes: - Fixed handling of multi-word entries (e.g., "ΠΊΠ°Ρ€Ρ‚ΠΎΡ„ ΠΊΠ°Ρ€Ρ‚ΠΎΡ„ΠΈ") - Fixed GenerateFromDirectory to properly handle words with underscores - Fixed phonetic files being treated as separate cards - Fixed image prompt preservation during navigation Breaking Changes: - File structure changed from flat to subdirectory-based - Existing files need to be reorganized into subdirectories πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18gui improvementsPaul Buetow
2025-07-18feat: dynamic artistic styles with weekly regenerationPaul Buetow
- Remove 42 hard-coded image generation styles - Load styles from cache file (artistic_styles.txt) - Generate styles via OpenAI API if file doesn't exist - Regenerate styles automatically if older than one week - Shuffle styles on each use to prevent LLM bias - Fix bug where generated images appeared in wrong dialog - Handle empty custom prompts properly - Remove Bulgarian word references from image prompts - Improve subject focus and visibility in prompts - Add error handling when styles cannot be loaded πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17fixesPaul Buetow
2025-07-17fix: prevent UI element mix-ups during concurrent processing and rapid ↡Paul Buetow
navigation - Fixed one-way translation bug: English to Bulgarian no longer triggers reverse translation - Prevent mix-ups when rapidly entering new words while previous words are processing - Ensure all UI elements update only for their associated job: * Bulgarian/English text fields protected by job ID checks * Phonetic info saved to disk immediately and UI updates restricted * Audio file associations protected from background job interference * Image prompts saved immediately and UI updates controlled - Add mutex protection for thread-safe UI updates - Disconnect from background jobs when user starts typing new input - Save all generated data to disk immediately, not just on UI update - Improve navigation to properly load all associated data from disk This ensures correct flashcard generation even with rapid word entry and navigation. πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17add phoenetic alphabetPaul Buetow
2025-07-17feat: add manual translation editing and bidirectional translationPaul Buetow
- Replace translation label with editable entry field - Move translation field next to Bulgarian input for better UX - Add bidirectional translation support: - Bulgarian β†’ English: auto-translate when only Bulgarian provided - English β†’ Bulgarian: auto-translate when only English provided - No translation when both fields are filled - Show translations immediately upon generation - Auto-save translations when edited - Keep input fields populated during processing πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16Remove Pixabay and Unsplash image search supportPaul Buetow
- Delete Pixabay and Unsplash implementation files - Remove API key configuration for both services - Update CLI and GUI to only support OpenAI DALL-E - Update documentation to reflect OpenAI as sole image provider - Fix tests to handle nil client in OpenAI implementation - Simplify configuration examples The application now exclusively uses OpenAI DALL-E for image generation, providing AI-generated educational images with creative art styles. πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16only one img per cardPaul Buetow
2025-07-16fix: update button labels to show lowercase hotkeys and improve export locationPaul Buetow
- Change all button labels to show lowercase letters (g, n, i, a, r, d, p) - Update delete confirmation dialog to show lowercase y/n - Set default export location to anki_cards directory - Add note about CSV needing to be in same directory as media files - Fix prompt generation to remove Bulgarian word reference πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16feat: add custom image prompt support and keyboard shortcutsPaul Buetow
- Add text area next to image display for custom image generation prompts - Users can specify their own prompts or leave empty for auto-generation - Display the used prompt in the text area after generation - Load prompts from attribution files when navigating to existing cards - Add keyboard shortcuts for all GUI buttons: - G: Generate, N: New Word, I: Regenerate Image, A: Regenerate Audio - R: Regenerate All, D: Delete, P: Play audio - Left/Right arrows: Navigate between words - Y/N: Confirm/cancel delete dialog - Update UI layout with equal 50/50 split between image and prompt - Enable text wrapping in prompt text area - Add 25% chance to ask OpenAI for creative photo style suggestions - Fix concurrent processing to properly use custom prompts πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16feat: add concurrent processing, queue system, and UI improvementsPaul Buetow
- Implement concurrent word processing with background queue - Add processing statistics showing active tasks and total cards - Enable circular navigation through cards - Fix card deletion to update total count correctly - Add version number to GUI window title - Prevent unwanted UI reloads for background-processed cards - Enable immediate audio playback before image generation completes - Update 'Keep & Continue' button to 'New Word' - Improve queue status tracking for all processing operations πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>