-
Notifications
You must be signed in to change notification settings - Fork 0
π¨ Palette: [UX improvement] νμ μ λ ₯ νλ λΉμΈ λ λͺ νν νΌλλ°± μ 곡 #488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| --- saas_web.py | ||
| +++ saas_web.py | ||
| @@ -226,7 +226,10 @@ | ||
| input.removeAttribute('aria-invalid'); | ||
| preview.style.color = '#0f6674'; | ||
| if (!file) { | ||
| - preview.innerText = ''; | ||
| + preview.innerText = 'This field is required.'; | ||
| + preview.style.color = '#dc3545'; | ||
| + input.setCustomValidity('This field is required.'); | ||
| + input.setAttribute('aria-invalid', 'true'); | ||
| return; | ||
| } | ||
| const text = formatBinaryBytes(file.size); | ||
| @@ -257,9 +260,10 @@ | ||
| }); | ||
|
|
||
| if (this.value === '') { | ||
| - preview.innerText = ''; | ||
| - this.setCustomValidity(''); | ||
| - this.removeAttribute('aria-invalid'); | ||
| + preview.innerText = 'This field is required.'; | ||
| + preview.style.color = '#dc3545'; | ||
| + this.setCustomValidity('This field is required.'); | ||
| + this.setAttribute('aria-invalid', 'true'); | ||
| return; | ||
| } | ||
|
|
||
| @@ -288,9 +292,10 @@ | ||
| }); | ||
|
|
||
| if (this.value === '') { | ||
| - preview.innerText = ''; | ||
| - this.setCustomValidity(''); | ||
| - this.removeAttribute('aria-invalid'); | ||
| + preview.innerText = 'This field is required.'; | ||
| + preview.style.color = '#dc3545'; | ||
| + this.setCustomValidity('This field is required.'); | ||
| + this.setAttribute('aria-invalid', 'true'); | ||
| return; | ||
| } | ||
|
|
||
| @@ -321,7 +326,10 @@ | ||
|
|
||
| const files = input.files; | ||
| if (!files || files.length === 0) { | ||
| - preview.innerText = ''; | ||
| + preview.innerText = 'This field is required.'; | ||
| + preview.style.color = '#dc3545'; | ||
| + input.setCustomValidity('This field is required.'); | ||
| + input.setAttribute('aria-invalid', 'true'); | ||
| return; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- tests/test_saas_web.py | ||
| +++ tests/test_saas_web.py | ||
| @@ -58,6 +58,16 @@ | ||
| self.assertIn('onchange="updateBatchFilePreview(this)"', html) | ||
| self.assertIn('id="batch_files_preview"', html) | ||
| self.assertIn("function updateBatchFilePreview(input)", html) | ||
| + | ||
| + def test_get_ui_includes_required_validation(self): | ||
| + response = client.get("/") | ||
| + self.assertEqual(response.status_code, 200) | ||
| + html = response.text | ||
| + | ||
| + # Test that required field logic is verified via presence of aria-invalid when empty | ||
| + self.assertIn("preview.innerText = 'This field is required.';", html) | ||
| + self.assertIn("input.setCustomValidity('This field is required.');", html) | ||
| + self.assertEqual(html.count("preview.innerText = 'This field is required.';"), 4) | ||
|
|
||
| def test_get_ui_includes_drag_and_drop_zones(self): | ||
| response = client.get("/") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- tests/test_saas_web.py | ||
| +++ tests/test_saas_web.py | ||
| @@ -58,6 +58,16 @@ | ||
| self.assertIn('onchange="updateBatchFilePreview(this)"', html) | ||
| self.assertIn('id="batch_files_preview"', html) | ||
| self.assertIn("function updateBatchFilePreview(input)", html) | ||
| + | ||
| + def test_get_ui_includes_required_validation(self): | ||
| + response = client.get("/") | ||
| + self.assertEqual(response.status_code, 200) | ||
| + html = response.text | ||
| + | ||
| + # Test that required field logic is verified via presence of aria-invalid when empty | ||
| + self.assertIn("preview.innerText = 'This field is required.';", html) | ||
| + self.assertIn("input.setCustomValidity('This field is required.');", html) | ||
| + self.assertEqual(html.count("preview.innerText = 'This field is required.';"), 4) | ||
|
|
||
| def test_get_ui_includes_drag_and_drop_zones(self): | ||
| response = client.get("/") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -225,7 +225,10 @@ async def add_security_headers(request: Request, call_next): | |
| input.removeAttribute('aria-invalid'); | ||
| preview.style.color = '#0f6674'; | ||
| if (!file) { | ||
| preview.innerText = ''; | ||
| preview.innerText = 'This field is required.'; | ||
| preview.style.color = '#dc3545'; | ||
| input.setCustomValidity('This field is required.'); | ||
| input.setAttribute('aria-invalid', 'true'); | ||
|
Comment on lines
+228
to
+231
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π― Functional Correctness | π‘ Minor | β‘ Quick win μ΄κΈ° λΉ νμΌμ μ μΆ κ²½λ‘λ μ²λ¦¬νμΈμ. μ¬μ©μκ° νμΌμ μ ννμ§ μκ³ λ°λ‘ μ μΆνλ©΄ Also applies to: 332-335 π€ Prompt for AI Agents |
||
| return; | ||
|
Comment on lines
227
to
232
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π Info: Required-message change is consistent across handlers The four empty-state branches in updateFileSizePreview, the two numeric Was this helpful? React with π or π to provide feedback. |
||
| } | ||
| const text = formatBinaryBytes(file.size); | ||
|
|
@@ -257,9 +260,10 @@ async def add_security_headers(request: Request, call_next): | |
| }); | ||
|
|
||
| if (this.value === '') { | ||
| preview.innerText = ''; | ||
| this.setCustomValidity(''); | ||
| this.removeAttribute('aria-invalid'); | ||
| preview.innerText = 'This field is required.'; | ||
| preview.style.color = '#dc3545'; | ||
| this.setCustomValidity('This field is required.'); | ||
| this.setAttribute('aria-invalid', 'true'); | ||
|
Comment on lines
+263
to
+266
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π©Ί Stability & Availability | π Major | β‘ Quick win μ΄κΈ°ν μμλ₯Ό μμ νμ¬ κ²μ¦ νΈλ€λ¬λ₯Ό λ±λ‘νμΈμ. HTML μ€ν¬λ¦½νΈλ λ°°μΉ νΌμ΄ μμ±λκΈ° μ μ Also applies to: 298-301 π€ Prompt for AI Agents |
||
| return; | ||
| } | ||
|
|
||
|
|
@@ -291,9 +295,10 @@ async def add_security_headers(request: Request, call_next): | |
| }); | ||
|
|
||
| if (this.value === '') { | ||
| preview.innerText = ''; | ||
| this.setCustomValidity(''); | ||
| this.removeAttribute('aria-invalid'); | ||
| preview.innerText = 'This field is required.'; | ||
| preview.style.color = '#dc3545'; | ||
| this.setCustomValidity('This field is required.'); | ||
| this.setAttribute('aria-invalid', 'true'); | ||
| return; | ||
| } | ||
|
|
||
|
|
@@ -324,7 +329,10 @@ async def add_security_headers(request: Request, call_next): | |
|
|
||
| const files = input.files; | ||
| if (!files || files.length === 0) { | ||
| preview.innerText = ''; | ||
| preview.innerText = 'This field is required.'; | ||
| preview.style.color = '#dc3545'; | ||
| input.setCustomValidity('This field is required.'); | ||
| input.setAttribute('aria-invalid', 'true'); | ||
| return; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π‘ Raw patch artifacts committed to repo root
patch.diff, patch_test.diff, and patch_test2.diff are raw unified-diff files added at the repo root; the two test diffs are byte-identical duplicates. They are development leftovers, not source, and do not belong in the tree.
Prompt for agents
Was this helpful? React with π or π to provide feedback.