Improve calculation setup dialogs with retry and pre-population #1590
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.
Summary
This PR improves the user experience when creating, duplicating, and renaming calculation setups by implementing automatic retry with name pre-population when duplicate names are encountered.
Changes
1. Automatic Retry on Duplicate Names (CSNew & CSDuplicate)
Previously, when a user entered a duplicate calculation setup name, an error dialog would appear and the operation would be cancelled, requiring the user to start over from the beginning.
Now, after the error dialog, the input dialog automatically reopens with the previously entered name pre-filled, allowing the user to easily modify it and try again.
Example workflow:
2. Pre-populate Old Name in Rename Dialog (CSRename)
When renaming a calculation setup, the dialog now shows the current name as editable text (not a placeholder), making it much easier to make small modifications to existing names.
Before: Empty input field
After: Input field contains the current calculation setup name, ready to edit
Additionally, CSRename now includes the same retry logic as CSNew and CSDuplicate.
Technical Details
QInputDialog.getText()calls to use thetextparameter for pre-populationwhileloop for retrydefault_nameparameter toCSNew.get_cs_name()methodTesting
Added 5 comprehensive test cases:
test_cs_new_retry_on_duplicate- Verifies CSNew retry behaviortest_cs_new_cancel_on_retry- Ensures cancel works during retrytest_cs_duplicate_retry_on_duplicate- Verifies CSDuplicate retry behaviortest_cs_rename_retry_on_duplicate- Verifies CSRename retry behaviortest_cs_rename_prepopulates_old_name- Confirms old name pre-populationAll existing tests continue to pass.
Related Issues
Fixes items 1 and 2 from #[issue_number]
Item 3 (Reordering FU's & IC's) is tracked separately in #1100
Original prompt
Fixes #1108
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.