diff --git a/examples/server/webui/src/App.tsx b/examples/server/webui/src/App.tsx index 5b440bc6d..2ce734682 100644 --- a/examples/server/webui/src/App.tsx +++ b/examples/server/webui/src/App.tsx @@ -27,14 +27,19 @@ function AppLayout() { return ( <> -
+
- { setShowSettings(false)} - />} + { + setShowSettings(false)} + /> + } ); } diff --git a/examples/server/webui/src/components/ChatScreen.tsx b/examples/server/webui/src/components/ChatScreen.tsx index 18f575e19..3c53a82cf 100644 --- a/examples/server/webui/src/components/ChatScreen.tsx +++ b/examples/server/webui/src/components/ChatScreen.tsx @@ -17,22 +17,21 @@ export default function ChatScreen() { canvasData, } = useAppContext(); const [inputMsg, setInputMsg] = useState(''); - const containerRef = useRef(null); const navigate = useNavigate(); const currConvId = viewingConversation?.id ?? ''; const pendingMsg: PendingMessage | undefined = pendingMessages[currConvId]; const scrollToBottom = (requiresNearBottom: boolean) => { - if (!containerRef.current) return; - const msgListElem = containerRef.current; + const mainScrollElem = document.getElementById('main-scroll'); + if (!mainScrollElem) return; const spaceToBottom = - msgListElem.scrollHeight - - msgListElem.scrollTop - - msgListElem.clientHeight; + mainScrollElem.scrollHeight - + mainScrollElem.scrollTop - + mainScrollElem.clientHeight; if (!requiresNearBottom || spaceToBottom < 50) { setTimeout( - () => msgListElem.scrollTo({ top: msgListElem.scrollHeight }), + () => mainScrollElem.scrollTo({ top: mainScrollElem.scrollHeight }), 1 ); } @@ -71,11 +70,7 @@ export default function ChatScreen() { >
{/* chat messages */} -
+
{/* placeholder to shift the message to the bottom */} {viewingConversation ? '' : 'Send a message to start'} diff --git a/examples/server/webui/src/components/SettingDialog.tsx b/examples/server/webui/src/components/SettingDialog.tsx index 679c3a084..592b93fa3 100644 --- a/examples/server/webui/src/components/SettingDialog.tsx +++ b/examples/server/webui/src/components/SettingDialog.tsx @@ -325,7 +325,7 @@ export default function SettingDialog({ }; return ( - +

Settings