Skip to content

Refactor Tkinter UI for better maintainability and bug fixes#33

Draft
google-labs-jules[bot] wants to merge 1 commit intomasterfrom
refactor-ui-tkinter-11010792760452179861
Draft

Refactor Tkinter UI for better maintainability and bug fixes#33
google-labs-jules[bot] wants to merge 1 commit intomasterfrom
refactor-ui-tkinter-11010792760452179861

Conversation

@google-labs-jules
Copy link

Refactored the Python Tkinter UI to improve code quality, reduce duplication, and fix bugs.

Key changes:

  • Introduced BaseWindow and JobConfigForm in simpletextgenerator/ui/base.py.
  • Updated all UI windows to inherit from BaseWindow and use JobConfigForm for configuration fields.
  • Refactored menu.py to cleaner structure.
  • Fixed issue in edit_job.py where initial_model_to_load was not preserved.
  • Fixed immediate execution of destroy_window in edit_job.py.
  • Updated tests to pass in headless environment.

PR created automatically by Jules for task 11010792760452179861 started by @thtroyer

- Created `simpletextgenerator/ui/base.py` with `BaseWindow` and `JobConfigForm` to reduce code duplication and enforce consistency.
- Refactored `menu.py` to be the main application controller and properly manage child windows using `Toplevel`.
- Refactored `new_job.py`, `edit_job.py`, `archive_delete.py`, `generating_only_job.py`, and `training.py` to inherit from `BaseWindow` and use shared components.
- Fixed a bug in `edit_job.py` where `initial_model_to_load` was lost during editing.
- Fixed a bug in `edit_job.py` where `destroy_window` was called immediately.
- Updated `tests/ui/test_training.py` to mock `tkinter` correctly for headless testing.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

0 participants