Skip to content

Commit 3605019

Browse files
committed
fix(app): mobile prompt input buttons overflow on narrow viewports
- Use tighter gap spacing on mobile (gap-1 vs gap-2) - Add shrink-0 to prevent buttons from compressing - Hide text labels on mobile for model selector (icons only) - Show brain icon for variant button on mobile
1 parent 22353f0 commit 3605019

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

packages/app/src/components/prompt-input.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,8 +1002,8 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
10021002
</div>
10031003
</Show>
10041004
</div>
1005-
<div class="relative p-3 flex items-center justify-between gap-2">
1006-
<div class="flex items-center gap-2 min-w-0 flex-1">
1005+
<div class="relative p-3 flex items-center justify-between gap-1 sm:gap-2">
1006+
<div class="flex items-center gap-1 sm:gap-2 min-w-0 flex-1">
10071007
<Switch>
10081008
<Match when={store.mode === "shell"}>
10091009
<div class="flex items-center gap-2 px-2 h-6">
@@ -1040,13 +1040,13 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
10401040
<Button
10411041
as="div"
10421042
variant="ghost"
1043-
class="px-2 min-w-0 max-w-[240px]"
1043+
class="px-2 min-w-0 max-w-[140px] sm:max-w-[240px] shrink-0"
10441044
onClick={() => dialog.show(() => <DialogSelectModelUnpaid />)}
10451045
>
10461046
<Show when={local.model.current()?.provider?.id}>
10471047
<ProviderIcon id={local.model.current()!.provider.id as IconName} class="size-4 shrink-0" />
10481048
</Show>
1049-
<span class="truncate">
1049+
<span class="truncate hidden sm:inline">
10501050
{local.model.current()?.name ?? language.t("dialog.model.select.title")}
10511051
</span>
10521052
<Icon name="chevron-down" size="small" class="shrink-0" />
@@ -1062,12 +1062,12 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
10621062
>
10631063
<ModelSelectorPopover
10641064
triggerAs={Button}
1065-
triggerProps={{ variant: "ghost", class: "min-w-0 max-w-[240px]" }}
1065+
triggerProps={{ variant: "ghost", class: "min-w-0 max-w-[140px] sm:max-w-[240px] shrink-0" }}
10661066
>
10671067
<Show when={local.model.current()?.provider?.id}>
10681068
<ProviderIcon id={local.model.current()!.provider.id as IconName} class="size-4 shrink-0" />
10691069
</Show>
1070-
<span class="truncate">
1070+
<span class="truncate hidden sm:inline">
10711071
{local.model.current()?.name ?? language.t("dialog.model.select.title")}
10721072
</span>
10731073
<Icon name="chevron-down" size="small" class="shrink-0" />
@@ -1084,10 +1084,15 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
10841084
<Button
10851085
data-action="model-variant-cycle"
10861086
variant="ghost"
1087-
class="text-text-base _hidden group-hover/prompt-input:inline-block capitalize text-12-regular"
1087+
class="text-text-base _hidden group-hover/prompt-input:inline-block capitalize text-12-regular shrink-0"
10881088
onClick={() => local.model.variant.cycle()}
10891089
>
1090-
{local.model.variant.current() ?? language.t("common.default")}
1090+
<span class="hidden sm:inline">
1091+
{local.model.variant.current() ?? language.t("common.default")}
1092+
</span>
1093+
<span class="sm:hidden">
1094+
<Icon name="brain" size="small" />
1095+
</span>
10911096
</Button>
10921097
</TooltipKeybind>
10931098
</Show>

0 commit comments

Comments
 (0)