diff --git a/examples/server/webui/src/components/MarkdownDisplay.tsx b/examples/server/webui/src/components/MarkdownDisplay.tsx index 8ab8de655..814920a74 100644 --- a/examples/server/webui/src/components/MarkdownDisplay.tsx +++ b/examples/server/webui/src/components/MarkdownDisplay.tsx @@ -23,6 +23,7 @@ export default function MarkdownDisplay({ content }: { content: string }) { button: (props) => ( ), + // note: do not use "pre", "p" or other basic html elements here, it will cause the node to re-render when the message is being generated (this should be a bug with react-markdown, not sure how to fix it) }} > {preprocessedContent} diff --git a/examples/server/webui/src/components/SettingDialog.tsx b/examples/server/webui/src/components/SettingDialog.tsx index eca951edc..5565ab7bb 100644 --- a/examples/server/webui/src/components/SettingDialog.tsx +++ b/examples/server/webui/src/components/SettingDialog.tsx @@ -75,6 +75,7 @@ export default function SettingDialog({ alert(`Value for ${key} must be numeric`); return; } + // force conversion to number // @ts-expect-error this is safe newConfig[key] = numVal; } else if (mustBeBoolean) { @@ -102,6 +103,7 @@ export default function SettingDialog({ }; const onChange = (key: SettKey) => (value: string | boolean) => { + // note: we do not perform validation here, because we may get incomplete value as user is still typing it setLocalConfig({ ...localConfig, [key]: value }); };