Repository navigation
fix(dnd): lists can't be reordered when dropped over another list's cards - #8626
Open
solyin-enof wants to merge 2 commits into
Open
solyin-enof wants to merge 2 commits into
solyin-enof wants to merge 2 commits into
Conversation
Each list's card Container passes shouldAcceptDrop="() => canEdit".
In smooth-dnd a shouldAcceptDrop callback replaces the default
relevance check (same container, or matching groupName), so every card
list also accepts a dragged list as if it were a card.
When a list is dropped with the pointer over another list's cards, the
card list takes the drop. The board container then gets addedIndex
null, and the client sends {"order": null} to
/stacks/{id}/reorder (400) plus a reorder for card "undefined" (403).
The list does not move.
Only accept drops whose source container is a card list
(groupName "stack"), which keeps moving cards between lists working.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: solyin-enof <340926352+solyin-enof@users.noreply.github.com>
OC.Notification no longer exists in server (gone from core/src/OC since stable34), so these error paths threw a TypeError instead of showing a message. In orderStack this also skipped restoring the previous list order after a failed reorder, leaving the board showing an order that was never saved. Use showError from @nextcloud/dialogs, as the rest of the app does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: solyin-enof <340926352+solyin-enof@users.noreply.github.com>
solyin-enof
force-pushed
the
fix/stack-drag-into-card-list
branch
from
October 27, 2026 12:50
420d639 to
54944a9
Compare
This branch has not been deployed
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.
Summary
Dragging a list to a new position usually doesn't save: the list snaps back.
Each list's card
Containersets:shouldAcceptDrop="() => canEdit". In smooth-dnd ashouldAcceptDropcallback replaces the default relevance check (same container, or matchinggroupName). So every card list also accepts a dragged list as if it were a card. When you drop a list with the pointer over another list's cards, which cover most of a list, that card list takes the drop and the board container getsaddedIndex: null. The client then sends:The 403 is
onDropCardrunning with the list'sundefinedpayload.Commit 1 makes the card lists accept only drops from another card list (
sourceOptions.groupName === 'stack'), so the board container gets the list drop and moving cards between lists still works.Commit 2 fixes the error path. The failed reorder's
catchcallsOC.Notification.showTemporary, butOC.Notificationwas removed from server (it's incore/src/OC/index.json stable33 and gone from stable34). The handler threwTypeError: Cannot read properties of undefined (reading 'showTemporary')before it restored the previous order, so the board kept showing an order that was never saved. I replaced it and the two other remainingOC.Notificationcalls (AppNavigationBoard.vue,SharingApi.js) withshowErrorfrom@nextcloud/dialogs.Testing
shouldAcceptDropchange to 1.19.1 (built fromv1.19.1, installed on that instance). Moving a list then sent{"order":0}→ 200 and the order stayed after a reload. Dragging a card into another list still saved (200).eslintpasses on the changed files andnpm run buildsucceeds. I haven't run this branch against a Nextcloud 36 instance; the changed lines are the same as on 1.19.1 apart from the camelCase prop.Checklist
🤖 AI (if applicable)
🤖 Generated with Claude Code