Skip to content

Commit a354774

Browse files
committed
add some more comments
1 parent a54c54a commit a354774

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

examples/server/webui/src/components/MarkdownDisplay.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default function MarkdownDisplay({ content }: { content: string }) {
2323
button: (props) => (
2424
<CopyCodeButton {...props} origContent={preprocessedContent} />
2525
),
26+
// 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)
2627
}}
2728
>
2829
{preprocessedContent}

examples/server/webui/src/components/SettingDialog.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export default function SettingDialog({
7575
alert(`Value for ${key} must be numeric`);
7676
return;
7777
}
78+
// force conversion to number
7879
// @ts-expect-error this is safe
7980
newConfig[key] = numVal;
8081
} else if (mustBeBoolean) {
@@ -102,6 +103,7 @@ export default function SettingDialog({
102103
};
103104

104105
const onChange = (key: SettKey) => (value: string | boolean) => {
106+
// note: we do not perform validation here, because we may get incomplete value as user is still typing it
105107
setLocalConfig({ ...localConfig, [key]: value });
106108
};
107109

0 commit comments

Comments
 (0)