Skip to content

Commit f544ce0

Browse files
committed
🤖 Use overflow-x-auto and progressive hiding instead of wrapping
Changed approach from flex-wrap to overflow scrolling with progressive hiding of controls on smaller viewports: - Parent container: overflow-x-auto (allows horizontal scroll as last resort) - ModelSelector: always visible, pr-3 spacing - ThinkingSlider: hidden below 600px (@container width) - Context1M: hidden below 500px (@container width) - Mode toggles: hidden below 700px (@container width, existing) This approach: - Prevents awkward wrapping with hardcoded component margins (ml-5, ml-2) - Progressively removes less critical controls on narrow viewports - Allows horizontal scroll if all else fails - Respects existing component layouts
1 parent e07dbac commit f544ce0

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/components/ChatInput.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,10 @@ export const ChatInput: React.FC<ChatInputProps> = ({
747747
Editing message ({formatKeybind(KEYBINDS.CANCEL_EDIT)} to cancel)
748748
</div>
749749
)}
750-
<div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1">
751-
{/* Model Selector */}
750+
<div className="flex items-center overflow-x-auto overflow-y-hidden">
751+
{/* Model Selector - always visible */}
752752
<div
753-
className="flex min-w-0 shrink items-center gap-1.5"
753+
className="flex shrink-0 items-center gap-1.5 pr-3"
754754
data-component="ModelSelectorGroup"
755755
>
756756
<ModelSelector
@@ -780,13 +780,19 @@ export const ChatInput: React.FC<ChatInputProps> = ({
780780
</TooltipWrapper>
781781
</div>
782782

783-
{/* Thinking Slider */}
784-
<div className="flex min-w-0 shrink-0 items-center" data-component="ThinkingSliderGroup">
783+
{/* Thinking Slider - hide on small viewports */}
784+
<div
785+
className="max-@[600px]:hidden flex shrink-0 items-center"
786+
data-component="ThinkingSliderGroup"
787+
>
785788
<ThinkingSliderComponent modelString={preferredModel} />
786789
</div>
787790

788-
{/* Context 1M Checkbox */}
789-
<div className="flex min-w-0 shrink-0 items-center" data-component="Context1MGroup">
791+
{/* Context 1M Checkbox - hide on smaller viewports */}
792+
<div
793+
className="max-@[500px]:hidden flex shrink-0 items-center"
794+
data-component="Context1MGroup"
795+
>
790796
<Context1MCheckbox modelString={preferredModel} />
791797
</div>
792798
<div className="max-@[700px]:hidden ml-auto flex items-center gap-1.5">

0 commit comments

Comments
 (0)