From d968f0050038b0c6b43fc531e2f244bb2ed3e324 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 18 May 2026 14:22:54 -0500 Subject: [PATCH] Settings UI fixes (#23237) * detector UI fixes - derive detector and model from memo rather than using two drain useeffects - sanitize save payload through sanitizeSectionData to prevent yaml validation issues * increase display duration for restart required toasts * mimic logic in detector section for save all button also, increase toast duration for restart required toasts * fixes and tweaks - use section hidden fields for sanitization instead of duplicating code - use parent hooks so save all, pending data, and the status dots work correctly --- web/public/locales/en/views/settings.json | 2 + .../config-form/sections/BaseSection.tsx | 1 + web/src/pages/Settings.tsx | 171 +++++++-- .../DetectorsAndModelSettingsView.tsx | 333 ++++++++++++------ 4 files changed, 381 insertions(+), 126 deletions(-) diff --git a/web/public/locales/en/views/settings.json b/web/public/locales/en/views/settings.json index dd93a62ec0..0255082f1f 100644 --- a/web/public/locales/en/views/settings.json +++ b/web/public/locales/en/views/settings.json @@ -1583,6 +1583,8 @@ "resetError": "Failed to reset settings", "saveAllSuccess_one": "Saved {{count}} section successfully.", "saveAllSuccess_other": "All {{count}} sections saved successfully.", + "saveAllSuccessRestartRequired_one": "Saved {{count}} section successfully. Restart Frigate to apply your changes.", + "saveAllSuccessRestartRequired_other": "All {{count}} sections saved successfully. Restart Frigate to apply your changes.", "saveAllPartial_one": "{{successCount}} of {{totalCount}} section saved. {{failCount}} failed.", "saveAllPartial_other": "{{successCount}} of {{totalCount}} sections saved. {{failCount}} failed.", "saveAllFailure": "Failed to save all sections." diff --git a/web/src/components/config-form/sections/BaseSection.tsx b/web/src/components/config-form/sections/BaseSection.tsx index cd14047693..9245fa2409 100644 --- a/web/src/components/config-form/sections/BaseSection.tsx +++ b/web/src/components/config-form/sections/BaseSection.tsx @@ -743,6 +743,7 @@ export function ConfigSection({ "Settings saved successfully. Restart Frigate to apply your changes.", }), { + duration: 10000, action: ( setRestartDialogOpen(true)}>