mirror of
https://github.com/paperclipai/paperclip
synced 2026-03-25 11:21:48 +00:00
The orderedIds state was initialized at mount time when companies was still an empty array (React Query hadn't resolved yet). When companies data arrived, orderedIds remained empty so the sidebar fell back to API-returned order, ignoring the user's saved drag order. Add a useEffect that re-derives orderedIds from localStorage whenever the companies array changes, ensuring the user's custom sort order persists across data refetches and live update invalidations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>