From 8add62a5029f877d8e46c6ba07c541c3d51c82de Mon Sep 17 00:00:00 2001 From: Psychotoxical Date: Tue, 7 Apr 2026 12:30:32 +0200 Subject: [PATCH] perf(lyrics): fix CPU spikes during lyric transitions; fix release workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CSS: remove `font-weight` from transition list on `.fs-lyric-line` — it triggers layout reflow on every animation frame when the active line changes. Replaced with `transform: scaleX(1.015)` on `.fsl-active` (compositor-only). Added `contain: layout style` to `.fs-lyrics-overlay` to isolate reflows. Cargo.lock: update for thread-priority crate (added in previous audio commit). CI: replace delete-asset workaround with `updaterJsonKeepUniversal: false` to prevent tauri-action from uploading a latest.json with wrong signature. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release.yml | 14 ++++---------- src-tauri/Cargo.lock | 17 ++++++++++++++++- src/styles/components.css | 8 ++++++-- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c11a34ad..9ee7c35a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,16 +124,10 @@ jobs: with: releaseId: ${{ needs.create-release.outputs.release_id }} args: ${{ matrix.settings.args }} - - # tauri-action auto-generates a latest.json using the pubkey from tauri.conf.json - # as the signature value (wrong). Delete it so only our generate-update-manifest.js - # output is ever used as the canonical update manifest. - - name: remove tauri-action generated update manifest - shell: bash - run: | - gh release delete-asset ${{ github.ref_name }} latest.json --yes || true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Prevent tauri-action from auto-uploading a latest.json that uses + # the PUBLIC KEY as the signature value. Our generate-update-manifest.js + # builds the correct manifest with real .sig file contents. + updaterJsonKeepUniversal: false - name: sign and upload Windows NSIS updater bundle if: matrix.settings.platform == 'windows-latest' diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 1dfbb56a..6c638d16 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -3442,6 +3442,7 @@ dependencies = [ "tauri-plugin-store", "tauri-plugin-updater", "tauri-plugin-window-state", + "thread-priority", "tokio", "url", ] @@ -3513,7 +3514,7 @@ dependencies = [ "once_cell", "socket2 0.6.3", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -5295,6 +5296,20 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "thread-priority" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe075d7053dae61ac5413a34ea7d4913b6e6207844fd726bdd858b37ff72bf5" +dependencies = [ + "bitflags 2.11.0", + "cfg-if", + "libc", + "log", + "rustversion", + "winapi", +] + [[package]] name = "time" version = "0.3.45" diff --git a/src/styles/components.css b/src/styles/components.css index eb725cb3..17e46a8f 100644 --- a/src/styles/components.css +++ b/src/styles/components.css @@ -3260,6 +3260,7 @@ z-index: 3; overflow: hidden; pointer-events: none; + contain: layout style; /* isolate reflows from rest of page */ /* Fade first and last slot (each 3.6/18 = 20% of container) */ -webkit-mask-image: linear-gradient( @@ -3300,7 +3301,9 @@ font-weight: 400; cursor: pointer; pointer-events: auto; - transition: color 280ms ease, font-weight 280ms ease, text-shadow 280ms ease; + /* font-weight intentionally NOT transitioned — triggers layout reflow on every frame */ + transition: color 280ms ease, text-shadow 280ms ease, transform 280ms ease; + transform-origin: left center; user-select: none; } @@ -3312,11 +3315,12 @@ color: rgba(255, 255, 255, 0.1); } -/* Active: emphasis via weight + glow only, height stays 44px */ +/* Active: emphasis via scale + glow; font-weight snaps instantly (no layout-reflow transition) */ .fs-lyric-line.fsl-active { font-weight: 600; color: rgba(255, 255, 255, 0.95); text-shadow: 0 0 28px var(--accent-glow, var(--accent)), 0 1px 8px rgba(0, 0, 0, 0.6); + transform: scaleX(1.015); /* subtle compositor-only emphasis, no layout cost */ }