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
Problem
reorderListsinListsContext.tsxcurrently 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 bulkUPDATEstatement. Call this RPC fromreorderListsinstead of looping.Acceptance Criteria
reorder_lists(updates jsonb)RPC functionreorderListsinListsContext.tsxto call the RPC