Skip to content
Closed
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 @@ -74,3 +74,6 @@
## 2024-07-13 - 일괄 μ—…λ‘œλ“œ 폼에 프리셋 λ²„νŠΌ 및 파일 크기 미리보기 μΆ”κ°€
**Learning:** 일괄 파일 μ—…λ‘œλ“œ νΌμ—μ„œ λŒ€μƒ λ°”μ΄νŠΈ(target_bytes) μž…λ ₯ ν•„λ“œλ§Œ μ œκ³΅ν•˜λ©΄ μ‚¬μš©μžκ°€ μ›ν•˜λŠ” μš©λŸ‰μ„ λ°”μ΄νŠΈ λ‹¨μœ„λ‘œ μ •ν™•νžˆ κ³„μ‚°ν•˜κΈ° μ–΄λ €μ›Œ μ‚¬μš©μ„±μ΄ λ–¨μ–΄μ§‘λ‹ˆλ‹€. μ‚¬μš©μžκ°€ μ—¬λŸ¬ νŒŒμΌμ„ μ—…λ‘œλ“œν•  λ•Œ 총 파일 크기λ₯Ό νŒŒμ•…ν•˜μ§€ λͺ»ν•΄ μ—…λ‘œλ“œ μ œν•œμ„ μ΄ˆκ³Όν•˜κ±°λ‚˜ 잘λͺ»λœ λŒ€μƒ λ°”μ΄νŠΈλ₯Ό μ„€μ •ν•  μœ„ν—˜μ΄ ν½λ‹ˆλ‹€.
**Action:** 일괄 파일 μ—…λ‘œλ“œ 폼에도 단일 파일 μ—…λ‘œλ“œ 폼과 λ™μΌν•˜κ²Œ λŒ€μƒ λ°”μ΄νŠΈλ₯Ό μ‰½κ²Œ 선택할 수 μžˆλŠ” λΉ λ₯Έ 프리셋 λ²„νŠΌμ„ μΆ”κ°€ν•˜κ³ , `onchange` 이벀트 λ°œμƒ μ‹œ μ„ νƒλœ λͺ¨λ“  파일의 크기λ₯Ό ν•©μ‚°ν•˜μ—¬ μ‚¬λžŒμ΄ 읽기 μ‰¬μš΄ λ‹¨μœ„(MiB, GiB λ“±)둜 미리보기λ₯Ό μ œκ³΅ν•˜λ„λ‘ JavaScript λ‘œμ§μ„ κ°œμ„ ν–ˆμŠ΅λ‹ˆλ‹€.
## 2025-02-23 - 숫자 μž…λ ₯ ν•„λ“œ 비움 μƒνƒœμ—μ„œμ˜ 인라인 μœ νš¨μ„± 검사 UX κ°œμ„ 
**Learning:** 숫자 μž…λ ₯ ν•„λ“œμ— 인라인 μœ νš¨μ„± 검사λ₯Ό κ΅¬ν˜„ν•  λ•Œ, μ‚¬μš©μžκ°€ ν•„λ“œλ₯Ό μ™„μ „νžˆ λΉ„μš°λ©΄ `parseInt`κ°€ `NaN`을 λ°˜ν™˜ν•˜μ—¬ λ„€μ΄ν‹°λΈŒ HTML5 ν•„μˆ˜(`required`) 검증이 μž‘λ™ν•˜κΈ° 전에 μ»€μŠ€ν…€ 였λ₯˜ λ©”μ‹œμ§€κ°€ λ„ˆλ¬΄ 빨리 λ‚˜νƒ€λ‚˜λŠ” λ¬Έμ œκ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.
**Action:** `input` 이벀트 λ¦¬μŠ€λ„ˆμ—μ„œ 빈 λ¬Έμžμ—΄(`this.value === ''`)을 λͺ…μ‹œμ μœΌλ‘œ ν™•μΈν•˜κ³  μ»€μŠ€ν…€ 였λ₯˜λ₯Ό μ§€μ›Œμ£Όμ–΄ κΈ°λ³Έ λΈŒλΌμš°μ € μœ νš¨μ„± 검사가 λ¨Όμ € μž‘λ™ν•  수 μžˆλ„λ‘ κ΅¬ν˜„ν•©λ‹ˆλ‹€.
12 changes: 10 additions & 2 deletions saas_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ async def add_security_headers(request: Request, call_next):
);
});

if (isNaN(val) || val <= 0) {
if (this.value === '') {
preview.innerText = '';
this.setCustomValidity('');
this.removeAttribute('aria-invalid');
} else if (isNaN(val) || val <= 0) {
preview.innerText = 'Must be greater than 0.';
preview.style.color = '#dc3545';
this.setCustomValidity('Must be greater than 0.');
Expand All @@ -282,7 +286,11 @@ async def add_security_headers(request: Request, call_next):
);
});

if (isNaN(val) || val <= 0) {
if (this.value === '') {
preview.innerText = '';
this.setCustomValidity('');
this.removeAttribute('aria-invalid');
} else if (isNaN(val) || val <= 0) {
preview.innerText = 'Must be greater than 0.';
preview.style.color = '#dc3545';
this.setCustomValidity('Must be greater than 0.');
Expand Down
Loading