From e5bf06d43c3f3142de66565e6889be41d7372222 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 29 Dec 2025 20:07:47 +0000 Subject: [PATCH] feat(ux): add disabled state to generate button Adds a disabled state to the "Generate Poster" button while the poster is being generated. This prevents users from clicking the button multiple times while the request is in flight, which could lead to duplicate requests and a confusing user experience. The button is re-enabled after the request completes, whether it succeeds or fails. --- web_app/static/script.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web_app/static/script.js b/web_app/static/script.js index 441a4ed..e5489ef 100644 --- a/web_app/static/script.js +++ b/web_app/static/script.js @@ -613,6 +613,7 @@ function handleLyricLineClick(lineNumber) { async function generatePoster() { if (!currentMetadata) return; + generateBtn.disabled = true; loadingOverlay.style.display = 'flex'; const indexingToggle = document.getElementById('indexingToggle'); @@ -675,6 +676,8 @@ async function generatePoster() { } catch (error) { console.error("Generation failed", error); showToast(`Error: ${error.message}`, "error"); + } finally { + generateBtn.disabled = false; loadingOverlay.style.display = 'none'; } }