From 7fe163ff5f8b5bfdf29c8d8003cdb1feff14fd41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20LONLAS?= Date: Sat, 27 Jun 2026 09:35:03 +0800 Subject: [PATCH] fix(web): align sanitizeSteps NaN fallback with STEPS_MIN (#2) When a non-numeric value reached sanitizeSteps(), the NaN branch fell back to a hardcoded 8 instead of STEPS_MIN (1). This was inconsistent with sanitizeDimension() (which falls back to DIM_MIN) and with the Python backend's _sanitize_steps(), which clamps invalid input to STEPS_MIN. A user clearing the steps field could see a different value applied client-side than the server would compute. Co-authored-by: Claude Opus 4.8 --- web/image_profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/image_profile.js b/web/image_profile.js index 8a2ad27..16db845 100644 --- a/web/image_profile.js +++ b/web/image_profile.js @@ -452,7 +452,7 @@ function sanitizeDimension(value) { function sanitizeSteps(value) { let integer = Number.parseInt(value, 10); if (Number.isNaN(integer)) { - integer = 8; + integer = STEPS_MIN; } const nextValue = clamp(integer, STEPS_MIN, STEPS_MAX);