-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or requestpriority:highHigh priority featureHigh priority featurerefactor
Description
Description
Separate the core optimization logic from the UI to make the app modular. The core should handle input/output independently (e.g., console, file, event viewer) without relying on Tkinter. This is like logging systems that output to multiple sinks.
Why this is useful?
- Enables CLI mode (--terminal) without GUI dependencies
- Makes output flexible (console, file, notification, etc.)
- Improves maintainability and testability
- Allows future extensions (web API, integration with other tools)
- Reduces main.py length by modularizing
Implementation Ideas
- Create src/core.py for all optimizations (apply_optimizations)
- Use abstract I/O handlers (e.g., ConsoleOutput, FileOutput)
- Main entry: Check args --gui / --terminal and load appropriate mode
- Example structure:
- src/core.py: Pure functions for token crushing
- src/ui.py: GUI logic (Tkinter)
- src/cli.py: Console logic (argparse)
- main.py: Parse args and route to UI or CLI
Additional context
- Inspired by logging modules (console, file handlers)
- Relates to issue #X (CLI version)
- Test with pytest: Core independent of UI
Priority
- Must-have
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority:highHigh priority featureHigh priority featurerefactor
Projects
Status
Backlog