1.7 KiB
1.7 KiB
Task: Combine pool and history stats into a single function and single menu item
Changes Made
1. Created New Combined Stats Function
- Added
show_combined_stats()method toJournalPromptGeneratorclass - Combines both pool statistics and history statistics into a single function
- Displays two tables: "Prompt Pool Statistics" and "Prompt History Statistics"
2. Updated Interactive Menu
- Changed menu from 5 options to 4 options:
-
- Draw prompts from pool (no API call)
-
- Fill prompt pool using API
-
- View combined statistics (replaces separate pool and history stats)
-
- Exit
-
- Updated menu handling logic to use the new combined stats function
3. Updated Command-Line Arguments
- Removed
--pool-statsargument - Updated
--statsargument description to "Show combined statistics (pool and history)" - Updated main function logic to use
show_combined_stats()instead of separate functions
4. Removed Old Stats Functions
- Removed
show_pool_stats()method - Removed
show_history_stats()method - All functionality consolidated into
show_combined_stats()
5. Code Cleanup
- Removed unused imports and references to old stats functions
- Ensured all menu options work correctly with the new combined stats
Testing
- Verified
--statscommand-line argument works correctly - Tested interactive mode shows updated menu
- Confirmed combined stats display both pool and history information
- Tested default mode (draw from pool) still works
- Verified fill-pool option starts correctly
Result
Successfully combined pool and history statistics into a single function and single menu item, simplifying the user interface while maintaining all functionality.