Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 16, 2025

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:

  • User creates new calculation setup named "my_setup"
  • "my_setup" already exists, warning appears
  • Dialog reopens with "my_setup" already filled in
  • User changes to "my_setup_v2" and continues

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

  • Modified QInputDialog.getText() calls to use the text parameter for pre-population
  • Changed duplicate name handling from immediate return to while loop for retry
  • Added default_name parameter to CSNew.get_cs_name() method
  • All changes follow existing code patterns and pass flake8 linting

Testing

Added 5 comprehensive test cases:

  • test_cs_new_retry_on_duplicate - Verifies CSNew retry behavior
  • test_cs_new_cancel_on_retry - Ensures cancel works during retry
  • test_cs_duplicate_retry_on_duplicate - Verifies CSDuplicate retry behavior
  • test_cs_rename_retry_on_duplicate - Verifies CSRename retry behavior
  • test_cs_rename_prepopulates_old_name - Confirms old name pre-population

All 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

This section details on the original issue you should resolve

<issue_title>Calculation setup improvements</issue_title>
<issue_description>- [ ] When creating a new calc setup (either copy or new), a name must be given, which must be unique. If the name already exists, an error is given. It would be nice if AB automatically opens the dialog again with the name previously entered

  • When renaming a calculation setup, a dialog is given. It would be nice if the dialog provides the old name already (not as placeholder, but as real text)
  • Reordering FU's & IC's (also impacts result ordering) Re-ordering items in calculation setup broken #1100 </issue_description>

Comments on the Issue (you are @copilot in this section)

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.

Copilot AI and others added 2 commits October 16, 2025 12:06
Co-authored-by: mrvisscher <103424764+mrvisscher@users.noreply.github.com>
Co-authored-by: mrvisscher <103424764+mrvisscher@users.noreply.github.com>
Copilot AI changed the title [WIP] Update calculation setup process with user-friendly dialog changes Improve calculation setup dialogs with retry and pre-population Oct 16, 2025
Copilot AI requested a review from mrvisscher October 16, 2025 12:12
Copilot finished work on behalf of mrvisscher October 16, 2025 12:12
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