From 0db6e8741350cd3c3c8b639cf60f507482f163a0 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:02:53 -0600 Subject: [PATCH] add footer message for required restart --- web/public/locales/en/views/settings.json | 1 + .../config-form/sections/BaseSection.tsx | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/web/public/locales/en/views/settings.json b/web/public/locales/en/views/settings.json index 30f8edc6b..28b667cbd 100644 --- a/web/public/locales/en/views/settings.json +++ b/web/public/locales/en/views/settings.json @@ -1231,6 +1231,7 @@ "selectPreset": "Select preset", "manualPlaceholder": "Enter FFmpeg arguments" }, + "restartRequiredFooter": "Configuration changed - Restart required", "sections": { "detect": "Detection", "record": "Recording", diff --git a/web/src/components/config-form/sections/BaseSection.tsx b/web/src/components/config-form/sections/BaseSection.tsx index 14c861dfe..493cd50ac 100644 --- a/web/src/components/config-form/sections/BaseSection.tsx +++ b/web/src/components/config-form/sections/BaseSection.tsx @@ -1,7 +1,14 @@ // Base Section Component for config form sections // Used as a foundation for reusable section components -import { useMemo, useCallback, useState, useEffect, useRef } from "react"; +import { + useMemo, + useCallback, + useState, + useEffect, + useRef, + useContext, +} from "react"; import useSWR from "swr"; import axios from "axios"; import { toast } from "sonner"; @@ -46,6 +53,7 @@ import { applySchemaDefaults } from "@/lib/config-schema"; import { cn } from "@/lib/utils"; import { ConfigSectionData, JsonValue } from "@/types/configForm"; import ActivityIndicator from "@/components/indicators/activity-indicator"; +import { StatusBarMessagesContext } from "@/context/statusbar-provider"; import { cameraUpdateTopicMap, buildOverrides, @@ -159,6 +167,7 @@ export function ConfigSection({ ]); const [isOpen, setIsOpen] = useState(!defaultCollapsed); const { send: sendRestart } = useRestart(); + const statusBar = useContext(StatusBarMessagesContext); // Create a key for this section's pending data const pendingDataKey = useMemo( @@ -505,6 +514,15 @@ export function ConfigSection({ }); if (needsRestart) { + statusBar?.addMessage( + "config_restart_required", + t("configForm.restartRequiredFooter", { + ns: "views/settings", + defaultValue: "Configuration changed - Restart required", + }), + undefined, + "config_restart_required", + ); toast.success( t("toast.successRestartRequired", { ns: "views/settings", @@ -578,6 +596,7 @@ export function ConfigSection({ cameraName, t, refreshConfig, + statusBar, onSave, rawFormData, sanitizeSectionData,