Editing bulk Style names causes ordering issue for next edit
Is there an existing issue for this?
- [x] I checked and did not find my issue in the already reported ones
Describe the bug
When editing a group of styles (by selecting them all and clicking edit) where when one dialog modal closes and the modal opens for the next style, if you edit the name of a style so that it changes position in the list or moves to a different folder, then the "next" style that is shown in the modal can be the one AFTER the next style.
I think it is related to _gui_styles_get_active_items and the position/index of the item that the modal expect to open next not matching with the position of the items after a style is edited and the list of styles is updated to be, but I don't know enough about C to debug it further.
Steps to reproduce
Setup: Have 4/5 styles with simple names for alphabetical checking; Style A, Style C, Style E, Style G etc.
Scenario 1:
- Go to the lighttable view and open the styles module
- Select multiple styles and click "Edit"
- Edit the name of the first style to be "Style D"
- Click "Save" and the modal will close and open for the next style, and you expect Style C to now be shown but actually "Style D"
Scenario 1:
- Go to the lighttable view and open the styles module
- Select multiple styles and click "Edit"
- Edit the name of the first style to be "New Folder|Style A"
- Click "Save" and the modal will close and open for the next style, and you expect Style C to now be shown but actually "Style E"
In both scenarios the position of the style you would expect to open next would be 1, but on save of the first style the style list is reordered and the edited style is placed at position 1 and the style you wanted to edit next has moved to position 0.
Seems that grabbing the next style to edit should happen before the list is re-ordered on edit to resolve this
Expected behavior
To edit the next style in your multi-selection
Logfile | Screenshot | Screencast
No response
Commit
No response
Where did you obtain darktable from?
darktable.org / GitHub release
darktable version
5.0.1
What OS are you using?
Windows
What is the version of your OS?
Windows 11 Home
Describe your system
No response
Are you using OpenCL GPU in darktable?
None
If yes, what is the GPU card and driver?
No response
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
No response
This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.