Merge pull request #15347 from overleaf/ii-ide-page-prototype-chat-pane

Chat for React IDE page

GitOrigin-RevId: 2a34e754a810fd6ef07e4213ad1d31d5e8e54b4c
This commit is contained in:
ilkin-overleaf 2023-10-27 12:06:25 +03:00 committed by Copybot
parent 9b6f83dfd4
commit 5c7fbdceac
4 changed files with 10 additions and 4 deletions

View file

@ -16,6 +16,7 @@ import { getJSON, postJSON } from '../../../infrastructure/fetch-json'
import { appendMessage, prependMessages } from '../utils/message-list-appender'
import useBrowserWindow from '../../../shared/hooks/use-browser-window'
import { useLayoutContext } from '../../../shared/context/layout-context'
import { useIdeContext } from '@/shared/context/ide-context'
const PAGE_SIZE = 50
@ -226,7 +227,7 @@ export function ChatProvider({ children }) {
}, [])
// Handling receiving messages over the socket
const socket = window._ide?.socket
const { socket } = useIdeContext()
useEffect(() => {
if (!socket) return

View file

@ -3,12 +3,12 @@ import useEventListener from '@/shared/hooks/use-event-listener'
import { useCallback, useEffect, useState } from 'react'
import { Alerts } from '@/features/ide-react/components/alerts/alerts'
import { useLayoutContext } from '@/shared/context/layout-context'
import PlaceholderChat from '@/features/ide-react/components/layout/placeholder/placeholder-chat'
import PlaceholderHistory from '@/features/ide-react/components/layout/placeholder/placeholder-history'
import MainLayout from '@/features/ide-react/components/layout/main-layout'
import { EditorAndSidebar } from '@/features/ide-react/components/editor-and-sidebar'
import EditorLeftMenu from '@/features/editor-left-menu/components/editor-left-menu'
import EditorNavigationToolbar from '@/features/ide-react/components/editor-navigation-toolbar'
import ChatPane from '@/features/chat/components/chat-pane'
import { useLayoutEventTracking } from '@/features/ide-react/hooks/use-layout-event-tracking'
import useSocketListeners from '@/features/ide-react/hooks/use-socket-listeners'
@ -57,7 +57,7 @@ export default function IdePage() {
<EditorLeftMenu />
<MainLayout
headerContent={<EditorNavigationToolbar />}
chatContent={<PlaceholderChat />}
chatContent={<ChatPane />}
mainContent={mainContent}
chatIsOpen={chatIsOpen}
shouldPersistLayout

View file

@ -10,7 +10,7 @@ export default function populateLayoutScope(store: ReactScopeValueStore) {
store.set('toggleHistory', () => {})
store.set('openFile', null)
store.set('ui.chatOpen', false)
store.persisted('ui.chatOpen', false, 'ui.chatOpen')
store.persisted('ui.reviewPanelOpen', false, reviewPanelStorageKey)
store.set('ui.leftMenuShown', false)
store.set('ui.pdfLayout', 'sideBySide')

View file

@ -7,6 +7,11 @@
left: 0;
right: 0;
}
.chat {
position: relative;
height: 100%;
}
}
.ide-react-main {