Skip to content

🎨 Palette: 빈 숫자 입력 필드에 대한 인라인 유효성 검사 개선 - #338

Open
seonghobae wants to merge 1 commit into
mainfrom
palette-fix-empty-numeric-input-validation-15265761223055312840
Open

🎨 Palette: 빈 숫자 입력 필드에 대한 인라인 유효성 검사 개선#338
seonghobae wants to merge 1 commit into
mainfrom
palette-fix-empty-numeric-input-validation-15265761223055312840

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

💡 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

  • 버그 수정
    • 크기 입력란을 비웠을 때 사용자 지정 오류와 잘못된 입력 표시가 초기화됩니다.
    • 단일 및 일괄 파일 입력에서 빈 값은 오류로 표시되지 않습니다.
    • 값이 입력된 경우 기존의 양수 여부 검증과 오류 안내는 그대로 유지됩니다.

숫자 입력 필드(`target_bytes`, `batch_target_bytes`) 값이 빈 문자열이 될 때 사용자 지정 유효성 검사 오류(`setCustomValidity`)와 `aria-invalid` 상태를 초기화하도록 인라인 검증 로직을 개선했습니다. 필드를 지웠을 때 잘못된 오류가 남아 브라우저 기본 필수(required) 메시지를 덮어쓰고, 스크린 리더 사용자에게 혼란을 주는 문제를 해결했습니다.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

단일 및 배치 대상 크기 입력이 빈 문자열이 되면 미리보기와 사용자 지정 유효성 상태를 초기화합니다. 값이 있으면 기존 양수 검증을 유지합니다. 관련 검증 지침도 업데이트했습니다.

Changes

대상 크기 입력 검증

Layer / File(s) Summary
빈 값 검증 상태 초기화
saas_web.py, .jules/palette.md
단일 및 배치 입력이 비어 있으면 미리보기, setCustomValidity(''), aria-invalid 상태를 초기화합니다. 값이 있으면 기존 양수 검증을 수행합니다. 검증 지침에 같은 동작을 추가합니다.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 숫자 입력 필드의 인라인 유효성 검사 개선이라는 주요 변경 사항을 정확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette-fix-empty-numeric-input-validation-15265761223055312840

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5a92586 and 50b0d69.

📒 Files selected for processing (2)
  • .jules/palette.md
  • saas_web.py

Comment thread saas_web.py
Comment on lines +258 to +262
if (this.value === '') {
preview.innerText = '';
this.setCustomValidity('');
this.removeAttribute('aria-invalid');
} else if (isNaN(val) || val <= 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant