-
Notifications
You must be signed in to change notification settings - Fork 0
Optimize reorderLists with Supabase RPC bulk update #1
Copy link
Copy link
Open
Description
Problem
reorderLists in ListsContext.tsx currently issues N sequential Supabase .update() calls — one per active list — when the user reorders via drag-and-drop or move up/down. This works but is inefficient for users with many lists.
Proposed Solution
Create a Supabase RPC (PostgreSQL function) that accepts an array of {id, sort_order} pairs and performs a single bulk UPDATE statement. Call this RPC from reorderLists instead of looping.
Acceptance Criteria
- Create a new migration with a
reorder_lists(updates jsonb)RPC function - Update
reorderListsinListsContext.tsxto call the RPC - Verify optimistic UI update still works
- No regressions in custom sort behavior
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels