fix: stop conversation draft leaking into home chat input#723
fix: stop conversation draft leaking into home chat input#723nehaprasad-dev wants to merge 1 commit into
Conversation
|
@nehaprasad-dev is attempting to deploy a commit to the openhands Team on Vercel. A member of the Team first needs to authorize it. |
all-hands-bot
left a comment
There was a problem hiding this comment.
Taste Rating: 🟢 Good taste - Clean, surgical fix for a real UX bug.
This is a well-executed bug fix that addresses the draft leak issue with three minimal, coordinated changes:
- use-chat-input-logic: Returns
nullformessageToSendwhen on home (no conversationId) - use-draft-persistence: Adds dedicated home/zero-state cleanup effect + clears messageToSend on conversation change
- use-auto-resize: Guards against restoring empty text with
value.text.length > 0check
The logic is simple and clear. Test coverage is excellent with new tests for the home state behavior. All 20 draft persistence tests pass.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
This is a focused bug fix to draft state management. Changes are scoped to three hooks with no breaking changes, no data structure modifications, and no security concerns. The fix only affects behavior when conversationId is undefined (home page), which was already broken. Well-tested with passing regression coverage.
VERDICT:
✅ Worth merging: Solves a real UX issue with minimal, well-tested changes.
KEY INSIGHT:
The fix properly distinguishes "home state" (conversationId undefined) from "conversation state" at every layer—input logic, persistence, and resize—preventing stale draft leakage with surgical precision.
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/agent-canvas/actions/runs/26248894885
why
Summary
Issue Number
N/A
How to Test
Video/Screenshots
N/A
Type
[x] Bug fix
Notes
N/A
fix #717