From 88ab136f8ed56ce4667b076c9cd71ab273e2a318 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 6 Apr 2026 22:06:54 -0500 Subject: [PATCH] only show save all when multiple sections are changed or if the section being changed is not currently being viewed --- web/src/pages/Settings.tsx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsx index 5f119a86c..c74191957 100644 --- a/web/src/pages/Settings.tsx +++ b/web/src/pages/Settings.tsx @@ -818,6 +818,27 @@ export default function Settings() { [], ); + // Show save/undo all buttons only when changes span multiple sections + // or the single changed section is not the one currently being viewed + const showSaveAllButtons = useMemo(() => { + const pendingKeys = Object.keys(pendingDataBySection); + if (pendingKeys.length === 0) return false; + if (pendingKeys.length >= 2) return true; + + // Exactly one pending section — check if it matches the current view + const key = pendingKeys[0]; + const menuKey = pendingKeyToMenuKey(key); + if (menuKey !== pageToggle) return true; + + // For camera-scoped keys, also check if the camera matches + if (key.includes("::")) { + const cameraName = key.slice(0, key.indexOf("::")); + return cameraName !== selectedCamera; + } + + return false; + }, [pendingDataBySection, pendingKeyToMenuKey, pageToggle, selectedCamera]); + const handleSaveAll = useCallback(async () => { if ( !config || @@ -1491,7 +1512,7 @@ export default function Settings() { ); })} - {hasPendingChanges && ( + {showSaveAllButtons && (