fix: seq becoming NaN when moving requests to collection root#6727
Conversation
WalkthroughBug fix to drag-and-drop handling in collection item reordering. Changed seq computation from using item index to using sequence value for adjacent drops, and added guard to prevent moving root items to collection root, resolving NaN seq assignment issues. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (CODING_STANDARDS.md)
Files:
🧠 Learnings (1)📚 Learning: 2025-12-17T21:41:24.730ZApplied to files:
🧬 Code graph analysis (1)packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
BRU-2443
Fixes: #6232
Cause:
Logic inside handleCollectionItemDrop function used
findIndex(returns a number) instead offind(returns the item), so accessing.seqon the index returnedundefined, which becameNaN.Fix:
findIndextofindto get the item'sseq.