diff --git a/client/public/changelog.md b/client/public/changelog.md index c6e39ca..e432792 100644 --- a/client/public/changelog.md +++ b/client/public/changelog.md @@ -2,6 +2,12 @@ > This document records feature updates and bug fixes for the Luxsin X8 controller. Entries are listed in reverse chronological order — the newest release appears first. +## v2026.09.22 + +### New Features +- Added a dedicated "Headphone settings" section on the Audio page, grouping headphone gain and automatic headphone impedance detection. +- Added maximum headphone volume and headphone startup volume settings. These two settings are shown only on firmware version 1.0.31.0 (build 31) or later. + ## v2026.09.09 ### New Features diff --git a/client/src/pages/Home.tsx b/client/src/pages/Home.tsx index ed649de..b1ec5cf 100644 --- a/client/src/pages/Home.tsx +++ b/client/src/pages/Home.tsx @@ -192,12 +192,35 @@ export default function Home() { const [volumeConfirm, setVolumeConfirm] = useState(null); const [easterEggActive, setEasterEggActive] = useState(false); const [vuHeights, setVuHeights] = useState(idleVuBarHeights); + /** 更新说明入口展示的最新版本号(取自 changelog.md 首个 "## v..." 标题) */ + const [changelogVersion, setChangelogVersion] = useState(null); const jackProgressRef = useRef(0); const jackResetTimerRef = useRef | null>(null); const eggRafRef = useRef(null); /** 下次三连击成功时播放的律动:1=旋律,2=海浪(各需单独三连击触发) */ const jackEggNextRef = useRef<1 | 2>(1); + // 拉取更新说明首个版本号,静默降级(失败则入口不显示版本) + useEffect(() => { + let cancelled = false; + fetch(`${import.meta.env.BASE_URL}changelog.md`) + .then((res) => { + if (!res.ok) throw new Error(`HTTP ${res.status}`); + return res.text(); + }) + .then((text) => { + if (cancelled) return; + const m = text.match(/^##\s+(v[^\s#]+)\s*$/m); + if (m) setChangelogVersion(m[1]); + }) + .catch(() => { + /* 静默:入口不显示版本号 */ + }); + return () => { + cancelled = true; + }; + }, []); + const homeText = useMemo((): HomeLocale => { if (!deviceState) return {} as HomeLocale; const loc = @@ -878,6 +901,7 @@ export default function Home() { } label={homeText.changelog ?? "更新说明"} + value={changelogVersion ?? undefined} onClick={() => setLocation("/changelog")} />