Преглед изворни кода

fix(app): defer model variant selector (#39445)

Brendan Allan пре 1 недеља
родитељ
комит
e8b0992788

+ 1 - 0
packages/app/src/components/prompt-input-v2.tsx

@@ -55,6 +55,7 @@ export function PromptInputV2Composer(props: PromptInputV2ComposerProps) {
         controller={props.controller}
         borderUnderlay={props.borderUnderlay}
         class={props.class}
+        variantControlVisible={!props.controller.model.loading}
         attachKeybind={command.keybindParts("file.attach")}
         attachShortcut={command.keybind("file.attach")}
         modelControl={

+ 2 - 1
packages/session-ui/src/v2/components/prompt-input/index.tsx

@@ -39,6 +39,7 @@ export type PromptInputV2Props = {
   borderUnderlay?: boolean
   class?: string
   modelControl?: JSX.Element
+  variantControlVisible?: boolean
   attachKeybind?: string[]
   attachShortcut?: string
 }
@@ -232,7 +233,7 @@ export function PromptInputV2(props: PromptInputV2Props) {
             >
               {props.modelControl}
             </Show>
-            <Show when={view.variant}>
+            <Show when={(props.variantControlVisible ?? true) && view.variant}>
               {(control) => (
                 <Show when={control().options().length > 1}>
                   <PromptInputV2ConfiguredSelect