Drag & Drop from local desktop#236
Conversation
…he host OS - Add `manager.ts` to manage drag-and-drop file uploads in Desktop Mode. - Introduce type definitions in `types.ts` for file drop handling. - Create `upload.ts` to handle file uploads via `wp/v2/media` with multipart form-data. - Implement unit tests for the file drop manager and upload functionality in `os-file-drop-manager.test.ts` and `os-file-drop-upload.test.ts`. - Ensure proper handling of file type validation, size limits, and user feedback for rejected files.
|
@claude can you review? |
|
Claude finished @AllTerrainDeveloper's task in 2m 21s —— View job Code Review — PR #236: Drag drop from local desktop
This is a well-structured feature. The architecture (lazy dialog, sentinel-based idempotency, hook pipeline, server-sourced allowed-mime config) follows the established patterns in this codebase correctly. The security model around postMessage is sound. Below are the issues I found, ordered by severity. Bugs / Correctness1. Dead event listener in modal.addEventListener( 'remove', () => resolve(), { once: true } );
2. Duplicate JSDoc on Two consecutive 3. Misplaced // (two functions defined above this line)
import type { DropConfig } from './types'; // ← mid-fileThis Code Quality4.
5. Passthrough selectors copied in three places
6. No cap on file count A user dragging a 200-file selection from Finder would get a 200-entry modal with no feedback. A defensive Internationalization7. Hardcoded English strings throughout Both Security (things done well)
Minor nitpick
SummaryThe feature is architecturally sound and follows the codebase's conventions well. The four items I'd prioritize before merging are: the dead |
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Drag.and.drop.mov