diff --git a/frontend/src/components/WidgetConfigDialog.tsx b/frontend/src/components/WidgetConfigDialog.tsx index 8eb644c..2255246 100644 --- a/frontend/src/components/WidgetConfigDialog.tsx +++ b/frontend/src/components/WidgetConfigDialog.tsx @@ -7,6 +7,7 @@ import { } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import { Textarea } from "@/components/ui/textarea"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { @@ -133,17 +134,35 @@ function WidgetConfigEditor({ return (
- {properties.map(([key, schema]) => { + {properties.map(([key, schema]) => { const isNumber = (schema as { type?: string }).type === "integer" || (schema as { type?: string }).type === "number"; + // Use a multi-line textarea for fields that tend to hold complex + // multi-line values (PromQL, text blocks, etc.). The widget kind's + // config schema can opt in via `format: "textarea"`; the well-known + // `query` field is treated as textarea by default. + const schemaFormat = (schema as { format?: string }).format; + const isTextarea = + schemaFormat === "textarea" || key === "query"; return ( - + + {isTextarea ? ( +