Add optional docs link to config field messages (#23569)
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions

* add optional docs link to config field messages

* docs tweaks

* add field messages for model dimensions
This commit is contained in:
Josh Hawkins
2026-06-25 17:25:59 -06:00
committed by GitHub
parent ec3fb00494
commit cbf6d032cb
7 changed files with 90 additions and 4 deletions
@@ -3,6 +3,39 @@ import type { SectionConfigOverrides } from "./types";
const model: SectionConfigOverrides = {
base: {
sectionDocs: "/configuration/object_detectors#model",
fieldMessages: [
{
key: "model-optimized-for-320",
field: "width",
position: "before",
messageKey: "configMessages.model.optimizedFor320",
severity: "info",
docLink: "/configuration/object_detectors#choosing-a-model-size",
condition: (ctx) => {
const width = ctx.formData?.width as number | null | undefined;
const height = ctx.formData?.height as number | null | undefined;
return width === 640 || height === 640;
},
},
{
key: "model-input-dimensions-not-detect-resolution",
field: "height",
position: "after",
messageKey: "configMessages.model.inputDimensionsNotDetectResolution",
severity: "warning",
condition: (ctx) => {
const width = ctx.formData?.width as number | null | undefined;
const height = ctx.formData?.height as number | null | undefined;
if (typeof width !== "number" || typeof height !== "number") {
return false;
}
if (width <= 0 || height <= 0) {
return false;
}
return width > 640 || height > 640;
},
},
],
restartRequired: [
"path",
"labelmap_path",
@@ -26,6 +26,8 @@ export type ConditionalMessage = {
condition: (ctx: MessageConditionContext) => boolean;
/** Optional interpolation values passed to t() for {{var}} substitution */
values?: Record<string, unknown>;
/** Optional documentation path (e.g. "/configuration/object_detectors#model"). */
docLink?: string;
};
/** Field-level conditional message, adds field targeting */