Add UI config messages framework (#22692)

* add config messages to sections and fields

* add alert variants

* add messages to types

* add detect fps, review, and audio messages

* add a basic set of messages

* remove emptySelectionHintKey from switches widget

use the new messages framework and revert the changes made in #22664
This commit is contained in:
Josh Hawkins
2026-03-29 15:25:40 -06:00
committed by GitHub
parent 257dae11c1
commit 953d244c52
18 changed files with 475 additions and 18 deletions
@@ -3,6 +3,26 @@ import type { SectionConfigOverrides } from "./types";
const faceRecognition: SectionConfigOverrides = {
base: {
sectionDocs: "/configuration/face_recognition",
messages: [
{
key: "global-disabled",
messageKey: "configMessages.faceRecognition.globalDisabled",
severity: "warning",
condition: (ctx) => {
if (ctx.level !== "camera") return false;
return ctx.fullConfig.face_recognition?.enabled === false;
},
},
{
key: "person-not-tracked",
messageKey: "configMessages.faceRecognition.personNotTracked",
severity: "info",
condition: (ctx) => {
if (ctx.level !== "camera" || !ctx.fullCameraConfig) return false;
return !ctx.fullCameraConfig.objects?.track?.includes("person");
},
},
],
restartRequired: [],
fieldOrder: ["enabled", "min_area"],
hiddenFields: [],