Skip to content

Cannot send after non-keyboard paste (right-click/iPhone) when input text is empty but pasted content exists #246

@egns-ai

Description

@egns-ai

Summary

In clay-server@2.17.0, sending is gated by inputEl.value.trim() in several places. When paste creates pendingPastes/pendingImages/pendingFiles but leaves the textarea empty (common with right-click paste and iPhone flows), Enter/send does not work.

Version

  • clay-service depends on clay-server: ^2.17.0
  • Reproduced in this bundled frontend code path

Steps to Reproduce

  1. Open chat input
  2. Paste content using right-click paste (or on iPhone paste text/image that becomes pending content/chip)
  3. Try to send with Enter or Send button

Expected Behavior

Message sends whenever there is sendable content:

  • text OR
  • pending paste chips OR
  • pending images/files

Actual Behavior

Send is blocked when textarea text is empty, even if pending pasted content exists.

Why This Happens (Code References)

  • Send button only sends if text is non-empty:
    • node_modules/clay-server/lib/public/modules/input.js:675
  • Long paste is converted to pendingPastes chip (textarea can remain empty):
    • node_modules/clay-server/lib/public/modules/input.js:582
  • Enter handling is blocked on touch devices (iPhone):
    • node_modules/clay-server/lib/public/modules/input.js:659
  • Send/stop mode also uses text-only checks:
    • node_modules/clay-server/lib/public/modules/input.js:613
    • node_modules/clay-server/lib/public/modules/input.js:129
    • node_modules/clay-server/lib/public/app.js:2110

Suggested Fix

Introduce a shared hasSendableContent() check (text OR pendingPastes OR pendingImages OR pendingFiles) and use it for:

  • send button click behavior
  • send/stop mode decisions
  • Enter behavior consistency across paste paths (including iPhone UX decisions)

Impact

  • Right-click paste path can't be sent reliably
  • iPhone paste path can leave users unable to send after paste
  • Inconsistent behavior vs keyboard paste (Ctrl+V) experience

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions