-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: decompose handleDragEnd into focused sub-handlers (#64) #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Extract 4 helpers from the 285-line handleDragEnd: - recordColumnHistory(): shared undo history recording - handleNewRowDrop(): column dropped on new row zone - handleColumnInsertDrop(): column dropped on empty grid cell - handleColumnSwap(): column dropped on another column handleDragEnd is now a ~60-line dispatcher that delegates to the appropriate sub-handler based on drag type and drop target.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 Morph Preview Test⚡ Looks like you hit your rate limits! Please upgrade your limits here, or wait a few minutes and try again. If you need help, reach out to support@morphllm.com. Automated testing by Morph |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #107 +/- ##
==========================================
+ Coverage 74.46% 74.63% +0.17%
==========================================
Files 120 120
Lines 3881 3880 -1
Branches 1063 1035 -28
==========================================
+ Hits 2890 2896 +6
+ Misses 968 961 -7
Partials 23 23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🧪 E2E Coverage Report (Sharded: 12 parallel jobs)
📊 Full report available in workflow artifacts |
Summary
recordColumnHistory()helper to deduplicate 3 identical undo-history blockshandleNewRowDrop()for column → new row zone dropshandleColumnInsertDrop()for column → empty grid cell dropshandleColumnSwap()for column → column swap dropshandleDragEndis now a ~60-line dispatcher (was 285 lines)All helpers use
useCallbackfor stable references. No behavioral changes.Closes #64
Test plan
pnpm test— all 1202 tests passpnpm typecheck— cleanpnpm lint— cleanpnpm e2e— verify DnD operations work correctly