feat: Implement expandable chat input with double-click detection and gradient tooltip#62
Merged
shantur merged 10 commits intoNeuralNomadsAI:devfrom Jan 14, 2026
Merged
Conversation
… gradient tooltip - Add expand button with Maximize2/Minimize2 icons - Implement 3-state height management (normal/50%/80%) - Smart double-click detection with 300ms delay - Height calculation based on session-view - 200px message space - Custom CSS tooltip with dark gradient background and backdrop blur - Send button anchored at bottom via margin-top: auto - Smooth CSS transitions throughout - Double-click at 80% now reduces to 50% (not normal) - Removed all debug console.log statements
d68d0cf to
0d8a844
Compare
shantur
reviewed
Jan 12, 2026
Collaborator
|
Hi @bizzkoot , Thanks for the PR. As of now the calculation is around 4 lines, maybe one state could be 15 lines. Let me know what you think Thanks |
…izations - Add platform detection (Electron vs Web) for expand behavior - Electron: 3-state (normal → 50% → 80%) with double-click - Web/Mobile: 2-state (normal → expanded) with instant single tap - Implement fixed 15-line height for web/mobile (360px, capped) - Add orientation-aware height calculation (landscape vs portrait) - Remove tooltip on web/mobile, keep for Electron desktop - Add responsive placeholder text to prevent overlap on mobile - Desktop: "Type your message, @file, @agent, or paste images and text..." - Mobile (≤640px): "Type message, @file, @agent..." - Delete dev-docs/expand-chat-input.md per upstream feedback Addresses PR feedback to simplify from 3-state to 2-state for web/mobile while maintaining rich desktop experience in Electron app.
Contributor
Author
|
Hi @shantur , I did a short test before doing the PR, seems workable. But I do agree with your idea. So I implemented it (but limited to web/mobile usage). I did saw the text is behind the maximize / minimize button, so I just make it shorter directly for web/mobile. I hope this meets your criteria. Thank you |
Collaborator
|
Thanks for updating.
The less logic in the app the better. |
… layout - Remove 3-state logic (normal/50%/80%) - now only normal/expanded - Remove double-click detection and tooltips for simplicity - Remove platform-specific behavior (same UX for Electron and web) - Optimize button layout: reduce from 36px to 28px to fit 3 buttons - Position expand button above history buttons in vertical stack - Keep 15-line expanded height (360px, capped to available space) Per upstream dev feedback to keep it simple with one approach
Contributor
Author
|
Done Screen.Recording.2026-01-13.at.6.49.52.AM.movScreen_Recording_20260113_065103_Chrome.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


feat: Implement expandable chat input with double-click detection and gradient tooltip
Summary
This PR adds an expand/minimize button to the chat input that allows users to toggle between 3 height states: normal (default/original), 50%, and 80% of available space. The feature includes smart double-click detection for quick navigation between states and a polished tooltip with gradient background for better visibility.
Changes
1. Expand Button Component (
packages/ui/src/components/expand-button.tsx)2. Prompt Input Enhancements (
packages/ui/src/components/prompt-input.tsx)expandStatesignal with 3 states:"normal" | "fifty" | "eighty"calculateExpandedHeight()function:.session-viewheightexpandedHeightmemo for reactive height updateshandleExpandToggle()function with textarea focus preservation.prompt-input-field-containerto use reactive height3. Styling (
packages/ui/src/styles/messaging/prompt-input.css).prompt-expand-toppositioning (top: 0.3rem, right: 3.5rem).prompt-expand-buttonstyles with hover/active stateslinear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%).prompt-input-actionsfromjustify-betweentojustify-startmargin-top: autoto.send-buttonto anchor at bottom.prompt-input-field-containerTechnical Details
Height Calculation Logic
Double-Click Detection Algorithm
State Transitions
Tooltip Text by State
Behavior Notes
Send button anchoring: The Send button stays at the bottom of the action bar using
margin-top: auto. Stop and Arrow buttons move with height changes (accepted behavior).Scrollbar support: When expanded, the textarea gets
overflow-y: autoto handle content overflow gracefully.Focus preservation: Expanding/collapsing keeps focus on the textarea for seamless typing.
Smooth transitions: All height changes animate over 250ms; tooltip fade-in is 200ms.
Tooltip positioning: The tooltip uses CSS
::afterpseudo-element withdata-tooltipattribute for instant hover feedback (no 1-2s delay like nativetitle).Testing Instructions
Basic expansion:
Double-click navigation:
Tooltip testing:
Content testing:
Keyboard shortcuts:
Cmd+Enterto send while expandedEscto exit shell mode (if applicable)↑↓for history navigation still worksBrowser Compatibility
This implementation uses standard CSS features:
backdrop-filterfor blur effect (supported in Chrome 76+, Firefox 103+, Safari 9+)Screenshots
Checklist
Related Issues
Breaking Changes
None. This is a new feature that doesn't modify existing behavior.