From 456996aa7787901953183af462557d6b099bd4d4 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Tue, 14 Jul 2026 17:33:37 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20=ED=8F=BC=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=ED=95=84=EB=93=9C=EA=B0=80=20=EB=B9=84?= =?UTF-8?q?=EC=9B=8C=EC=A7=88=20=EB=95=8C=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .jules/palette.md | 3 +++ saas_web.py | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.jules/palette.md b/.jules/palette.md index a1cf208..649985c 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -74,3 +74,6 @@ ## 2024-07-13 - 일괄 업로드 폼에 프리셋 버튼 및 파일 크기 미리보기 추가 **Learning:** 일괄 파일 업로드 폼에서 대상 바이트(target_bytes) 입력 필드만 제공하면 사용자가 원하는 용량을 바이트 단위로 정확히 계산하기 어려워 사용성이 떨어집니다. 사용자가 여러 파일을 업로드할 때 총 파일 크기를 파악하지 못해 업로드 제한을 초과하거나 잘못된 대상 바이트를 설정할 위험이 큽니다. **Action:** 일괄 파일 업로드 폼에도 단일 파일 업로드 폼과 동일하게 대상 바이트를 쉽게 선택할 수 있는 빠른 프리셋 버튼을 추가하고, `onchange` 이벤트 발생 시 선택된 모든 파일의 크기를 합산하여 사람이 읽기 쉬운 단위(MiB, GiB 등)로 미리보기를 제공하도록 JavaScript 로직을 개선했습니다. +## 2024-07-15 - Handle Empty Input State in Numeric Validation +**Learning:** When using JavaScript to validate numeric inputs (e.g., parsing with `parseInt`), an empty input field is parsed as `NaN`. If `isNaN` checks are not explicitly guarded against an empty string, clearing the input field will prematurely trigger a validation error (e.g., "Must be greater than 0"), rather than letting HTML5's native `required` attribute handle the empty state smoothly. +**Action:** When implementing JavaScript inline validation for numeric inputs, explicitly handle the empty string state (e.g., `if (this.value === '')`) to clear custom errors and `innerText` before applying `isNaN` checks. diff --git a/saas_web.py b/saas_web.py index 3a7b035..047520b 100644 --- a/saas_web.py +++ b/saas_web.py @@ -255,7 +255,9 @@ async def add_security_headers(request: Request, call_next): ); }); - if (isNaN(val) || val <= 0) { + if (this.value === '') { + preview.innerText = ''; + } else if (isNaN(val) || val <= 0) { preview.innerText = 'Must be greater than 0.'; preview.style.color = '#dc3545'; this.setCustomValidity('Must be greater than 0.'); @@ -282,7 +284,9 @@ async def add_security_headers(request: Request, call_next): ); }); - if (isNaN(val) || val <= 0) { + if (this.value === '') { + preview.innerText = ''; + } else if (isNaN(val) || val <= 0) { preview.innerText = 'Must be greater than 0.'; preview.style.color = '#dc3545'; this.setCustomValidity('Must be greater than 0.'); From 7b5df05fcc733d39e7689a5a60fd48c6d14e6961 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Tue, 14 Jul 2026 18:27:45 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=ED=95=84=EB=93=9C=EA=B0=80=20=EB=B9=84=EC=96=B4?= =?UTF-8?q?=EC=9E=88=EC=9D=84=20=EB=95=8C=20=EC=9E=98=EB=AA=BB=EB=90=9C=20?= =?UTF-8?q?=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80=20=ED=91=9C=EC=8B=9C=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 5eec75bbcd0f14c94e47aad5a1a6ccda3a2d1432 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Tue, 14 Jul 2026 19:12:19 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=ED=95=84=EB=93=9C=EA=B0=80=20=EB=B9=84=EC=96=B4?= =?UTF-8?q?=EC=9E=88=EC=9D=84=20=EB=95=8C=20=EC=9E=98=EB=AA=BB=EB=90=9C=20?= =?UTF-8?q?=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80=20=ED=91=9C=EC=8B=9C=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 3b1be2930cd4bf46866e6151f23bafd3a7017829 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Tue, 14 Jul 2026 19:48:22 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=ED=95=84=EB=93=9C=EA=B0=80=20=EB=B9=84=EC=96=B4?= =?UTF-8?q?=EC=9E=88=EC=9D=84=20=EB=95=8C=20=EC=9E=98=EB=AA=BB=EB=90=9C=20?= =?UTF-8?q?=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80=20=ED=91=9C=EC=8B=9C=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit