From 7ad4bbb332b363e86f832c586b7d3ca47e44274d Mon Sep 17 00:00:00 2001 From: meowarex Date: Sat, 28 Feb 2026 21:33:44 +1100 Subject: [PATCH] Hotfix #7000... --- plugins/radiant-lyrics-luna/src/index.ts | 38 +++++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/plugins/radiant-lyrics-luna/src/index.ts b/plugins/radiant-lyrics-luna/src/index.ts index 7853a11..0988d10 100644 --- a/plugins/radiant-lyrics-luna/src/index.ts +++ b/plugins/radiant-lyrics-luna/src/index.ts @@ -1273,6 +1273,9 @@ const tryActivateStickyLyricsTab = (): boolean => { if (!lyricsTab) return false; + // Already active — nothing to do + if (lyricsTab.getAttribute("aria-selected") === "true") return true; + if (lyricsTab.getAttribute("data-rl-injected") === "true") { showInjectedLyricsTab(); } else { @@ -1801,6 +1804,9 @@ const clearLineSlideTimers = (): void => { lineSlideTimers.clear(); }; +// Defer blur until the first lyric activates each track +let blurActivated = false; + // Scroll sync (unhook on user scroll) let scrollSynced = true; let userScrollListener: (() => void) | null = null; @@ -2395,7 +2401,8 @@ const buildWordSpans = (): { // create lyrics container for word/syllable lines const wbwContainer = document.createElement("div"); wbwContainer.className = "rl-wbw-container"; - if (settings.blurInactive) wbwContainer.classList.add("rl-blur-active"); + if (settings.blurInactive && blurActivated) + wbwContainer.classList.add("rl-blur-active"); if (settings.bubbledLyrics) wbwContainer.classList.add("rl-bubbled"); const effectiveStyle = getLyricsStyle(); const allowWordSylStyles = isWordMode(); @@ -2727,7 +2734,8 @@ const buildTidalLines = ( const wbwContainer = document.createElement("div"); wbwContainer.className = "rl-wbw-container"; - if (settings.blurInactive) wbwContainer.classList.add("rl-blur-active"); + if (settings.blurInactive && blurActivated) + wbwContainer.classList.add("rl-blur-active"); if (settings.bubbledLyrics) wbwContainer.classList.add("rl-bubbled"); forceStyle(wbwContainer, { display: "block", @@ -2875,6 +2883,13 @@ const updateTidalFollowActiveLine = (): void => { primaryLineIdx = activeIndex; activeLineIdxs = newActiveSet; + if (settings.blurInactive && !blurActivated) { + blurActivated = true; + document + .querySelector(".rl-wbw-container") + ?.classList.add("rl-blur-active"); + } + if (settings.blurInactive) { for (let i = 0; i < lines.length; i++) { lines[i].el.classList.remove( @@ -3015,6 +3030,7 @@ const teardown = (): void => { unhookSyncButton(); unlockScroll(); scrollSynced = true; + blurActivated = false; isActive = false; lyricsMode = "none"; lyricsData = null; @@ -3132,7 +3148,7 @@ const scrollToActiveLine = (): void => { // Resync lyric scroll (scrubbing and lyric jumps) const resync = (): void => { scrollSynced = true; - if (settings.blurInactive) { + if (settings.blurInactive && blurActivated) { document .querySelector(".rl-wbw-container") ?.classList.add("rl-blur-active"); @@ -3340,6 +3356,14 @@ const startTickLoop = (): void => { } } + // activate blur on first lyric of the track + if (settings.blurInactive && !blurActivated && newActiveSet.size > 0) { + blurActivated = true; + document + .querySelector(".rl-wbw-container") + ?.classList.add("rl-blur-active"); + } + // instrumental gaps, keep the last-active line unblurred if (settings.blurInactive) { if ( @@ -3612,14 +3636,6 @@ const onTrackChange = async (): Promise => { } if (injectedTabEl && settings.stickyLyrics) { showInjectedLyricsTab(); - safeTimeout( - unloads, - () => { - if (!settings.stickyLyrics || token !== trackChangeToken) return; - showInjectedLyricsTab(); - }, - 180, - ); } lyricsData = response.type === "Word"