You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Fix chat controls wrapping on constrained viewports (#411)
## Problem
Chat controls under ChatInput (ModelSelector, ThinkingSlider,
Context1MCheckbox, mode toggles) don't adapt properly to constrained
viewports, causing horizontal overflow or awkward wrapping.
## Root Cause
The individual control components have hardcoded left margins
(`ThinkingSlider` has `ml-5`, `Context1MCheckbox` has `ml-2`) that are
part of their content size. These margins prevent proper flex wrapping
behavior.
## Solution
Changed from a wrapping approach to **progressive hiding** with
**overflow scrolling** as a fallback:
### Container
- `overflow-x-auto` - allows horizontal scroll as last resort
- `overflow-y-hidden` - prevents vertical scroll
### Progressive Hiding (using container queries)
Controls are hidden based on viewport width, from least to most
critical:
1. **Mode toggles** (`max-@[700px]:hidden`) - hide below 700px
(existing)
2. **ThinkingSlider** (`max-@[600px]:hidden`) - hide below 600px (new)
3. **Context1M** (`max-@[500px]:hidden`) - hide below 500px (new)
4. **ModelSelector** - always visible (most critical)
## Benefits
- ✅ Works WITH existing component layouts (respects hardcoded margins)
- ✅ Gracefully removes less critical controls on narrow viewports
- ✅ Horizontal scroll available if viewport is extremely constrained
- ✅ No awkward wrapping to multiple lines
- ✅ Each component has `data-component` attribute for easy debugging
## Changes
- Modified controls container in `ChatInput.tsx`
- Replaced `flex-wrap` with `overflow-x-auto`
- Added container query breakpoints for progressive hiding
- Removed `min-w-0` flex hacks (no longer needed)
_Generated with `cmux`_
0 commit comments