🎨 Palette: 빈 숫자 입력 필드에 대한 인라인 유효성 검사 개선 - #338
Conversation
숫자 입력 필드(`target_bytes`, `batch_target_bytes`) 값이 빈 문자열이 될 때 사용자 지정 유효성 검사 오류(`setCustomValidity`)와 `aria-invalid` 상태를 초기화하도록 인라인 검증 로직을 개선했습니다. 필드를 지웠을 때 잘못된 오류가 남아 브라우저 기본 필수(required) 메시지를 덮어쓰고, 스크린 리더 사용자에게 혼란을 주는 문제를 해결했습니다.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
📝 WalkthroughWalkthrough단일 및 배치 대상 크기 입력이 빈 문자열이 되면 미리보기와 사용자 지정 유효성 상태를 초기화합니다. 값이 있으면 기존 양수 검증을 유지합니다. 관련 검증 지침도 업데이트했습니다. Changes대상 크기 입력 검증
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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 `@saas_web.py`:
- Around line 258-262: Update HTML_TEMPLATE event-handler setup so
batch_preset_buttons_container exists before its addEventListener call, either
by moving the script after both forms or registering all handlers after DOM
readiness. Ensure the batch preset handler initializes successfully and does not
prevent the input handlers, including the empty-value initialization in the
affected validation logic, from being registered.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ba7f9504-756f-40a2-b14d-87ccefd84227
📒 Files selected for processing (2)
.jules/palette.mdsaas_web.py
| if (this.value === '') { | ||
| preview.innerText = ''; | ||
| this.setCustomValidity(''); | ||
| this.removeAttribute('aria-invalid'); | ||
| } else if (isNaN(val) || val <= 0) { |
There was a problem hiding this comment.
🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win
이벤트 핸들러 등록 순서를 수정해야 합니다.
현재 HTML_TEMPLATE에서 batch_preset_buttons_container는 스크립트 뒤에 렌더링됩니다. 따라서 Line 213의 document.getElementById(...).addEventListener(...) 호출은 null에서 실행되어 TypeError를 발생시킵니다. 이후 스크립트 실행이 중단되므로 Line 242와 Line 273의 input 핸들러가 등록되지 않고, 이 변경의 빈 값 초기화도 실행되지 않습니다.
스크립트를 두 폼 뒤로 이동하거나, DOM이 준비된 후 모든 이벤트 핸들러를 등록하세요.
Also applies to: 289-293
🤖 Prompt for 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.
In `@saas_web.py` around lines 258 - 262, Update HTML_TEMPLATE event-handler setup
so batch_preset_buttons_container exists before its addEventListener call,
either by moving the script after both forms or registering all handlers after
DOM readiness. Ensure the batch preset handler initializes successfully and does
not prevent the input handlers, including the empty-value initialization in the
affected validation logic, from being registered.
💡 What: 숫자 입력 필드(
target_bytes,batch_target_bytes) 값이 빈 문자열이 될 때 사용자 지정 유효성 검사 오류(setCustomValidity)와aria-invalid상태를 초기화하도록 인라인 검증 로직을 개선했습니다.🎯 Why: 필드를 지웠을 때 잘못된 오류(예: 'Must be greater than 0.')가 남아 브라우저 기본 필수(required) 메시지를 덮어쓰고, 스크린 리더 사용자에게 혼란을 주는 문제를 해결하기 위함입니다.
📸 Before/After: 해당 없음 (시각적 상태 및 화면 판독기 알림 개선)
♿ Accessibility: 스크린 리더 사용자가 빈 필수 입력 필드에서 잘못된 유효성 오류 메시지를 듣는 것을 방지하여 폼 접근성을 개선했습니다.
PR created automatically by Jules for task 15265761223055312840 started by @seonghobae
Summary by CodeRabbit