fix: eliminate NP overlay stale-song on autoplay and cover-load delay

Three improvements:
- openNowPlaying(): reads NSBridge.getState() (always-fresh @Volatile snapshot)
  via ID search to reconcile S.qIdx before render; fixes NP showing old song
  when deferred evaluateJavascript callbacks haven't fired yet after backgrounding
- onPositionUpdate(): periodic check (~every 2s) detects track mismatch via
  snapshot ID; catches missed/delayed onTrackChanged when NP is open
- updatePlayerUI(): pre-warms next song's 1024px cover so auto-advance NP
  swap is instant from browser cache instead of a 1-second load delay
- styles: add backface-visibility:hidden + isolation:isolate to .np-overlay
  to reduce GPU composite flicker on Android WebView on manual skip

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-28 01:30:55 +02:00
1 parent 050aff6dbe
commit 0788c801fa
3 files changed
+45 -1

No files matched your search

+2
View File
@@ -577,6 +577,8 @@ button:focus{outline:none}
transition:transform .35s cubic-bezier(.4,0,.2,1);
overflow:hidden;
will-change:transform;
backface-visibility:hidden;
isolation:isolate;
}
.np-overlay.open{transform:translateY(0)}