Skip to content

Commit 796ad29

Browse files
authored
Fix(webapp): consistent query button width (#3067)
Prevents layout shift by keeping the button width the same when isLoading Normal state <img width="423" height="186" alt="CleanShot 2026-02-16 at 10 31 23" src="https://github.com/user-attachments/assets/232bc14f-dc2c-4092-9b46-f6d652568633" /> isLoading <img width="403" height="137" alt="CleanShot 2026-02-16 at 10 31 43" src="https://github.com/user-attachments/assets/e9215b48-c2cc-4ede-91ff-08bbdb2382a0" />
1 parent b4e08bd commit 796ad29

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

apps/webapp/app/components/query/QueryEditor.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,22 @@ const QueryEditorForm = forwardRef<
354354
variant="primary/small"
355355
disabled={isLoading || !query.trim()}
356356
shortcut={{ modifiers: ["mod"], key: "enter", enabledOnInputElements: true }}
357-
LeadingIcon={isLoading ? <Spinner className="size-4" color="white" /> : undefined}
357+
className={
358+
isLoading
359+
? "relative !text-transparent [&_*]:!border-transparent [&_*]:!text-transparent"
360+
: undefined
361+
}
358362
>
359-
{isLoading ? "Querying..." : "Query"}
363+
{isLoading ? (
364+
<>
365+
Query
366+
<span className="pointer-events-none absolute inset-0 flex items-center justify-center">
367+
<Spinner className="size-4 opacity-50" color="white" />
368+
</span>
369+
</>
370+
) : (
371+
"Query"
372+
)}
360373
</Button>
361374
</div>
362375
</fetcher.Form>
@@ -996,7 +1009,7 @@ function QueryTitle({
9961009
if (isTitleLoading)
9971010
return (
9981011
<span className="flex items-center gap-2 text-text-dimmed">
999-
<Spinner className="size-3" /> Generating title…
1012+
<Spinner className="size-4" /> Generating title…
10001013
</span>
10011014
);
10021015

0 commit comments

Comments
 (0)