Skip to content

feat: drag-and-drop employee reordering#81

Open
trinnode wants to merge 3 commits intoGildado:mainfrom
trinnode:feat/employee-dnd-reorder
Open

feat: drag-and-drop employee reordering#81
trinnode wants to merge 3 commits intoGildado:mainfrom
trinnode:feat/employee-dnd-reorder

Conversation

@trinnode
Copy link

Closes #68

Description

Implemented drag-and-drop reordering for the employee management table using @dnd-kit.

Technical Approach

  • UI/UX: Added a dedicated drag handle column so text selection in other columns remains unaffected.
  • State Management: Implemented optimistic UI updates via @tanstack/react-query. The table reorders instantly on drag end, preventing layout flicker.
  • Security & Performance: The API payload is minimized to send only { id, newIndex } instead of full employee objects. Added automatic rollback to the previous cache state if the mutation fails.
  • Accessibility: Drag handles are keyboard navigable with tabIndex={0} and proper aria-labels.

Screenshots/Screen Recording

Screenshot From 2026-02-20 11-43-41 *

Checklist

  • Tested optimistic updates and API failure rollbacks
  • Keyboard accessibility tested
  • All 19 Vitest suites passing
  • npm run lint and npm run build pass locally

@Wilfred007
Copy link
Collaborator

Hi @trinnode there seem to be a merge conflict, do well to resolve it in good time so I can test and merge your pr. thank you

@Wilfred007
Copy link
Collaborator

Uploading Screenshot from 2026-02-21 00-40-49.png…

@Wilfred007
Copy link
Collaborator

Hi @trinnode kindly resolve conflicts and let me know, thank you

@trinnode
Copy link
Author

Hello @Wilfred007 I have resolved the conflicts. Thank you

@trinnode
Copy link
Author

Please ensure these are installed in the target app where this feature is merged:

Runtime:

@dnd-kit/core
@dnd-kit/sortable
@dnd-kit/utilities

and reference the new files in App.tsx

import EmployeeTable from "./pages/EmployeeTable";
  <NavLink
              to="/employees"
              className={({ isActive }: { isActive: boolean }) =>
                `text-sm font-medium ${isActive ? 'text-blue-600' : 'text-gray-500 hover:text-gray-700'}`
              }
            >
              Employee Table
            </NavLink>```
            
           Then also include it in the route
           @Wilfred007 

@trinnode
Copy link
Author

Hello @Wilfred007 , Please merge my PR

Uchechukwu-Ekezie pushed a commit to OpenSourceCOntr/PayD that referenced this pull request Mar 8, 2026
- Add database migrations for schedules and execution_history tables
- Implement ScheduleService with CRUD operations and next run calculation
- Create REST API endpoints (POST/GET/DELETE /api/schedules)
- Implement ScheduleExecutor with cron job for automated payment execution
- Integrate with Stellar blockchain for bulk payments
- Add comprehensive error handling and validation
- Wire cron executor into server startup with graceful shutdown

Closes Gildado#81
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.

#064: Drag-and-Drop Employee Reordering

2 participants