fix(home): simplify enter-to-send queued message to single press#4008
fix(home): simplify enter-to-send queued message to single press#4008waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview This removes the queue-send priming/timer state from Reviewed by Cursor Bugbot for commit 21f3b51. Configure here. |
Greptile SummaryThis PR replaces the previous double-Enter priming/timer mechanism for sending queued messages with a simpler, more direct approach: pressing Enter on an empty input while the AI is streaming now immediately sends the top queued message. The simplification removes ~29 lines of timer/priming state complexity across both files. The
Confidence Score: 4/5Mostly safe; the core simplification is correct but a missing guard can submit empty messages when not streaming The streaming+empty-input case is correctly handled by the new guard. The not-streaming+empty-input case still falls through to handleSubmit() and calls onSubmit('') — the same bug class the second commit aimed to fix, left incomplete. This is a real correctness gap that warrants attention before merge. user-input.tsx — handleKeyDown needs a canSubmit-equivalent guard before the final handleSubmit() call Important Files Changed
Sequence DiagramsequenceDiagram
actor User
participant UserInput
participant MothershipChat
participant Parent
rect rgb(200, 220, 240)
note over User,Parent: Empty Input + AI Streaming (new behavior)
User->>UserInput: Enter (empty input, streaming)
UserInput->>UserInput: handleKeyDown()
note over UserInput: isSendingRef && !value.trim() → true
UserInput->>MothershipChat: onEnterWhileEmpty()
alt messageQueue has items
MothershipChat->>Parent: onSendQueuedMessage(topMessage.id)
Parent->>Parent: Send queued message
else queue empty
MothershipChat-->>UserInput: return false (no-op)
end
end
rect rgb(220, 240, 200)
note over User,Parent: Normal Submit
User->>UserInput: Enter (with text)
UserInput->>UserInput: handleKeyDown()
UserInput->>UserInput: handleSubmit()
UserInput->>Parent: onSubmit(text, files, contexts)
end
rect rgb(255, 220, 200)
note over User,Parent: Unguarded Case (empty input, not streaming)
User->>UserInput: Enter (empty input, NOT streaming)
UserInput->>UserInput: handleKeyDown()
note over UserInput: isSendingRef is false → falls through
UserInput->>UserInput: handleSubmit()
UserInput->>Parent: onSubmit('') — empty message submitted
end
|
|
Fixed the empty submit fallthrough — the guard now always returns early when sending + empty input, and calls |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 21f3b51. Configure here.
* fix(home): simplify enter-to-send queued message to single press * fix(home): prevent empty submit fallthrough when sending with empty input
Summary
Type of Change
Testing
Tested manually
Checklist