From f5ce84a310e876a8cdc5bfbe08ae0cfc7d6da08f Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Mon, 31 Mar 2025 18:53:25 -0700 Subject: [PATCH] Size fix for mobile --- src/ketr-chat/src/App.css | 1 + src/ketr-chat/src/App.tsx | 163 +++++++++++++++++++----------------- src/ketr-chat/src/index.css | 3 +- 3 files changed, 87 insertions(+), 80 deletions(-) diff --git a/src/ketr-chat/src/App.css b/src/ketr-chat/src/App.css index ae8fed1..a0c3057 100644 --- a/src/ketr-chat/src/App.css +++ b/src/ketr-chat/src/App.css @@ -48,6 +48,7 @@ div { overflow-y: auto; padding: 10px; flex-direction: column; + height: 100%; } .user-message { diff --git a/src/ketr-chat/src/App.tsx b/src/ketr-chat/src/App.tsx index d6b4fdb..5e908f5 100644 --- a/src/ketr-chat/src/App.tsx +++ b/src/ketr-chat/src/App.tsx @@ -1,6 +1,7 @@ import React, { useState, useEffect, useRef, useCallback } from 'react'; import FormGroup from '@mui/material/FormGroup'; import FormControlLabel from '@mui/material/FormControlLabel'; +import { useTheme } from '@mui/material'; import Switch from '@mui/material/Switch'; import Divider from '@mui/material/Divider'; import Tooltip from '@mui/material/Tooltip'; @@ -646,10 +647,10 @@ const App = () => { }; return ( - + theme.zIndex.drawer + 1, }} @@ -683,85 +684,89 @@ const App = () => { - - {/* The implementation can be swapped with js to avoid SEO duplication of links. */} - + - - {drawer} - - + {/* The implementation can be swapped with js to avoid SEO duplication of links. */} + + + {drawer} + + + - - + + {conversation.map((message, index) => { + const formattedContent = message.content.trim(); - - {conversation.map((message, index) => { - const formattedContent = message.content.trim(); - - return ( -
- {message.metadata ? ( - <> -
{message.metadata.title}
- {message.user && ( -
{message.user}
- )} - {message.role === 'assistant' ? ( -
- -
- ) : ( -
{formattedContent}
- )} - - ) : ( - <> - {message.user && ( + return ( +
+ {message.metadata ? ( + <> +
{message.metadata.title}
+ {message.user && (
{message.user}
- )} - {message.role === 'assistant' ? ( -
- -
- ) : ( -
{formattedContent}
- )} - - )} -
- ); - })} -
- -
+ )} + {message.role === 'assistant' ? ( +
+ +
+ ) : ( +
{formattedContent}
+ )} + + ) : ( + <> + {message.user && ( +
{message.user}
+ )} + {message.role === 'assistant' ? ( +
+ +
+ ) : ( +
{formattedContent}
+ )} + + )} +
+ ); + })} +
+ +
+
@@ -769,7 +774,7 @@ const App = () => { variant="outlined" disabled={processing} autoFocus - fullWidth + fullWidth type="text" value={query} onChange={(e) => setQuery(e.target.value)} @@ -784,6 +789,8 @@ const App = () => {
+ +