Add attributes to UI filters list (#23250)

* preserve user-set min_score on attribute filters instead of bumping any 0.5 value

use model_fields_set to distinguish "user explicitly set min_score" from "Pydantic applied the generic FilterConfig default of 0.5"

* add config test for attributes

* fix attributes frontend type

* add expanded hidden field context

* extend schema modification

* special case for attributes

* i18n for attributes

* handle dedicated lpr mode

* strip unrendered FilterConfig fields from attribute filter form data to fix validation errors
This commit is contained in:
Josh Hawkins authored and GitHub committed 2026-05-19 08:31:50 -06:00
1 parent 4fdc107987
commit b1de5e2290
16 files changed
+535 -43

No files matched your search

+13 -1
View File
@@ -13,7 +13,19 @@ export type JsonArray = JsonValue[];
export type ConfigSectionData = JsonObject;
export type HiddenFieldEntry = string | ((config: FrigateConfig) => string[]);
export type HiddenFieldContext = {
fullConfig: FrigateConfig;
fullCameraConfig?: CameraConfig;
level: "global" | "camera" | "replay";
cameraName?: string;
// Saved form data for the current section/scope (i.e. rawFormData in
// BaseSection.tsx). Not the user's in-flight RJSF edits. Optional because
// most hidden-field callsites compute patterns without a specific section
// value on hand; resolvers fall back to fullCameraConfig / fullConfig.
formData?: ConfigSectionData;
};
export type HiddenFieldEntry = string | ((ctx: HiddenFieldContext) => string[]);
export type ConfigFormContext = {
level?: "global" | "camera";
+2 -2
View File
@@ -522,8 +522,8 @@ export interface FrigateConfig {
path: string | null;
width: number;
colormap: { [key: string]: [number, number, number] };
attributes_map: { [key: string]: [string] };
all_attributes: [string];
attributes_map: { [key: string]: string[] };
all_attributes: string[];
plus?: {
name: string;
id: string;