mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 19:54:44 -07:00
less jarring initial loading of saved config values on the general tab
This commit is contained in:
parent
504fe809dd
commit
667d7e5ee2
2 changed files with 68 additions and 46 deletions
|
|
@ -1,10 +1,21 @@
|
||||||
import { Stack, Text, Group, TextInput, Slider } from '@mantine/core';
|
import {
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Group,
|
||||||
|
TextInput,
|
||||||
|
Slider,
|
||||||
|
Transition,
|
||||||
|
} from '@mantine/core';
|
||||||
import { InfoTooltip } from '@/components/InfoTooltip';
|
import { InfoTooltip } from '@/components/InfoTooltip';
|
||||||
import { BackendSelector } from '@/components/screens/Launch/GeneralTab/BackendSelector';
|
import { BackendSelector } from '@/components/screens/Launch/GeneralTab/BackendSelector';
|
||||||
import { ModelFileField } from '@/components/screens/Launch/ModelFileField';
|
import { ModelFileField } from '@/components/screens/Launch/ModelFileField';
|
||||||
import { useLaunchConfig } from '@/hooks/useLaunchConfig';
|
import { useLaunchConfig } from '@/hooks/useLaunchConfig';
|
||||||
|
|
||||||
export const GeneralTab = () => {
|
interface GeneralTabProps {
|
||||||
|
configLoaded?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const GeneralTab = ({ configLoaded = true }: GeneralTabProps) => {
|
||||||
const {
|
const {
|
||||||
model,
|
model,
|
||||||
contextSize,
|
contextSize,
|
||||||
|
|
@ -14,7 +25,14 @@ export const GeneralTab = () => {
|
||||||
} = useLaunchConfig();
|
} = useLaunchConfig();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack gap="md">
|
<Transition
|
||||||
|
mounted={configLoaded}
|
||||||
|
transition="fade"
|
||||||
|
duration={100}
|
||||||
|
timingFunction="ease-out"
|
||||||
|
>
|
||||||
|
{(styles) => (
|
||||||
|
<Stack gap="md" style={styles}>
|
||||||
<BackendSelector />
|
<BackendSelector />
|
||||||
|
|
||||||
<ModelFileField
|
<ModelFileField
|
||||||
|
|
@ -39,7 +57,9 @@ export const GeneralTab = () => {
|
||||||
<TextInput
|
<TextInput
|
||||||
value={contextSize?.toString() || ''}
|
value={contextSize?.toString() || ''}
|
||||||
onChange={(event) =>
|
onChange={(event) =>
|
||||||
handleContextSizeChangeWithStep(Number(event.target.value) || 256)
|
handleContextSizeChangeWithStep(
|
||||||
|
Number(event.target.value) || 256
|
||||||
|
)
|
||||||
}
|
}
|
||||||
type="number"
|
type="number"
|
||||||
min={256}
|
min={256}
|
||||||
|
|
@ -59,5 +79,7 @@ export const GeneralTab = () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
)}
|
||||||
|
</Transition>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ export const LaunchScreen = ({ onLaunch }: LaunchScreenProps) => {
|
||||||
</Tabs.List>
|
</Tabs.List>
|
||||||
|
|
||||||
<Tabs.Panel value="general">
|
<Tabs.Panel value="general">
|
||||||
<GeneralTab />
|
<GeneralTab configLoaded={configLoaded} />
|
||||||
</Tabs.Panel>
|
</Tabs.Panel>
|
||||||
|
|
||||||
<Tabs.Panel value="advanced">
|
<Tabs.Panel value="advanced">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue