Fix better

This commit is contained in:
Gregory Schier
2025-11-25 09:46:02 -08:00
parent 20e1b5c00e
commit 8b851d4685
2 changed files with 5 additions and 3 deletions

View File

@@ -190,7 +190,7 @@ function InitializedTemplateFunctionDialog({
/>
)}
</div>
<div className="px-6 border-t border-t-border py-3 bg-surface-highlight w-full flex flex-col gap-4">
<div className="px-6 border-t border-t-border pt-3 pb-6 bg-surface-highlight w-full flex flex-col gap-4">
{previewType !== 'none' ? (
<div className="w-full grid grid-cols-1 grid-rows-[auto_auto]">
<HStack space={0.5}>

View File

@@ -92,11 +92,12 @@ function templateTags(
let option = options.find(
(o) => o.name === name || (o.type === 'function' && o.aliases?.includes(name)),
);
if (option == null) {
const from = node.from; // Cache here so the reference doesn't change
option = {
invalid: true,
type: 'variable',
invalid: true,
name: inner,
value: null,
label: inner,
@@ -112,7 +113,8 @@ function templateTags(
for (const arg of option.args) {
if (!('optional' in arg)) continue;
if (!arg.optional && values[arg.name] == null) {
option.invalid = true;
// Clone so we don't mutate the original
option = { ...option, invalid: true };
break;
}
}