Skip to content

fix(app): hide prompt placeholder for whitespace input#28101

Merged
Brendonovich merged 2 commits into
anomalyco:devfrom
ShrootBuck:fix/prompt-placeholder-whitespace
May 18, 2026
Merged

fix(app): hide prompt placeholder for whitespace input#28101
Brendonovich merged 2 commits into
anomalyco:devfrom
ShrootBuck:fix/prompt-placeholder-whitespace

Conversation

@ShrootBuck
Copy link
Copy Markdown
Contributor

@ShrootBuck ShrootBuck commented May 18, 2026

Issue for this PR

Closes #28099

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The prompt composer treated whitespace-only input as empty while reconciling editor state. That kept prompt.dirty() false, so the placeholder overlay stayed visible after typing spaces.

This updates the reset check to distinguish typed whitespace from browser-generated empty contenteditable line breaks. Spaces now hide the placeholder, while deleting everything resets the prompt so the placeholder comes back. Whitespace-only prompts remain unsendable because submit still uses the existing trim-based empty prompt guard.

How did you verify your code works?

  • Ran bun test --preload ./happydom.ts ./src/components/prompt-input from packages/app
  • Ran bun typecheck from packages/app
  • Pre-push hook ran bun turbo typecheck successfully
  • Started bun run --cwd packages/desktop dev and checked the prompt behavior locally

Screenshots / recordings

Before: typing spaces leaves the placeholder visible over the caret.

After: typing spaces hides the placeholder; deleting all content restores it. Submit remains disabled for whitespace-only input.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@ShrootBuck ShrootBuck requested a review from adamdotdevin as a code owner May 18, 2026 02:46
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Brendonovich Brendonovich merged commit 6849059 into anomalyco:dev May 18, 2026
4 checks passed
@ShrootBuck ShrootBuck deleted the fix/prompt-placeholder-whitespace branch May 18, 2026 19:04
xesrevinu pushed a commit to xesrevinu/opencode that referenced this pull request May 20, 2026
Co-authored-by: ShrootBuck <ShrootBuck@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants