修复&优化听力补偿模块功能

This commit is contained in:
eafonyang
2026-09-09 18:26:24 +08:00
parent 8d13847668
commit 8db56e2211
6 changed files with 73 additions and 11 deletions
+1 -1
View File
@@ -917,7 +917,7 @@ export default function EffectsPage() {
</button>
{hearingOn && hearingProfiles[hearingIdx] && (
<HearingCompensationChart
className="mt-3 w-full h-[min(42vw,200px)] min-h-[140px] md:h-[260px] lg:h-[300px] rounded-lg bg-black/30"
className="mt-3 w-full h-[min(52vw,240px)] min-h-[180px] md:h-[320px] lg:h-[380px] rounded-lg bg-black/30"
left={hearingProfiles[hearingIdx].l}
right={hearingProfiles[hearingIdx].r}
leftLabel={effectText.hearing?.left ?? "Left"}
+13
View File
@@ -185,10 +185,23 @@ export function consumeSelectPageResult() {
// Scroll position of the calling page, captured before navigating to /select.
// The select page is short, so the browser clamps window scroll to 0 while on
// it; without restoring, the calling page (e.g. Effects) reopens at the top.
let selectReturnScroll: number | null = null;
/** Consume the stored scroll position (once). Returns null when absent. */
export function consumeSelectReturnScroll(): number | null {
const y = selectReturnScroll;
selectReturnScroll = null;
return y;
}
// Helper function to set select page state
export function navigateToSelect(title: string, options: string[], selected: number, back: string, key: string) {
selectReturnScroll = window.scrollY;
selectPageState = { title, options, selected, back, key };
}