From f3961cc72af2c73618653f61f464595f5cbf0400 Mon Sep 17 00:00:00 2001 From: eafonyang Date: Tue, 9 Jun 2026 14:24:30 +0800 Subject: [PATCH] Update project dependencies and configurations; remove deprecated package settings and enhance legacy build support - Upgrade package manager to pnpm@11.5.2 and remove patched dependencies from package.json. - Update pnpm-lock.yaml to reflect new dependency versions and remove obsolete entries. - Refactor Vite configuration to improve legacy build handling, including new plugins for legacy CSS management. - Remove unused client/index.html file and adjust paths in Vite config for better project structure. - Enhance DesktopAIShell and EQPage components to support legacy build conditions and improve loading states for raw curves. --- client/index.html | 12 - client/src/components/DesktopAIShell.tsx | 10 +- client/src/pages/EQPage.tsx | 28 +- client/src/pages/Home.tsx | 18 +- client/src/pages/eq/components/FreqChart.tsx | 39 +- package.json | 10 +- pnpm-lock.yaml | 3446 +++++++++++------- pnpm-workspace.yaml | 8 + vite.legacy.config.ts | 56 +- 9 files changed, 2247 insertions(+), 1380 deletions(-) delete mode 100644 client/index.html create mode 100644 pnpm-workspace.yaml diff --git a/client/index.html b/client/index.html deleted file mode 100644 index ed884c3..0000000 --- a/client/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Luxsin X8 Controller - - -
- - - diff --git a/client/src/components/DesktopAIShell.tsx b/client/src/components/DesktopAIShell.tsx index 2e971c8..a504864 100644 --- a/client/src/components/DesktopAIShell.tsx +++ b/client/src/components/DesktopAIShell.tsx @@ -65,6 +65,8 @@ function SplitDivider({ ); } +const isLegacyBuild = import.meta.env.VITE_X8_LEGACY === "1"; + /** * lg+: optional side-by-side AI panel with draggable divider. Mobile unchanged (router only). */ @@ -87,7 +89,9 @@ export default function DesktopAIShell({ children }: { children: ReactNode }) { "w-full min-w-0", showSplit ? "flex h-dvh max-h-dvh flex-row overflow-hidden" - : "min-h-dvh", + : isLegacyBuild + ? "min-h-0" + : "min-h-dvh", )} >
(""); const [isConfirmingTarget, setIsConfirmingTarget] = useState(false); const [currentRawCurve, setCurrentRawCurve] = useState(null); + const [rawCurveLoading, setRawCurveLoading] = useState(false); const allowPeqRemoteSyncRef = useRef(false); const lastPeqCatalogSyncKeyRef = useRef(""); const syncingHeadphoneRef = useRef(false); @@ -663,9 +664,13 @@ export default function EQPage() { return; } + const copyBrand = currentPeq?.brand?.trim() ?? ""; + const copyModel = currentPeq?.model?.trim() ?? ""; const copyPayload: PeqChangePayload = { peqChange: { name: nextName, + ...(copyBrand ? { brand: copyBrand } : {}), + ...(copyModel ? { model: copyModel } : {}), filters: bands.map(bandToPeqFilter), autoPre: currentPeq?.autoPre ?? 0, preamp: currentPeq?.preamp ?? 0, @@ -704,6 +709,8 @@ export default function EQPage() { ...prev, { name: nextName, + ...(addPresetMode === "copy" && copyBrand ? { brand: copyBrand } : {}), + ...(addPresetMode === "copy" && copyModel ? { model: copyModel } : {}), filters: localFilters, autoPre: localAutoPre, preamp: localPreamp, @@ -817,15 +824,8 @@ export default function EQPage() { const loadRawCurveForPeq = useCallback( async (peq: { brand?: string; model?: string; name?: string } | undefined): Promise => { - let brand = peq?.brand?.trim() ?? ""; - let model = peq?.model?.trim() ?? ""; - - // Some presets only have `name` (e.g. "Apple AirPods Pro") and miss explicit brand/model. - if ((!brand || !model) && peq?.name) { - const [first, ...rest] = peq.name.trim().split(/\s+/); - if (!brand && first) brand = first; - if (!model && rest.length > 0) model = rest.join(" "); - } + const brand = peq?.brand?.trim() ?? ""; + const model = peq?.model?.trim() ?? ""; if (!brand || !model) return null; const modelCurve = await getModelCurve(brand, model); @@ -966,11 +966,20 @@ export default function EQPage() { syncingHeadphoneRef.current = true; setBandsForBothModes(nextBands); setSelectedBandByMode({ A: 0, B: 0 }); + const shouldFetchModelCurve = !!(peq.brand?.trim() && peq.model?.trim()); + if (shouldFetchModelCurve) { + setRawCurveLoading(true); + setCurrentRawCurve(null); + } else { + setRawCurveLoading(false); + } + let cancelled = false; void (async () => { const raw = await loadRawCurveForPeq(peq as { brand?: string; model?: string }); if (cancelled) return; setCurrentRawCurve(raw); + setRawCurveLoading(false); renderCharts(nextBands, raw, false); })(); requestAnimationFrame(() => { @@ -1463,6 +1472,7 @@ export default function EQPage() { void; - /** Optional small thumbnail shown between value text and chevron. */ - thumbnailSrc?: string; + thumbnail?: string; }) { return (
@@ -159,13 +158,12 @@ function ListRow({ {toggle ? ( {})} /> ) : ( -
- {thumbnailSrc && ( +
+ {thumbnail && ( )} {value && {value}} @@ -883,7 +881,7 @@ export default function Home() { icon={} label={homeText.vu ?? "VU表"} value={vuLabel} - thumbnailSrc={`${import.meta.env.BASE_URL}vu/vu${(ds.vu ?? 0) + 1}.png`} + thumbnail={`${import.meta.env.BASE_URL}vu/vu${(ds.vu ?? 0) + 1}.png`} onClick={() => setLocation("/vu")} />