Update UI elements and styles in ChatPanel component
- Imported Chip from '@mantine/core' for better UI representation. - Adjusted minimum width and bottom position of the chat panel for better layout. - Replaced Radio.Group with Chip.Group for selecting chat model, improving user interaction. - Removed unnecessary Flex container wrapping the chat model selection.
This commit is contained in:
parent
3430a7f199
commit
e71d4c9209
@ -1,6 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
import { ActionIcon, Alert, Anchor, Box, Button, Center, Container, Flex, Group, Radio, Stack, px } from '@mantine/core';
|
import { ActionIcon, Alert, Anchor, Box, Button, Center, Chip, Container, Flex, Group, Radio, Stack, px } from '@mantine/core';
|
||||||
import { ScrollArea } from '@mantine/core';
|
import { ScrollArea } from '@mantine/core';
|
||||||
import { useInterval, useResizeObserver, useTimeout, useViewportSize } from '@mantine/hooks';
|
import { useInterval, useResizeObserver, useTimeout, useViewportSize } from '@mantine/hooks';
|
||||||
import messageUtil from '@/util/MessageUtil';
|
import messageUtil from '@/util/MessageUtil';
|
||||||
@ -121,18 +121,18 @@ const chatPanel = observer(() => {
|
|||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
ref={chatContainerRef}
|
ref={chatContainerRef}
|
||||||
|
miw={310}
|
||||||
sx={{
|
sx={{
|
||||||
height: '100%',
|
height: '100%',
|
||||||
margin: 0,
|
margin: 0,
|
||||||
padding: '10px 10px 5px 10px',
|
padding: '10px 10px 5px 10px',
|
||||||
background: 'var(--vscode-sideBar-background)',
|
background: 'var(--vscode-sideBar-background)',
|
||||||
color: 'var(--vscode-editor-foreground)',
|
color: 'var(--vscode-editor-foreground)'
|
||||||
minWidth: 240
|
|
||||||
}}>
|
}}>
|
||||||
{!chat.isBottom && <ActionIcon
|
{!chat.isBottom && <ActionIcon
|
||||||
onClick={() => { scrollToBottom() }}
|
onClick={() => { scrollToBottom() }}
|
||||||
title='Bottom'
|
title='Bottom'
|
||||||
variant='transparent' sx={{ position: "absolute", bottom: 75, right: 20, zIndex: 999 }}>
|
variant='transparent' sx={{ position: "absolute", bottom: 80, right: 20, zIndex: 1 }}>
|
||||||
<IconCircleArrowDownFilled size="1.125rem" />
|
<IconCircleArrowDownFilled size="1.125rem" />
|
||||||
</ActionIcon>}
|
</ActionIcon>}
|
||||||
<ScrollArea
|
<ScrollArea
|
||||||
@ -161,7 +161,7 @@ const chatPanel = observer(() => {
|
|||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
<Stack
|
<Stack
|
||||||
spacing={0}
|
spacing={0}
|
||||||
sx={{ position: 'absolute', bottom: 10, width: 'calc(100% - 20px)' }}>
|
sx={{ position: 'absolute', bottom: 10, width: chatPanelWidth - 20 }}>
|
||||||
{chat.generating &&
|
{chat.generating &&
|
||||||
<Center mb={5}>
|
<Center mb={5}>
|
||||||
<StopButton />
|
<StopButton />
|
||||||
@ -173,32 +173,23 @@ const chatPanel = observer(() => {
|
|||||||
</Center>
|
</Center>
|
||||||
}
|
}
|
||||||
<InputMessage chatPanelWidth={chatPanelWidth} />
|
<InputMessage chatPanelWidth={chatPanelWidth} />
|
||||||
<Flex
|
<Chip.Group multiple={false}
|
||||||
gap="md"
|
value={chat.chatModel}
|
||||||
justify="flex-start"
|
onChange={(value) => {
|
||||||
align="center"
|
chat.changeChatModel(value);
|
||||||
direction="row"
|
messageUtil.sendMessage({
|
||||||
wrap="wrap">
|
command: 'updateSetting',
|
||||||
|
key1: "DevChat",
|
||||||
<Radio.Group
|
key2: "OpenAI.model",
|
||||||
value={chat.chatModel}
|
value: value
|
||||||
onChange={(value) => {
|
});
|
||||||
chat.changeChatModel(value);
|
}} >
|
||||||
messageUtil.sendMessage({
|
<Group position="left" spacing={5} mt={5}>
|
||||||
command: 'updateSetting',
|
<Chip size="xs" value="gpt-4">GPT-4</Chip>
|
||||||
key1: "DevChat",
|
<Chip size="xs" value="gpt-3.5-turbo">GPT-3.5</Chip>
|
||||||
key2: "OpenAI.model",
|
<Chip size="xs" value="gpt-3.5-turbo-16k">GPT-3.5-16K</Chip>
|
||||||
value: value
|
</Group>
|
||||||
});
|
</Chip.Group>
|
||||||
}}
|
|
||||||
withAsterisk>
|
|
||||||
<Group mt="xs">
|
|
||||||
<Radio size="xs" value="gpt-4" label="gpt-4" />
|
|
||||||
<Radio size="xs" value="gpt-3.5-turbo" label="gpt-3.5-turbo" />
|
|
||||||
<Radio size="xs" value="gpt-3.5-turbo-16k" label="gpt-3.5-turbo-16k" />
|
|
||||||
</Group>
|
|
||||||
</Radio.Group>
|
|
||||||
</Flex>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user