From 6849059b007c75480d0d76231608a4be3b3c40d6 Mon Sep 17 00:00:00 2001 From: Zayd Krunz <70227235+ShrootBuck@users.noreply.github.com> Date: Sun, 17 May 2026 23:39:51 -0700 Subject: [PATCH] fix(app): hide prompt placeholder for whitespace input (#28101) Co-authored-by: ShrootBuck --- packages/app/src/components/prompt-input.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index 1e1be28b59..76e6c136d7 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -99,8 +99,6 @@ const EXAMPLES = [ "prompt.example.25", ] as const -const NON_EMPTY_TEXT = /[^\s\u200B]/ - export const PromptInput: Component = (props) => { const sdk = useSDK() const queryOptions = useQueryOptions() @@ -860,7 +858,8 @@ export const PromptInput: Component = (props) => { ? rawParts[0].content : rawParts.map((p) => ("content" in p ? p.content : "")).join("") const hasNonText = rawParts.some((part) => part.type !== "text") - const shouldReset = !NON_EMPTY_TEXT.test(rawText) && !hasNonText && images.length === 0 + const textContent = (editorRef.textContent ?? "").replace(/\u200B/g, "") + const shouldReset = textContent.length === 0 && rawText.replace(/\n/g, "").length === 0 && !hasNonText && images.length === 0 if (shouldReset) { closePopover()