Skip to content

Optimiser presets available outside of training configuration wizard#2723

Merged
bghira merged 3 commits into
mainfrom
feature/ui-accessibility-optimiser-config-presets
May 20, 2026
Merged

Optimiser presets available outside of training configuration wizard#2723
bghira merged 3 commits into
mainfrom
feature/ui-accessibility-optimiser-config-presets

Conversation

@bghira
Copy link
Copy Markdown
Owner

@bghira bghira commented May 20, 2026

Closes #2528

This pull request introduces a major refactor to how optimizer presets are managed and selected in the training wizard and related UI. The main changes include moving all optimizer preset logic into a shared JavaScript module, updating both the training wizard and "EZ mode" forms to use this shared logic, and adding new styles and UI for selecting optimizer presets. These changes improve maintainability, consistency, and user experience across the application.

Refactor and Centralization of Optimizer Preset Logic:

  • All optimizer preset definitions and related logic have been moved into a new shared JavaScript module (optimizer-presets.js), which is now loaded before the training wizard and form components. Both the training wizard and "EZ mode" forms now use this centralized logic to fetch, apply, and display optimizer presets, replacing duplicated or hardcoded preset definitions. [1] [2] [3]

Training Wizard Integration:

  • The training wizard (training-wizard.js) has been refactored to use the shared preset module for all preset-related operations, including applying presets, resolving optimizer selections, formatting learning rates, and rendering preset cards. Old hardcoded preset definitions and logic have been removed in favor of calls to the shared module. [1] [2] [3] [4] [5]

"EZ Mode" Form Integration:

  • The form tab template (form_tab.html) has been updated so that the "EZ mode" optimizer section also uses the shared preset logic. This includes syncing the selected preset with form fields, applying presets, and updating the UI accordingly. Several new methods and state variables have been added to support this integration. [1] [2] [3] [4] [5]

UI and Styling Enhancements:

  • A new stylesheet (optimizer-presets.css) has been added and loaded into the base template to provide improved visual styling for optimizer preset cards and modal dialogs, including light and dark theme support and responsive layouts. [1] [2]

Template and Import Adjustments:

  • The base and form tab templates have been updated to include the new stylesheet and JavaScript module, and to import the optimizer preset selector partial where needed. [1] [2] [3]

These changes collectively provide a more maintainable, consistent, and user-friendly experience for selecting optimizer presets throughout the application.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors optimizer preset handling into a shared frontend module and exposes the same preset selector UI beyond the training configuration wizard (including Easy Mode and a standalone modal), addressing #2528 by making presets easier to access and consistent across screens.

Changes:

  • Centralize optimizer preset definitions + helper logic in a shared JS module and update the training wizard to consume it.
  • Add a reusable Jinja macro for rendering preset cards, used in the wizard, Easy Mode training UI, and a new “Optimizer Presets” modal.
  • Add new CSS styling for the preset card UI and extend tests to cover the new templates + shared preset behavior.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_template_rendering.py Adds assertions that optimizer preset selector UI renders in training tab, training wizard, and the new modal.
tests/js/training_wizard.test.js Verifies wizard consumes shared optimizer preset module and applies presets correctly.
tests/js/optimizer_presets.test.js New unit tests for shared preset module helpers (keys, values, matching, optimizer resolution).
tests/js/ez_mode_events.test.js Adds static analysis assertions for EZ Mode sync fallback logic.
simpletuner/templates/trainer_htmx.html Includes the new optimizer presets modal partial in the main trainer page.
simpletuner/templates/partials/training_wizard_modal.html Replaces inline preset card markup with the shared preset selector macro.
simpletuner/templates/partials/optimizer_presets_modal.html New modal template to apply wizard presets outside the wizard flow.
simpletuner/templates/partials/optimizer_preset_selector.html New macro providing a shared preset card selector UI.
simpletuner/templates/form_tab.html Integrates the shared selector into Training Easy Mode and wires it to shared preset logic.
simpletuner/templates/base_htmx.html Loads shared optimizer preset JS + CSS assets globally.
simpletuner/static/js/training-wizard.js Replaces hardcoded preset definitions/formatting with shared optimizer preset module calls.
simpletuner/static/js/optimizer-presets.js New shared preset module (definitions + helpers) plus modal + button-injection UI wiring.
simpletuner/static/css/optimizer-presets.css New styling for preset cards and the optimizer preset modal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread simpletuner/templates/form_tab.html
@bghira bghira merged commit 2a1cb09 into main May 20, 2026
2 checks passed
@bghira bghira deleted the feature/ui-accessibility-optimiser-config-presets branch May 20, 2026 16:33
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.

enable easier access to optimiser presets in optimiser config section (and Easy Mode)

2 participants