mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 23:35:44 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f9f9167c4 | |||
| 21033e82f4 | |||
| c7407af05b | |||
| 159973fb16 | |||
| 5913d20cc2 |
Generated
+3
-3
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1776877367,
|
||||
"narHash": "sha256-EHq1/OX139R1RvBzOJ0aMRT3xnWyqtHBRUBuO1gFzjI=",
|
||||
"lastModified": 1777578337,
|
||||
"narHash": "sha256-Ad49moKWeXtKBJNy2ebiTQUEgdLyvGmTeykAQ9xM+Z4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0726a0ecb6d4e08f6adced58726b95db924cef57",
|
||||
"rev": "15f4ee454b1dce334612fa6843b3e05cf546efab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"npmDepsHash": "sha256-7mSqNSw7KApMERXzhW/Ta7j1wLf55mxBEf3pWs2aaic="
|
||||
"npmDepsHash": "sha256-WXfc5WsypV2HdUTaZLDzPN9OdgLq18/hcJVvKCn3LTU="
|
||||
}
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "psysonic",
|
||||
"version": "1.45.0-dev",
|
||||
"version": "1.45.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "psysonic",
|
||||
"version": "1.45.0-dev",
|
||||
"version": "1.45.0",
|
||||
"dependencies": {
|
||||
"@fontsource-variable/dm-sans": "^5.2.8",
|
||||
"@fontsource-variable/figtree": "^5.2.10",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "psysonic",
|
||||
"version": "1.45.0-dev",
|
||||
"version": "1.45.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "psysonic"
|
||||
version = "1.45.0-dev"
|
||||
version = "1.45.0"
|
||||
description = "Psysonic Desktop Music Player"
|
||||
authors = []
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Psysonic",
|
||||
"version": "1.45.0-dev",
|
||||
"version": "1.45.0",
|
||||
"identifier": "dev.psysonic.player",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
@@ -38,6 +38,7 @@ export default function LyricsPane({ currentTrack }: Props) {
|
||||
const lineRefs = useRef<(HTMLDivElement | null)[]>([]);
|
||||
const wordRefs = useRef<HTMLSpanElement[][]>([]);
|
||||
const prevActive = useRef({ line: -1, word: -1 });
|
||||
const prevTrackId = useRef<string | null | undefined>(undefined);
|
||||
const isUserScroll = useRef(false);
|
||||
const scrollTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
@@ -65,12 +66,18 @@ export default function LyricsPane({ currentTrack }: Props) {
|
||||
}
|
||||
}, [sidebarLyricsStyle]);
|
||||
|
||||
// Reset refs when track changes.
|
||||
// Reset refs on actual track change. Skip the initial mount so we don't wipe
|
||||
// the callback-refs that the commit phase just populated — that would leave
|
||||
// the tracker effect with an empty lineRefs and freeze the highlight.
|
||||
useEffect(() => {
|
||||
lineRefs.current = [];
|
||||
wordRefs.current = [];
|
||||
prevActive.current = { line: -1, word: -1 };
|
||||
scrollerRef.current?.jump(0);
|
||||
const id = currentTrack?.id ?? null;
|
||||
if (prevTrackId.current !== undefined && prevTrackId.current !== id) {
|
||||
lineRefs.current = [];
|
||||
wordRefs.current = [];
|
||||
prevActive.current = { line: -1, word: -1 };
|
||||
scrollerRef.current?.jump(0);
|
||||
}
|
||||
prevTrackId.current = id;
|
||||
}, [currentTrack?.id]);
|
||||
|
||||
// Imperative tracker — subscribes directly to the store, zero React re-renders per tick.
|
||||
|
||||
Reference in New Issue
Block a user