diff options
| author | Brendan Allan <[email protected]> | 2026-04-24 15:20:53 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-24 15:20:53 +0800 |
| commit | f033d2d8fbb76d654e30697c99e4b7a0beb2be8a (patch) | |
| tree | 284ccffa90932244a83aff9cdf74d4156700ca09 /packages | |
| parent | a4bd88ab9702e1275438540812c1fb7de3ce87b5 (diff) | |
| download | opencode-f033d2d8fbb76d654e30697c99e4b7a0beb2be8a.tar.gz opencode-f033d2d8fbb76d654e30697c99e4b7a0beb2be8a.zip | |
fix(app): conditionally show model variant selector (#24115)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/app/src/components/prompt-input.tsx | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index 8b69f3b2a..0a1809616 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -1574,33 +1574,35 @@ export const PromptInput: Component<PromptInputProps> = (props) => { </TooltipKeybind> </Show> </div> - <div - 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")} + <Show when={variants().length > 2}> + <div + data-component="prompt-variant-control" + style={providersShouldFadeIn() ? { animation: "fade-in 0.3s" } : undefined} > - <Select - size="normal" - options={variants()} - current={local.model.variant.current() ?? "default"} - label={(x) => (x === "default" ? language.t("common.default") : x)} - onSelect={(value) => { - local.model.variant.set(value === "default" ? undefined : value) - restoreFocus() - }} - class="capitalize max-w-[160px] text-text-base" - valueClass="truncate text-13-regular text-text-base" - triggerStyle={control()} - triggerProps={{ "data-action": "prompt-model-variant" }} - variant="ghost" - /> - </TooltipKeybind> - </div> + <TooltipKeybind + placement="top" + gutter={4} + title={language.t("command.model.variant.cycle")} + keybind={command.keybind("model.variant.cycle")} + > + <Select + size="normal" + options={variants()} + current={local.model.variant.current() ?? "default"} + label={(x) => (x === "default" ? language.t("common.default") : x)} + onSelect={(value) => { + local.model.variant.set(value === "default" ? undefined : value) + restoreFocus() + }} + class="capitalize max-w-[160px] text-text-base" + valueClass="truncate text-13-regular text-text-base" + triggerStyle={control()} + triggerProps={{ "data-action": "prompt-model-variant" }} + variant="ghost" + /> + </TooltipKeybind> + </div> + </Show> </Show> </Show> </div> |
