Skip to content

Commit 517fdc2

Browse files
committed
layoiut improvements
1 parent 89de362 commit 517fdc2

File tree

6 files changed

+49
-52
lines changed

6 files changed

+49
-52
lines changed

src/client/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ const Layout = () => {
126126
ref={appRef}
127127
>
128128
{!isEmbedded && <NavBar />}
129-
<Box sx={{ flex: 1 }}>
129+
<Box sx={{ flex: 1, overscrollBehavior: 'none' }}>
130130
<Outlet />
131131
</Box>
132-
{!isEmbedded && <Footer />}
133132
<Feedback />
134133
</Box>
135134
<AdminLoggedInAsBanner />

src/client/components/ChatV2/Annotations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const Annotations = ({ fileSearchResult, setShowAnnotations }: { fileSearchResul
202202
p={{ xs: 1, md: 3 }}
203203
sx={{
204204
width: '100%',
205-
height: '90vh',
205+
height: '100%',
206206
display: 'flex',
207207
flexDirection: 'column',
208208
overflowY: 'scroll',

src/client/components/ChatV2/ChatV2.tsx

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import EmailButton from './EmailButton'
3434
import { MenuBookTwoTone, Tune } from '@mui/icons-material'
3535
import { useChatScroll } from '../../hooks/useChatScroll'
3636
import { TestUseInfoV2 } from './TestUseInfo'
37+
import Footer from '../Footer'
3738

3839
function useLocalStorageStateWithURLDefault(key: string, defaultValue: string, urlKey: string) {
3940
const [value, setValue] = useLocalStorageState(key, defaultValue)
@@ -347,10 +348,11 @@ export const ChatV2 = () => {
347348
sx={{
348349
display: 'flex',
349350
flexDirection: 'row',
350-
height: '100%',
351+
// height: '100%',
351352
width: '100%',
352353
maxWidth: '100%',
353354
overflowX: 'clip',
355+
overscrollBehavior: 'none',
354356
}}
355357
>
356358
{/* Chat side panel column -------------------------------------------------------------------------------------------*/}
@@ -378,7 +380,7 @@ export const ChatV2 = () => {
378380
/>
379381
</Drawer>
380382
<LeftMenu
381-
sx={{ display: { xs: 'none', lg: 'block' }, position: 'sticky', bottom: '0px' }}
383+
sx={{ display: { xs: 'none', lg: 'flex' }, position: 'sticky', top: 0 }}
382384
course={course}
383385
handleReset={handleReset}
384386
user={user}
@@ -403,16 +405,13 @@ export const ChatV2 = () => {
403405
display: 'flex',
404406
position: 'relative',
405407
flexDirection: 'column',
406-
height: '100%',
407408
overflowY: 'visible',
408409
// Padding for navbar
409410
paddingTop: !isEmbeddedMode ? '4rem' : '0',
410411
}}
411412
>
412413
<Box
413414
sx={(theme) => ({
414-
height: '80vh',
415-
416415
[theme.breakpoints.down('sm')]: {
417416
width: '95%',
418417
maxWidth: '95%',
@@ -557,21 +556,19 @@ export const ChatV2 = () => {
557556
{!isMobile && showAnnotations && activeFileSearchResult && (
558557
<Box
559558
sx={{
560-
flex: 0,
561-
position: 'relative',
559+
maxWidth: { xs: 300, md: 400 },
560+
height: '100vh',
561+
display: 'flex',
562+
flexDirection: 'column',
563+
flex: 1,
564+
position: 'sticky',
565+
top: 0,
562566
borderLeft: '1px solid rgba(0,0,0,0.12)',
563567
width: 400,
564568
minWidth: 400,
565569
}}
566570
>
567-
<Box
568-
sx={{
569-
position: 'sticky',
570-
top: 20,
571-
}}
572-
>
573-
<Annotations fileSearchResult={activeFileSearchResult} setShowAnnotations={setShowAnnotations} />
574-
</Box>
571+
<Annotations fileSearchResult={activeFileSearchResult} setShowAnnotations={setShowAnnotations} />
575572
</Box>
576573
)}
577574

@@ -606,32 +603,37 @@ const LeftMenu = ({
606603
messages,
607604
}) => {
608605
return (
609-
<Box sx={sx}>
610-
<Box
611-
sx={{
606+
<Box
607+
sx={[
608+
{
612609
flex: 1,
613610
minWidth: 300,
614611
maxWidth: { xs: 300, md: 400 },
615612
position: 'relative',
616-
height: '100%',
613+
height: '100vh',
617614
borderRight: '1px solid rgba(0, 0, 0, 0.12)',
618-
}}
619-
>
620-
<Box sx={{ position: 'sticky', top: 70, padding: '2rem 1.5rem' }}>
621-
{course && <ChatInfo course={course} />}
622-
<Box sx={{ display: 'flex', flexDirection: 'column', gap: '0.6rem', mb: '2rem' }}>
623-
<OutlineButtonBlack startIcon={<RestartAltIcon />} onClick={handleReset} id="empty-conversation-button">
624-
{t('chat:emptyConversation')}
625-
</OutlineButtonBlack>
626-
627-
<EmailButton messages={messages} disabled={!messages?.length} />
628-
<OutlineButtonBlack startIcon={<Tune />} onClick={() => setSettingsModalOpen(true)} id="settings-button">
629-
{t('chat:settings')}
630-
</OutlineButtonBlack>
631-
<OutlineButtonBlack startIcon={<HelpIcon />} onClick={() => setDisclaimerStatus(true)} id="help-button">
632-
{t('info:title')}
633-
</OutlineButtonBlack>
634-
</Box>
615+
paddingTop: '4rem',
616+
617+
display: 'flex',
618+
flexDirection: 'column',
619+
},
620+
sx,
621+
]}
622+
>
623+
<Box p="1rem">
624+
{course && <ChatInfo course={course} />}
625+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: '0.6rem', mb: '2rem' }}>
626+
<OutlineButtonBlack startIcon={<RestartAltIcon />} onClick={handleReset} id="empty-conversation-button">
627+
{t('chat:emptyConversation')}
628+
</OutlineButtonBlack>
629+
630+
<EmailButton messages={messages} disabled={!messages?.length} />
631+
<OutlineButtonBlack startIcon={<Tune />} onClick={() => setSettingsModalOpen(true)} id="settings-button">
632+
{t('chat:settings')}
633+
</OutlineButtonBlack>
634+
<OutlineButtonBlack startIcon={<HelpIcon />} onClick={() => setDisclaimerStatus(true)} id="help-button">
635+
{t('info:title')}
636+
</OutlineButtonBlack>
635637
{course && showRagSelector && (
636638
<>
637639
<Typography variant="h6" sx={{ mb: 1, display: 'flex', gap: 1, alignItems: 'center' }} fontWeight="bold">
@@ -645,7 +647,8 @@ const LeftMenu = ({
645647
</>
646648
)}
647649
</Box>
648-
</Box>{' '}
650+
</Box>
651+
<Footer />
649652
</Box>
650653
)
651654
}

src/client/components/Footer/index.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,11 @@ const supportEmail = '[email protected]'
1212

1313
const styles = {
1414
supportBox: {
15-
py: '1rem',
16-
px: '3rem',
15+
p: '1rem',
1716
display: 'flex',
1817
justifyContent: 'space-between',
1918
alignItems: 'center',
2019
},
21-
imageBox: {
22-
display: 'flex',
23-
flexDirection: 'column',
24-
alignItems: 'center',
25-
rowGap: '1rem',
26-
},
2720
}
2821

2922
const Footer = () => {
@@ -43,8 +36,6 @@ const Footer = () => {
4336
<Box
4437
component="footer"
4538
sx={(theme) => ({
46-
backgroundColor: theme.palette.toskaDark.main,
47-
color: theme.palette.toskaDark.contrastText,
4839
mt: 'auto',
4940
width: '100%',
5041
})}
@@ -63,7 +54,7 @@ const Footer = () => {
6354
<Typography variant="caption">{t('footer:version', { version: changelog?.[0]?.version, publishedAgo })}</Typography>
6455
</Box>
6556

66-
<Box sx={styles.imageBox}>
57+
<Box>
6758
<Link href="https://toska.dev" target="_blank" rel="noopener" underline="hover">
6859
<img src={toskaColor} alt="Toska" width="70" />
6960
</Link>

src/client/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@
3939
100% 100%;
4040
}
4141
}
42+
43+
/*body {
44+
overscroll-behavior: none;
45+
}*/

src/server/util/azure/mocks/MockStream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MockStream {
2424
while (this.index < this.events.length) {
2525
// Longer delay for simulating responses creation
2626
if (this.index === 0) {
27-
await new Promise((r) => setTimeout(r, 800))
27+
await new Promise((r) => setTimeout(r, 400))
2828
}
2929

3030
const event = this.events[this.index++]

0 commit comments

Comments
 (0)