Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/components/smol/SmolResults.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
let pollIntervalId: ReturnType<typeof setInterval> | null = null;
let retryCount = $state(0);
let isPolling = $state(false);
const MAX_RETRIES = 30; // 30 * 2s = 60s max
const MAX_RETRIES = 120; // 120 * 2s = 4m max for slow generations
const POLL_INTERVAL = 2000;

// Context-aware back navigation
Expand Down Expand Up @@ -289,7 +289,7 @@

if (retryCount >= MAX_RETRIES) {
stopPolling();
error = "Taking longer than expected. Click retry to continue.";
error = "Still generating in the background. Click retry to keep checking.";
loading = false;
return;
}
Expand Down
35 changes: 1 addition & 34 deletions src/pages/[id].astro
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,7 @@ if (id) {
<SmolResults id={id as string} client:only="svelte" />
</div>

{lyricsDisplay.trim().length > 0 && (
<button
id="copy-lyrics-button"
class="fixed bottom-4 right-4 z-40 rounded-md border border-white/20 bg-black/60 px-3 py-1.5 text-xs font-medium text-white backdrop-blur hover:bg-black/75 transition-colors"
type="button"
aria-label="Copy lyrics"
>
Copy lyrics
</button>
)}

<!-- SSR Content for SEO (Visible but unobtrusive) -->
<!-- SSR Content for SEO -->
<div class="sr-only">
Expand All @@ -187,28 +178,4 @@ if (id) {
</div>
</div>

<script is:inline>
const copyLyricsButton = document.getElementById("copy-lyrics-button");
const lyricsToCopy = {JSON.stringify(lyricsDisplay)};

if (copyLyricsButton) {
copyLyricsButton.addEventListener("click", async () => {
if (!lyricsToCopy) return;

try {
await navigator.clipboard.writeText(lyricsToCopy);
copyLyricsButton.textContent = "Copied";
setTimeout(() => {
copyLyricsButton.textContent = "Copy lyrics";
}, 1200);
} catch {
copyLyricsButton.textContent = "Copy failed";
setTimeout(() => {
copyLyricsButton.textContent = "Copy lyrics";
}, 1200);
}
});
}
</script>

</Layout>