Skip to content

Commit

Permalink
Models modal: simplify (disable the 'all services' button)
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Feb 11, 2025
1 parent 2eb230d commit e6af5e7
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/modules/llms/models-modal/ModelsModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { Box, Checkbox, Divider } from '@mui/joy';
import { Box, Divider } from '@mui/joy';

import type { DModelsService, DModelsServiceId } from '~/common/stores/llms/modelsservice.types';
import { GoodModal } from '~/common/components/modals/GoodModal';
Expand Down Expand Up @@ -28,7 +28,8 @@ export function ModelsModal(props: { suspendAutoModelsSetup?: boolean }) {

// local state
const [_selectedServiceId, setSelectedServiceId] = React.useState<DModelsServiceId | null>(null);
const [showAllServices, setShowAllServices] = React.useState<boolean>(false);
// const [showAllServices, setShowAllServices] = React.useState<boolean>(false);
const showAllServices = false;

// external state
const { showModels, showModelOptions } = useOptimaModelsModalsState();
Expand All @@ -41,7 +42,7 @@ export function ModelsModal(props: { suspendAutoModelsSetup?: boolean }) {

const activeService = modelsServices.find(s => s.id === selectedServiceId);

const multiService = modelsServices.length > 1;
// const multiService = modelsServices.length > 1;

// Auto-open this dialog - anytime no service is selected
const autoOpenTrigger = !selectedServiceId && !props.suspendAutoModelsSetup;
Expand All @@ -66,15 +67,16 @@ export function ModelsModal(props: { suspendAutoModelsSetup?: boolean }) {
{showModels && <GoodModal
title={<>Configure <b>AI Models</b></>}
open onClose={optimaActions().closeModels}
darkBottomClose
animateEnter={llmCount === 0}
unfilterBackdrop
startButton={
multiService ? <Checkbox
label='All Services'
sx={{ my: 'auto' }}
checked={showAllServices} onChange={() => setShowAllServices(all => !all)}
/> : undefined
}
// startButton={
// multiService ? <Checkbox
// label='All Services'
// sx={{ my: 'auto' }}
// checked={showAllServices} onChange={() => setShowAllServices(all => !all)}
// /> : undefined
// }
sx={{
// forces some shrinkage of the contents (ModelsList)
overflow: 'auto',
Expand Down Expand Up @@ -117,7 +119,7 @@ export function ModelsModal(props: { suspendAutoModelsSetup?: boolean }) {
/>
)}

<Divider />
<Divider sx={{ background: 'transparent'}} />

</GoodModal>}

Expand Down

0 comments on commit e6af5e7

Please sign in to comment.