Enable multiline textarea for better readability#294
Enable multiline textarea for better readability#294vinayak302004 wants to merge 2 commits intoAOSSIE-Org:mainfrom
Conversation
📝 WalkthroughWalkthroughThe DebateRoom component's user input area was changed from an Input component to a Textarea component and the import updated. An onKeyDown handler was added to the textarea to submit the message when Enter is pressed without Shift. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/src/Pages/DebateRoom.tsx (1)
854-875:⚠️ Potential issue | 🟡 MinorEnter key no longer submits the message — potential UX regression until PR
#292lands.With
<Input>, users likely expected Enter to send. With<Textarea>, Enter inserts a newline instead. The PR description notes this is addressed in a separate PR (#292), but if this PR merges first, users lose the ability to submit via keyboard. Consider coordinating the merge order or including a basiconKeyDownhandler here (e.g., Enter sends, Shift+Enter for newline).
🧹 Nitpick comments (1)
frontend/src/Pages/DebateRoom.tsx (1)
853-875: Vertical alignment and resize behavior need attention for multiline textarea.Two issues with the textarea integration:
items-center(line 853) vertically centers the Mic and Send buttons relative to the textarea. As the textarea grows with multiple lines, the buttons will float mid-height, which looks awkward. Useitems-endto keep them anchored at the bottom.No resize constraint — the user can freely drag-resize the
<Textarea>, potentially breaking the fixed-height card layout. Addresize-noneto the className (or limit toresize-ywith amax-h).Proposed fix
- <div className="mt-3 flex gap-2 items-center"> + <div className="mt-3 flex gap-2 items-end"> <Textarea ... - className="flex-1 rounded-md text-sm border border-border bg-input text-foreground placeholder:text-muted-foreground focus:border-orange-400" + className="flex-1 rounded-md text-sm border border-border bg-input text-foreground placeholder:text-muted-foreground focus:border-orange-400 resize-none" + rows={2} />
Closes #293
Summary
Replaced single-line input with textarea to improve readability while typing messages.
Changes
<Input />with<Textarea />in debate message boxScreenshots
https://drive.google.com/file/d/1D1t4MgKtR2C3fxbGmN0mfTDv5kRZVohc/view?usp=sharing
Note
Enter key behavior is handled in a separate PR #292
Also added enter key and shift + enter key behavior
Summary by CodeRabbit