From a55ad19a17c7aa22dd9ff06c4297f12e5411bb9c Mon Sep 17 00:00:00 2001 From: ZortexSenpai Date: Tue, 10 Nov 2026 14:27:20 +0100 Subject: [PATCH] fix: fixed playerbar parametric eq button link --- src/components/eq/EqSection.tsx | 7 +++++++ src/components/layout/PlayerBar.tsx | 3 ++- src/lib/keyboard.ts | 3 ++- .../now-playing/NowPlayingOverlay.tsx | 3 ++- src/views/settings/SettingsView.tsx | 21 ++++++++++++++++--- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/components/eq/EqSection.tsx b/src/components/eq/EqSection.tsx index 5fc3e5e..a5fbb07 100644 --- a/src/components/eq/EqSection.tsx +++ b/src/components/eq/EqSection.tsx @@ -10,6 +10,13 @@ import { EqBandRow } from "./EqBandRow"; import { EqCurve } from "./EqCurve"; import { EqPresetMenu } from "./EqPresetMenu"; +/** + * The EQ has no view of its own, so its entry points (player bar, full-screen + * player, Ctrl+E) link to the Settings view scrolled to this section. + */ +export const EQ_SECTION_ID = "eq"; +export const EQ_PATH = `/settings#${EQ_SECTION_ID}`; + function HydrateError() { const t = useT(); const error = useEqStore((s) => s.hydrateError); diff --git a/src/components/layout/PlayerBar.tsx b/src/components/layout/PlayerBar.tsx index fb48b84..ac318df 100644 --- a/src/components/layout/PlayerBar.tsx +++ b/src/components/layout/PlayerBar.tsx @@ -4,6 +4,7 @@ import { playerBarAccent } from "../../lib/themes/genshin"; import { usePlayerStore } from "../../stores/playerStore"; import { usePrefsStore } from "../../stores/prefsStore"; import { useUiStore } from "../../stores/uiStore"; +import { EQ_PATH } from "../eq/EqSection"; import { ArtistLinks } from "../library/ArtistLinks"; import { CoverImage } from "../library/CoverImage"; import { StarButton } from "../library/StarButton"; @@ -93,7 +94,7 @@ export function PlayerBar() { {/* Right controls */}
- navigate("/settings")}> + navigate(EQ_PATH)}> { setOpen(false); - navigate("/settings"); + navigate(EQ_PATH); }} > diff --git a/src/views/settings/SettingsView.tsx b/src/views/settings/SettingsView.tsx index beeef8e..792ad43 100644 --- a/src/views/settings/SettingsView.tsx +++ b/src/views/settings/SettingsView.tsx @@ -17,7 +17,8 @@ import { Volume2, } from "lucide-react"; import { useEffect, useRef, useState } from "react"; -import { EqSection } from "../../components/eq/EqSection"; +import { useLocation } from "react-router"; +import { EQ_SECTION_ID, EqSection } from "../../components/eq/EqSection"; import { NAV_ITEMS } from "../../components/layout/navItems"; import { Button, IconButton } from "../../components/ui/Button"; import { Input } from "../../components/ui/Input"; @@ -1204,17 +1205,31 @@ function AboutSection() { export function SettingsView() { const t = useT(); + const location = useLocation(); + const scrollRef = useRef(null); + + // Jump to the section the URL's hash names (the EQ buttons link to #eq). + // Keyed on the location key as well, so following the same link again + // re-scrolls after the user has scrolled away. Only this pane scrolls: + // scrollIntoView would also shift the app shell's overflow-hidden ancestors. + useEffect(() => { + const pane = scrollRef.current; + const target = location.hash ? document.getElementById(location.hash.slice(1)) : null; + if (!pane || !target || !pane.contains(target)) return; + pane.scrollTop += target.getBoundingClientRect().top - pane.getBoundingClientRect().top; + }, [location.key, location.hash]); + return (

{t("nav.settings")}

-
+
-
+