add some more comments

This commit is contained in:
Xuan Son Nguyen 2025-02-07 18:30:17 +01:00
parent a54c54aef2
commit a354774283
2 changed files with 3 additions and 0 deletions

View file

@ -23,6 +23,7 @@ export default function MarkdownDisplay({ content }: { content: string }) {
button: (props) => (
<CopyCodeButton {...props} origContent={preprocessedContent} />
),
// 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}

View file

@ -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 });
};