Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
613039c
🤖 Fix chat controls wrapping on constrained viewports
ammar-agent Oct 24, 2025
96ca07e
🤖 Decompose chat controls for proper shrinking behavior
ammar-agent Oct 24, 2025
e07dbac
🤖 Add min-w-0 to flex items to allow proper shrinking
ammar-agent Oct 24, 2025
f544ce0
🤖 Use overflow-x-auto and progressive hiding instead of wrapping
ammar-agent Oct 24, 2025
e251b11
🤖 Simplify chat controls to use idiomatic flex
ammar-agent Oct 24, 2025
36e77ab
🤖 Fix chat controls wrapping to prevent overflow
ammar-agent Oct 24, 2025
598baec
🤖 Improve chat controls spacing and layout
ammar-agent Oct 24, 2025
768395f
🤖 Simplify chat controls layout - remove justify-between
ammar-agent Oct 24, 2025
b86cc3f
🤖 Add ml-auto to mode toggles to utilize full width
ammar-agent Oct 24, 2025
3a72235
🤖 Remove ml-auto for even spacing across all controls
ammar-agent Oct 24, 2025
27fece7
🤖 Add gap-1.5 to mode toggles wrapper for internal spacing
ammar-agent Oct 24, 2025
7b777bf
🤖 Use justify-between for controls to fill available width
ammar-agent Oct 24, 2025
559f8e2
🤖 Remove 'Thinking:' label from slider, clarify in tooltip
ammar-agent Oct 24, 2025
aba6970
🤖 Apply prettier formatting
ammar-agent Oct 24, 2025
f75bb50
🤖 Update E2E test for thinking slider aria-label
ammar-agent Oct 24, 2025
f37fa6f
🤖 Add vertical spacing on wrap and push mode toggles right
ammar-agent Oct 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 44 additions & 32 deletions src/components/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { createCommandToast, createErrorToast } from "./ChatInputToasts";
import { parseCommand } from "@/utils/slashCommands/parser";
import { usePersistedState, updatePersistedState } from "@/hooks/usePersistedState";
import { useMode } from "@/contexts/ModeContext";
import { ChatToggles } from "./ChatToggles";
import { ThinkingSliderComponent } from "./ThinkingSlider";
import { Context1MCheckbox } from "./Context1MCheckbox";
import { useSendMessageOptions } from "@/hooks/useSendMessageOptions";
import { getModelKey, getInputKey } from "@/constants/storage";
import {
Expand Down Expand Up @@ -746,37 +747,48 @@ export const ChatInput: React.FC<ChatInputProps> = ({
Editing message ({formatKeybind(KEYBINDS.CANCEL_EDIT)} to cancel)
</div>
)}
<div className="flex items-center">
<ChatToggles modelString={preferredModel}>
<div className="mr-3 flex items-center gap-1.5">
<ModelSelector
ref={modelSelectorRef}
value={preferredModel}
onChange={setPreferredModel}
recentModels={recentModels}
onComplete={() => inputRef.current?.focus()}
/>
<TooltipWrapper inline>
<HelpIndicator>?</HelpIndicator>
<Tooltip className="tooltip" align="left" width="wide">
<strong>Click to edit</strong> or use{" "}
{formatKeybind(KEYBINDS.OPEN_MODEL_SELECTOR)}
<br />
<br />
<strong>Abbreviations:</strong>
<br />• <code>/model opus</code> - Claude Opus 4.1
<br />• <code>/model sonnet</code> - Claude Sonnet 4.5
<br />
<br />
<strong>Full format:</strong>
<br />
<code>/model provider:model-name</code>
<br />
(e.g., <code>/model anthropic:claude-sonnet-4-5</code>)
</Tooltip>
</TooltipWrapper>
</div>
</ChatToggles>
<div className="flex flex-wrap items-center gap-x-3 gap-y-2">
{/* Model Selector - always visible */}
<div className="flex items-center" data-component="ModelSelectorGroup">
<ModelSelector
ref={modelSelectorRef}
value={preferredModel}
onChange={setPreferredModel}
recentModels={recentModels}
onComplete={() => inputRef.current?.focus()}
/>
<TooltipWrapper inline>
<HelpIndicator>?</HelpIndicator>
<Tooltip className="tooltip" align="left" width="wide">
<strong>Click to edit</strong> or use {formatKeybind(KEYBINDS.OPEN_MODEL_SELECTOR)}
<br />
<br />
<strong>Abbreviations:</strong>
<br />• <code>/model opus</code> - Claude Opus 4.1
<br />• <code>/model sonnet</code> - Claude Sonnet 4.5
<br />
<br />
<strong>Full format:</strong>
<br />
<code>/model provider:model-name</code>
<br />
(e.g., <code>/model anthropic:claude-sonnet-4-5</code>)
</Tooltip>
</TooltipWrapper>
</div>

{/* Thinking Slider - hide on small viewports */}
<div
className="max-@[600px]:hidden flex items-center"
data-component="ThinkingSliderGroup"
>
<ThinkingSliderComponent modelString={preferredModel} />
</div>

{/* Context 1M Checkbox - hide on smaller viewports */}
<div className="max-@[500px]:hidden flex items-center" data-component="Context1MGroup">
<Context1MCheckbox modelString={preferredModel} />
</div>
<div className="max-@[700px]:hidden ml-auto flex items-center gap-1.5">
<div
className={cn(
Expand Down
2 changes: 1 addition & 1 deletion src/components/Context1MCheckbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const Context1MCheckbox: React.FC<Context1MCheckboxProps> = ({ modelStrin
}

return (
<div className="ml-2 flex items-center gap-1.5">
<div className="flex items-center gap-1.5">
<label className="text-foreground flex cursor-pointer items-center gap-1 truncate text-[10px] select-none hover:text-white">
<input type="checkbox" checked={use1M} onChange={(e) => setUse1M(e.target.checked)} />
1M Context
Expand Down
13 changes: 6 additions & 7 deletions src/components/ThinkingSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ export const ThinkingSliderComponent: React.FC<ThinkingControlProps> = ({ modelS

return (
<TooltipWrapper>
<div className="ml-5 flex items-center gap-2">
<label className="text-subdued text-[10px] select-none">Thinking:</label>
<div className="flex items-center gap-2">
<span
className="min-w-11 uppercase transition-all duration-200 select-none"
style={textStyle}
Expand Down Expand Up @@ -127,10 +126,7 @@ export const ThinkingSliderComponent: React.FC<ThinkingControlProps> = ({ modelS

return (
<TooltipWrapper>
<div className="ml-5 flex items-center gap-2">
<label htmlFor={sliderId} className="text-subdued text-[10px] select-none">
Thinking:
</label>
<div className="flex items-center gap-2">
<input
type="range"
min="0"
Expand All @@ -148,6 +144,7 @@ export const ThinkingSliderComponent: React.FC<ThinkingControlProps> = ({ modelS
aria-valuemax={3}
aria-valuenow={value}
aria-valuetext={thinkingLevel}
aria-label="Thinking level"
className="thinking-slider"
style={
{
Expand All @@ -165,7 +162,9 @@ export const ThinkingSliderComponent: React.FC<ThinkingControlProps> = ({ modelS
{thinkingLevel}
</span>
</div>
<Tooltip align="center">{formatKeybind(KEYBINDS.TOGGLE_THINKING)} to toggle</Tooltip>
<Tooltip align="center">
Thinking: {formatKeybind(KEYBINDS.TOGGLE_THINKING)} to toggle
</Tooltip>
</TooltipWrapper>
);
};
2 changes: 1 addition & 1 deletion tests/e2e/utils/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function sanitizeMode(mode: ChatMode): ChatMode {
}

function sliderLocator(page: Page): Locator {
return page.getByRole("slider", { name: "Thinking:" });
return page.getByRole("slider", { name: "Thinking level" });
}

function transcriptLocator(page: Page): Locator {
Expand Down