fix(ui): prevent blank screen when prompt template is emptied
Change onChange handler from v || undefined to v ?? "" so empty strings don't become undefined and crash downstream .trim() calls. Fixes #191 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -441,7 +441,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
|||||||
"promptTemplate",
|
"promptTemplate",
|
||||||
String(config.promptTemplate ?? ""),
|
String(config.promptTemplate ?? ""),
|
||||||
)}
|
)}
|
||||||
onChange={(v) => mark("adapterConfig", "promptTemplate", v || undefined)}
|
onChange={(v) => mark("adapterConfig", "promptTemplate", v ?? "")}
|
||||||
placeholder="You are agent {{ agent.name }}. Your role is {{ agent.role }}..."
|
placeholder="You are agent {{ agent.name }}. Your role is {{ agent.role }}..."
|
||||||
contentClassName="min-h-[88px] text-sm font-mono"
|
contentClassName="min-h-[88px] text-sm font-mono"
|
||||||
imageUploadHandler={async (file) => {
|
imageUploadHandler={async (file) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user