Skip to content

fix: maintain consistent task ordering after drag and drop [NSOC'26]#47

Merged
Shriii19 merged 1 commit into
Shriii19:masterfrom
SrashtiChauhan:fix/batch-position-update
May 6, 2026
Merged

fix: maintain consistent task ordering after drag and drop [NSOC'26]#47
Shriii19 merged 1 commit into
Shriii19:masterfrom
SrashtiChauhan:fix/batch-position-update

Conversation

@SrashtiChauhan
Copy link
Copy Markdown
Contributor

Problem

Currently, when tasks are reordered within a column, only the dragged task’s position gets updated. Other tasks retain their previous position values, which leads to inconsistent ordering after refresh and may create duplicate positions in the database.

Solution

Implemented sequential position reassignment for all tasks in the affected column whenever a drag-and-drop action occurs.

The frontend now recalculates positions for all reordered tasks and syncs them with the backend to maintain consistent ordering across refreshes and connected clients.

Changes Made

Frontend

  • Updated drag-and-drop handling logic in KanbanBoard
  • Recalculated positions for all tasks after reordering
  • Synced updated positions with backend API calls
  • Ensured frontend state stays consistent after task movement

Backend

  • Reused the existing task update endpoint to persist updated task positions
  • Synced reordered task data with the database through sequential update requests

Result

  • Task ordering remains consistent after refresh
  • No duplicate or conflicting position values
  • Drag-and-drop changes persist correctly
  • Ordering stays synchronized across clients

Testing

  • Reordered tasks within the same column
  • Moved tasks across different columns
  • Refreshed the application after updates
  • Verified ordering consistency after reload
  • Confirmed task positions update correctly in the database

Screenshots

Screenshot from 2026-05-06 10-59-23

After refresh Task ordering remains consistent

Screenshot from 2026-05-06 10-59-30

Kindly review my pr.
NSOC'26

@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

@SrashtiChauhan is attempting to deploy a commit to the shreemp194-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@SrashtiChauhan
Copy link
Copy Markdown
Contributor Author

hi @Shriii19,
i have resolved the issue #45.
Kindly review my pr.
Thank you!(NSOC'26)

@Shriii19 Shriii19 merged commit b537430 into Shriii19:master May 6, 2026
4 of 5 checks passed
@SrashtiChauhan
Copy link
Copy Markdown
Contributor Author

hi @Shriii19 ,

This PR has been merged successfully, but it currently appears under “No Labels (0 pts)” on the leaderboard.
Could you please assign the appropriate NSOC label if applicable so the points can reflect correctly?

Thank you.

@SrashtiChauhan
Copy link
Copy Markdown
Contributor Author

hi @Shriii19 ,

This PR has been merged successfully, but it currently appears under “No Labels (0 pts)” on the leaderboard. Could you please assign the appropriate NSOC label if applicable so the points can reflect correctly?

Thank you.

@Shriii19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants