webui: when SaveAs is used to clone a config, use common helper and update project-specific paths#2744
Merged
Merged
Conversation
…pdate project-specific paths
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
trainer_htmx.htmlwas 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_dirand--tracker_run_name) are now automatically updated to reflect the new configuration name, while the data loader reference remains shared.Testing and regression coverage:
SaveAsNewConfigurationTestCase, intest_webui_e2e.pyto 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.