Skip to content

Commit d9592d3

Browse files
committed
small fixes
1 parent 6c94ce9 commit d9592d3

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/client/components/ChatV2/ChatV2.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ export const ChatV2 = () => {
194194
setMessage({ content: '' })
195195
setPrevResponse({ id: '' })
196196
setCompletion('')
197+
setIsCompletionDone(true)
197198
setFileSearchResult(null)
198199
setStreamController(undefined)
199200
setTokenUsageWarning('')
@@ -207,6 +208,7 @@ export const ChatV2 = () => {
207208
}
208209

209210
useEffect(() => {
211+
// Keep this useEffect for autoscroll effect
210212
if (!appContainerRef.current || !conversationRef.current || !settingsRef.current || messages.length === 0) return
211213

212214
const lastNode = conversationRef.current.lastElementChild as HTMLElement
@@ -218,7 +220,7 @@ export const ChatV2 = () => {
218220
const containerRect = container.getBoundingClientRect()
219221
const lastNodeRect = lastNode.getBoundingClientRect()
220222

221-
const scrollTopPadding = 100
223+
const scrollTopPadding = 180
222224
const scrollOffset = lastNodeRect.top - containerRect.top + container.scrollTop - settingsHeight - scrollTopPadding
223225

224226
container.scrollTo({
@@ -239,7 +241,7 @@ export const ChatV2 = () => {
239241
>
240242
{/* Course chats columns */}
241243
<Box sx={{ position: 'relative', flex: 1, borderRight: '1px solid lightgray' }}>
242-
<Box sx={{ position: 'sticky', left: 0, top: 0, padding: '2rem 1.5rem' }}>
244+
<Box sx={{ position: 'sticky', top: 80, padding: '2rem 1.5rem' }}>
243245
<Typography variant="h6" fontWeight="light">
244246
Currechat
245247
</Typography>
@@ -267,7 +269,7 @@ export const ChatV2 = () => {
267269
ref={settingsRef}
268270
sx={{
269271
position: 'sticky',
270-
top: 0,
272+
top: 80,
271273
display: 'flex',
272274
justifyContent: 'center',
273275
alignItems: 'center',
@@ -299,7 +301,6 @@ export const ChatV2 = () => {
299301
height: '100%',
300302
display: 'flex',
301303
flexDirection: 'column',
302-
gap: 3,
303304
width: '70%',
304305
margin: 'auto',
305306
paddingBottom: '5rem',
@@ -332,7 +333,7 @@ export const ChatV2 = () => {
332333
{/* Annotations columns */}
333334
<Box sx={{ flex: 1, borderLeft: 'none', position: 'relative' }}>
334335
{ragIndex && (
335-
<Box sx={{ position: 'sticky', top: 0 }}>
336+
<Box sx={{ position: 'sticky', top: 80 }}>
336337
<CitationsBox messages={messages} fileSearchResult={fileSearchResult} />
337338
</Box>
338339
)}

src/client/components/ChatV2/Conversation.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ const MessageItem = ({ message, isLastAssistantNode, lastNodeHeight }: { message
5353
height: isLastAssistantNode ? lastNodeHeight : 'auto',
5454
}}
5555
>
56-
<Typography>
57-
<ReactMarkdown remarkPlugins={[remarkGfm]}>{message.content}</ReactMarkdown>
58-
</Typography>
56+
<ReactMarkdown remarkPlugins={[remarkGfm]}>{message.content}</ReactMarkdown>
5957
</Box>
6058
)
6159

@@ -74,7 +72,7 @@ export const Conversation = ({
7472
isCompletionDone: boolean
7573
fileSearchResult: FileSearchResult
7674
}) => (
77-
<Box style={{ height: '100%', display: 'flex', flexDirection: 'column', gap: 20 }} ref={conversationRef}>
75+
<Box style={{ height: '100%', display: 'flex', flexDirection: 'column', gap: '2.5rem' }} ref={conversationRef}>
7876
{messages.length === 0 && <ConversationSplash />}
7977
{messages.map((message, idx) => {
8078
const isLastAssistantNode = idx === messages.length - 1 && message.role === 'assistant'

src/client/components/NavBar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const NavBar = () => {
3232
if (!user) return null
3333

3434
return (
35-
<AppBar elevation={0} position="relative" sx={styles.appbar} color="transparent">
35+
<AppBar elevation={0} position="sticky" sx={styles.appbar} color="transparent">
3636
<Container maxWidth={false}>
3737
<Toolbar sx={styles.toolbar} disableGutters>
3838
<MuiLink to="/" sx={styles.navBox} component={Link} reloadDocument>

src/client/components/NavBar/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SxProps, Theme } from '@mui/material/styles'
22

33
const styles: { [key: string]: SxProps<Theme> } = {
44
appbar: {
5+
backgroundColor: 'white',
56
zIndex: (theme: Theme) => theme.zIndex.drawer + 1,
67
borderBottom: '1px solid',
78
borderColor: (theme: Theme) => theme.palette.divider,

0 commit comments

Comments
 (0)