fix(app): conditionally show model variant selector (#24115)

This commit is contained in:
Brendan Allan
2026-04-24 15:20:53 +08:00
committed by GitHub
parent a4bd88ab97
commit f033d2d8fb

View File

@@ -1574,33 +1574,35 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
</TooltipKeybind> </TooltipKeybind>
</Show> </Show>
</div> </div>
<div <Show when={variants().length > 2}>
data-component="prompt-variant-control" <div
style={providersShouldFadeIn() ? { animation: "fade-in 0.3s" } : undefined} data-component="prompt-variant-control"
> style={providersShouldFadeIn() ? { animation: "fade-in 0.3s" } : undefined}
<TooltipKeybind
placement="top"
gutter={4}
title={language.t("command.model.variant.cycle")}
keybind={command.keybind("model.variant.cycle")}
> >
<Select <TooltipKeybind
size="normal" placement="top"
options={variants()} gutter={4}
current={local.model.variant.current() ?? "default"} title={language.t("command.model.variant.cycle")}
label={(x) => (x === "default" ? language.t("common.default") : x)} keybind={command.keybind("model.variant.cycle")}
onSelect={(value) => { >
local.model.variant.set(value === "default" ? undefined : value) <Select
restoreFocus() size="normal"
}} options={variants()}
class="capitalize max-w-[160px] text-text-base" current={local.model.variant.current() ?? "default"}
valueClass="truncate text-13-regular text-text-base" label={(x) => (x === "default" ? language.t("common.default") : x)}
triggerStyle={control()} onSelect={(value) => {
triggerProps={{ "data-action": "prompt-model-variant" }} local.model.variant.set(value === "default" ? undefined : value)
variant="ghost" restoreFocus()
/> }}
</TooltipKeybind> class="capitalize max-w-[160px] text-text-base"
</div> valueClass="truncate text-13-regular text-text-base"
triggerStyle={control()}
triggerProps={{ "data-action": "prompt-model-variant" }}
variant="ghost"
/>
</TooltipKeybind>
</div>
</Show>
</Show> </Show>
</Show> </Show>
</div> </div>