Skip to content

webui: when SaveAs is used to clone a config, use common helper and update project-specific paths#2744

Merged
bghira merged 2 commits into
mainfrom
bugfix/cloning-environment-woes
Jun 5, 2026
Merged

webui: when SaveAs is used to clone a config, use common helper and update project-specific paths#2744
bghira merged 2 commits into
mainfrom
bugfix/cloning-environment-woes

Conversation

@bghira
Copy link
Copy Markdown
Owner

@bghira bghira commented Jun 5, 2026

This pull request addresses a regression in the "Save As..." configuration cloning flow in the SimpleTuner web UI, ensuring that when users clone a configuration, all fields—including those not currently visible in the DOM—are preserved, and identity fields are properly repointed to the new configuration name. It also adds robust error handling and comprehensive regression tests to prevent similar issues in the future.

Improvements to the "Save As..." configuration cloning flow:

  • The JavaScript logic for the "Save As..." action in trainer_htmx.html was updated to ensure the complete loaded configuration is cloned, not just the form fields present in the DOM, preventing loss of fields from inactive tabs. Identity fields (such as --output_dir and --tracker_run_name) are now automatically updated to reflect the new configuration name, while the data loader reference remains shared.
  • Enhanced error handling for failed configuration creation, providing detailed feedback to the user if the operation fails.

Testing and regression coverage:

  • Added a new end-to-end test case, SaveAsNewConfigurationTestCase, in test_webui_e2e.py to verify that the "Save As..." feature correctly clones the complete configuration, applies live edits, repoints identity fields, and leaves the source configuration unchanged. This test ensures the regression is covered and prevents future breakage.

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 fixes a regression in the WebUI “Save As…” flow so cloning a configuration preserves the complete loaded config (including fields not currently present in the DOM) and repoints name-derived identity fields to the new configuration name. It also adds an end-to-end regression test to ensure cloning preserves untouched fields, captures live edits, and leaves the source config unchanged.

Changes:

  • Update the “Save As…” handler to build the cloned config from a merged “complete” config source (form + store-backed values), and repoint select identity fields (e.g., output dir / tracker names).
  • Improve error feedback when config creation fails by attempting to surface API error details.
  • Add a new Selenium E2E regression test covering the Save As cloning behavior end-to-end.

Reviewed changes

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

File Description
simpletuner/templates/trainer_htmx.html Reworks the Save As cloning logic to preserve full config state and repoint identity fields; adds better failure toasts.
tests/test_webui_e2e.py Adds an E2E regression test ensuring Save As clones the full config, captures live edits, repoints identity fields, and keeps the source unchanged.

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

Comment thread simpletuner/templates/trainer_htmx.html Outdated
@bghira bghira merged commit d31f61d into main Jun 5, 2026
2 checks passed
@bghira bghira deleted the bugfix/cloning-environment-woes branch June 5, 2026 14:37
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.

2 participants