@@ -42,6 +42,7 @@ import { Select } from "@opencode-ai/ui/select"
4242import { getDirectory , getFilename , getFilenameTruncated } from "@opencode-ai/util/path"
4343import { useDialog } from "@opencode-ai/ui/context/dialog"
4444import { ImagePreview } from "@opencode-ai/ui/image-preview"
45+
4546import { ModelSelectorPopover } from "@/components/dialog-select-model"
4647import { DialogSelectModelUnpaid } from "@/components/dialog-select-model-unpaid"
4748import { useProviders } from "@/hooks/use-providers"
@@ -1616,6 +1617,15 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
16161617 } )
16171618 }
16181619
1620+ const currentModelVariant = createMemo ( ( ) => {
1621+ const modelVariant = local . model . variant . current ( ) ?? ""
1622+ return modelVariant === "xhigh"
1623+ ? "xHigh"
1624+ : modelVariant . length > 0
1625+ ? modelVariant [ 0 ] . toUpperCase ( ) + modelVariant . slice ( 1 )
1626+ : "Default"
1627+ } )
1628+
16191629 return (
16201630 < div class = "relative size-full _max-h-[320px] flex flex-col gap-3" >
16211631 < Show when = { store . popover } >
@@ -1890,8 +1900,8 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
18901900 </ div >
18911901 </ Show >
18921902 </ div >
1893- < div class = "relative p-3 flex items-center justify-between" >
1894- < div class = "flex items-center justify-start gap-0.5" >
1903+ < div class = "relative p-3 flex items-center gap-2 sm:gap-0 sm: justify-between" >
1904+ < div class = "contents sm: flex sm: items-center sm: justify-start sm: gap-0.5 sm:min-w-0 " >
18951905 < Switch >
18961906 < Match when = { store . mode === "shell" } >
18971907 < div class = "flex items-center gap-2 px-2 h-6" >
@@ -1910,7 +1920,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
19101920 options = { local . agent . list ( ) . map ( ( agent ) => agent . name ) }
19111921 current = { local . agent . current ( ) ?. name ?? "" }
19121922 onSelect = { local . agent . set }
1913- class = "capitalize"
1923+ class = "capitalize shrink-0 "
19141924 variant = "ghost"
19151925 />
19161926 </ TooltipKeybind >
@@ -1925,7 +1935,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
19251935 < Button
19261936 as = "div"
19271937 variant = "ghost"
1928- class = "p-2 -m-2 sm:p-0 sm:m -0"
1938+ class = "shrink -0"
19291939 onClick = { ( ) => dialog . show ( ( ) => < DialogSelectModelUnpaid /> ) }
19301940 >
19311941 < Show when = { local . model . current ( ) ?. provider ?. id } >
@@ -1934,7 +1944,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
19341944 < span class = "hidden sm:inline" >
19351945 { local . model . current ( ) ?. name ?? language . t ( "dialog.model.select.title" ) }
19361946 </ span >
1937- < Icon name = "chevron-down" size = "small" class = "hidden sm:block " />
1947+ < Icon name = "chevron-down" class = "size-3.5 " />
19381948 </ Button >
19391949 </ TooltipKeybind >
19401950 }
@@ -1946,15 +1956,18 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
19461956 >
19471957 < ModelSelectorPopover
19481958 triggerAs = { Button }
1949- triggerProps = { { variant : "ghost" , class : "p-2 -m-2 sm:p-0 sm:m-0" } }
1959+ triggerProps = { {
1960+ variant : "ghost" ,
1961+ class : "shrink-0" ,
1962+ } }
19501963 >
19511964 < Show when = { local . model . current ( ) ?. provider ?. id } >
19521965 < ProviderIcon id = { local . model . current ( ) ! . provider . id as IconName } class = "size-4 shrink-0" />
19531966 </ Show >
19541967 < span class = "hidden sm:inline" >
19551968 { local . model . current ( ) ?. name ?? language . t ( "dialog.model.select.title" ) }
19561969 </ span >
1957- < Icon name = "chevron-down" size = "small" class = "hidden sm:block " />
1970+ < Icon name = "chevron-down" class = "size-3.5 " />
19581971 </ ModelSelectorPopover >
19591972 </ TooltipKeybind >
19601973 </ Show >
@@ -1964,17 +1977,22 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
19641977 title = { language . t ( "command.model.variant.cycle" ) }
19651978 keybind = { command . keybind ( "model.variant.cycle" ) }
19661979 >
1967- < Button
1968- data-action = "model-variant-cycle"
1980+ < Select
1981+ options = { local . model . variant
1982+ . list ( )
1983+ . map ( ( v ) => ( v === "" ? "Default" : v === "xhigh" ? "xHigh" : v [ 0 ] . toUpperCase ( ) + v . slice ( 1 ) ) ) }
1984+ current = { currentModelVariant ( ) }
1985+ onSelect = { ( display ) => {
1986+ if ( ! display ) return
1987+ const variant =
1988+ display === "Default" ? "" : display === "xHigh" ? "xhigh" : display . toLowerCase ( )
1989+ local . model . variant . set ( variant )
1990+ } }
1991+ class = "shrink-0"
19691992 variant = "ghost"
1970- class = "p-2 -m-2 sm:p-0 sm:m-0 text-text-base _hidden group-hover/prompt-input:inline-block capitalize text-12-regular"
1971- onClick = { ( ) => local . model . variant . cycle ( ) }
1972- >
1973- < Icon name = "brain" size = "small" class = "sm:hidden" />
1974- < span class = "hidden sm:inline" >
1975- { local . model . variant . current ( ) ?? language . t ( "common.default" ) }
1976- </ span >
1977- </ Button >
1993+ icon = { < Icon name = "bulb" class = "size-4 shrink-0" /> }
1994+ valueClass = "hidden sm:inline"
1995+ />
19781996 </ TooltipKeybind >
19791997 </ Show >
19801998 < Show when = { permission . permissionsEnabled ( ) && params . id } >
@@ -2009,7 +2027,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
20092027 </ Match >
20102028 </ Switch >
20112029 </ div >
2012- < div class = "flex items-center gap-3 absolute right-3 bottom-3 " >
2030+ < div class = "contents sm: flex sm: items-center sm: gap-3 sm:shrink-0 " >
20132031 < input
20142032 ref = { fileInputRef }
20152033 type = "file"
@@ -2021,18 +2039,17 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
20212039 e . currentTarget . value = ""
20222040 } }
20232041 />
2024- < div class = "flex items-center gap-2" >
2042+ < div class = "contents sm: flex sm: items-center sm: gap-2" >
20252043 < SessionContextUsage />
20262044 < Show when = { store . mode === "normal" } >
20272045 < Tooltip placement = "top" value = { language . t ( "prompt.action.attachFile" ) } >
20282046 < Button
20292047 type = "button"
20302048 variant = "ghost"
2031- class = "size-6 p-2 -m-2 sm:p-0 sm:m-0"
20322049 onClick = { ( ) => fileInputRef . click ( ) }
20332050 aria-label = { language . t ( "prompt.action.attachFile" ) }
20342051 >
2035- < Icon name = "photo" class = "size-4.5" />
2052+ < Icon name = "photo" />
20362053 </ Button >
20372054 </ Tooltip >
20382055 </ Show >
@@ -2062,7 +2079,6 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
20622079 disabled = { ! prompt . dirty ( ) && ! working ( ) }
20632080 icon = { working ( ) ? "stop" : "arrow-up" }
20642081 variant = "primary"
2065- class = "h-6 w-4.5 p-2 -m-2 sm:p-0 sm:m-0"
20662082 aria-label = { working ( ) ? language . t ( "prompt.action.stop" ) : language . t ( "prompt.action.send" ) }
20672083 />
20682084 </ Tooltip >
0 commit comments