Skip to content

fix: save question reorder on drop instead of during drag#3392

Merged
Chartman123 merged 3 commits into
mainfrom
fix/question-reorder-save-on-drop
Jun 8, 2026
Merged

fix: save question reorder on drop instead of during drag#3392
Chartman123 merged 3 commits into
mainfrom
fix/question-reorder-save-on-drop

Conversation

@pringelmann

@pringelmann pringelmann commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Drag-and-drop reordering saved the wrong order to the backend, so reloading reverted to the old order. Two related causes:

  1. Questions and options saved on the draggable's change event, which fires repeatedly during the drag (before the new order is committed) instead of once on release. Switched to update, which fires once on drop.
  2. Options needed an extra fix: saveOptionsOrder reads the order from the options prop, which only updates after the reordered array round-trips through the parent. Saving synchronously on drop still read the stale order. The drag now sets the existing dirtyOptionsType flag so the debounced watcher saves once the new order has settled, the same path the move up/down buttons already use.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Screenshots before/after for front-end changes
  • Documentation (manuals or wiki) has been updated or is not required
  • Backports requested where applicable (ex: critical bugfixes)
  • Labels added where applicable (ex: bug/enhancement, 3. to review, feature component)
  • Milestone added for target branch/version (ex: 32.x for stable32)

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann self-assigned this Jun 8, 2026
@Chartman123 Chartman123 added 3. to review Waiting for reviews regression Regression of a previous working feature labels Jun 8, 2026
@Chartman123 Chartman123 added this to the 5.3 milestone Jun 8, 2026
@Chartman123 Chartman123 marked this pull request as ready for review June 8, 2026 14:46
@Chartman123 Chartman123 merged commit 1e6568a into main Jun 8, 2026
44 of 45 checks passed
@Chartman123 Chartman123 deleted the fix/question-reorder-save-on-drop branch June 8, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews regression Regression of a previous working feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants