-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Description
The current prompt input box has a large fixed minimum height (rows=4 / min-height: 56px-64px), which consumes significant vertical real estate even when empty. This is particularly problematic on mobile devices where screen space is limited.
We should implement an auto-expanding input that starts as a single line and grows dynamically with the content, up to a developer-defined maximum.
Technical Analysis
Based on the codebase, the current constraints are:
packages/ui/src/components/prompt-input.tsx: The<textarea>has a hardcodedrowsattribute (Line 1159):rows={expandState() === "expanded" ? 15 : 4}.packages/ui/src/styles/messaging/prompt-input.css:.prompt-input-field-containerhas amin-height: 56px(Line 25).- Mobile media query
@media (max-width: 640px)increasesmin-heightto64px(Line 310).
Proposed Solution: Auto-Expanding Input
-
Reduce Baseline Height:
- Change the default
rowsfrom4to1. - Remove or significantly reduce
min-heightin CSS to allow the input to sit flush as a single line.
- Change the default
-
Dynamic Height Adjustment:
- Implement a logic (likely within
handleInputor a dedicatedcreateEffect) that sets thetextarea.style.heighttoautothen totextarea.scrollHeight + 'px'. - Ensure this logic respects the manual "Expanded" state toggle.
- Implement a logic (likely within
-
Constraints & Scrolling:
- Define a maximum height for "Normal" mode (e.g.,
max-height: 200pxor ~8 lines). - Once the content exceeds this height, the input should stop expanding and enable a vertical scrollbar (
overflow-y: auto).
- Define a maximum height for "Normal" mode (e.g.,
-
Placeholder Handling:
- The initial height must be sufficient to show the placeholder text (which may wrap to 2 lines on very narrow mobile screens).
User Experience Goal
A cleaner, "chat-style" interface where the input field is discrete when idle but scales gracefully as the user drafts complex queries.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels