fix: reroute file drop to Gutenberg dropzone#50
Conversation
|
Warning Review limit reached
More reviews will be available in 49 minutes and 49 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughDrop-zone file handling is enhanced to support additional block-editor UI controls and improve drop-event targeting. Three complementary changes extend where files can be dropped, refine which element receives the dispatched event, and broaden drop-zone validation to recognize custom data attributes. ChangesDrop Zone File Targeting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
🤖 Pull request artifacts
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/admin/js/media-manager/drop-zone.js`:
- Line 158: The conditional at target?.hasAttribute('data-is-drop-zone') is
inconsistent with the earlier check that requires data-is-drop-zone==="true" and
can wrongly treat data-is-drop-zone="false" as true; update the condition in the
drop-zone detection (the combined if using target?.classList.contains and target
checks) to explicitly check the attribute value (e.g.,
target?.getAttribute('data-is-drop-zone') === 'true') instead of hasAttribute so
both branches use the same strict "true" match (referencing the same
target?.classList.contains('components-drop-zone') /
target?.getAttribute('data-is-drop-zone') === 'true' /
target?.classList.contains('uploader-editor-content') sequence).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 421c43d2-fb71-4668-b831-5f6d15864410
📒 Files selected for processing (1)
src/admin/js/media-manager/drop-zone.js
fixes #51
Summary by CodeRabbit
Release Notes