Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@
## 2024-08-04 - 숫자 μž…λ ₯ ν•„λ“œ 빈 λ¬Έμžμ—΄ μƒνƒœ μ΄ˆκΈ°ν™” 처리
**ν•™μŠ΅:** 숫자 μž…λ ₯ ν•„λ“œμ—μ„œ 빈 λ¬Έμžμ—΄('')을 μž…λ ₯ν•  λ•Œ λΈŒλΌμš°μ €λŠ” μ΄μ „μ˜ μœ νš¨ν•˜μ§€ μ•Šμ€ μƒνƒœλ₯Ό μ•”μ‹œμ μœΌλ‘œ μœ μ§€ν•˜λ―€λ‘œ, μ‚¬μš©μž μ •μ˜ 검증을 λͺ…μ‹œμ μœΌλ‘œ μ΄ˆκΈ°ν™”ν•˜μ§€ μ•ŠμœΌλ©΄ λ„€μ΄ν‹°λΈŒ HTML5 μœ νš¨μ„± 검사가 정상 μž‘λ™ν•˜μ§€ μ•Šμ„ 수 μžˆμŒμ„ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€.
**μ‹€ν–‰:** 인라인 검증 슀크립트 μž‘μ„± μ‹œ 빈 λ¬Έμžμ—΄ μƒνƒœλ₯Ό λ³„λ„λ‘œ ν™•μΈν•˜μ—¬ this.setCustomValidity('') 및 this.removeAttribute('aria-invalid')λ₯Ό λͺ…μ‹œμ μœΌλ‘œ ν˜ΈμΆœν•˜λŠ” λ‘œμ§μ„ μΆ”κ°€ν•΄μ•Ό ν•©λ‹ˆλ‹€.
## 2024-05-15 - Drag-and-drop Visual Feedback
**Learning:** Users lack confidence when dragging files into drop zones if the OS cursor doesn't indicate a valid drop target (e.g., showing a "copy" badge).
**Action:** Always explicitly set `e.dataTransfer.dropEffect = 'copy'` on `dragover` events to provide clear, immediate visual feedback.
16 changes: 14 additions & 2 deletions saas_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,26 @@ async def add_security_headers(request: Request, call_next):
zone.addEventListener(eventName, preventDefaults, false);
});
['dragenter', 'dragover'].forEach(eventName => {
zone.addEventListener(eventName, () => zone.classList.add('dragover'), false);
zone.addEventListener(eventName, (e) => {
zone.classList.add('dragover');
if (e.dataTransfer) {
e.dataTransfer.dropEffect = 'copy';
}
Comment on lines +377 to +379

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟑 Non-file drags show a false copy target

Dragging text over either zone makes dropEffect advertise a copy. The drop handlers ignore drags with no files, so dropping that text does nothing.

Learn more

The two upload zones accept dropped files and populate their file inputs from dataTransfer.files in the single-file drop handler and batch drop handler. A text selection or link has no files, yet its dragover event now gets the same copy cursor as a file drag. This cursor promises a successful drop where neither handler performs any action.

Example: Drag the text meeting notes from another tab onto the batch zone. The cursor displays copy, but releasing it leaves the batch input empty.

Recommended fix: Set dropEffect to copy only when the drag contains file items, using dataTransfer.items or types during dragover because external drags may not expose files until drop. Use none for other drags and keep the file drop handlers unchanged.

Devin Review


Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

}, false);
});
['dragleave', 'drop'].forEach(eventName => {
zone.addEventListener(eventName, () => zone.classList.remove('dragover'), false);
});
});
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
document.body.addEventListener(eventName, preventDefaults, false);
document.body.addEventListener(eventName, (e) => {
preventDefaults(e);
if (eventName === 'dragenter' || eventName === 'dragover') {
if (e.dataTransfer) {
e.dataTransfer.dropEffect = 'none';
}
}
}, false);
});
function preventDefaults (e) {
e.preventDefault();
Expand Down
Loading