Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This journal is for Palette's critical UX/accessibility learnings only.

**Format:**
`## YYYY-MM-DD - [Title]`
`**Learning:** [UX/a11y insight]`
`**Action:** [How to apply next time]`
4 changes: 0 additions & 4 deletions web_app/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ <h2>Poster</h2>
</main>
</div>
<div id="toastContainer" class="toast-container"></div>
<div id="loadingOverlay" class="loading-overlay" style="display: none;">
<div class="spinner"></div>
<p>Generating your masterpiece...</p>
</div>
<script src="/static/script.js?v=21"></script>
</body>

Expand Down
21 changes: 17 additions & 4 deletions web_app/static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,16 @@ function handleLyricLineClick(lineNumber) {
async function generatePoster() {
if (!currentMetadata) return;

loadingOverlay.style.display = 'flex';
const originalButtonHTML = generateBtn.innerHTML;
generateBtn.disabled = true;
generateBtn.classList.add('loading');
generateBtn.innerHTML = `<span class="spinner-small"></span>Generating...`;

const restoreButton = () => {
generateBtn.disabled = false;
generateBtn.classList.remove('loading');
generateBtn.innerHTML = originalButtonHTML;
};

const indexingToggle = document.getElementById('indexingToggle');
const accentToggle = document.getElementById('accentToggle');
Expand All @@ -635,8 +644,8 @@ async function generatePoster() {
const end = endVal;

if (isNaN(start) || isNaN(end) || start >= end) {
loadingOverlay.style.display = 'none';
showToast("Please enter a valid range (Start must be less than End).", "error");
restoreButton();
return;
}

Expand Down Expand Up @@ -669,13 +678,17 @@ async function generatePoster() {
posterContainer.innerHTML = '';
posterContainer.appendChild(img);
showDownloadButton(imageUrl, data.filename);
loadingOverlay.style.display = 'none';
restoreButton();
};
img.onerror = () => {
showToast("Error: Failed to load the generated poster image.", "error");
restoreButton();
};

} catch (error) {
console.error("Generation failed", error);
showToast(`Error: ${error.message}`, "error");
loadingOverlay.style.display = 'none';
restoreButton();
}
}

Expand Down
22 changes: 22 additions & 0 deletions web_app/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -908,4 +908,26 @@ input:focus {

.result-action svg {
pointer-events: none;
}

/* --- Button Loading State --- */
.primary-btn.loading {
cursor: wait;
opacity: 0.8;
pointer-events: none;
}

.primary-btn.loading .spinner-small {
display: inline-block;
margin-right: 8px; /* space between spinner and text */
}

.spinner-small {
display: none; /* hidden by default */
width: 20px;
height: 20px;
border: 2px solid rgba(0, 0, 0, 0.3);
border-top-color: #1a1a1f;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}