+ )
+}
+
+export default SymbolPalettePane
diff --git a/services/web/frontend/js/features/ide-react/components/layout/ide-page.tsx b/services/web/frontend/js/features/ide-react/components/layout/ide-page.tsx
index 101992a4d5..9b876cfa16 100644
--- a/services/web/frontend/js/features/ide-react/components/layout/ide-page.tsx
+++ b/services/web/frontend/js/features/ide-react/components/layout/ide-page.tsx
@@ -1,71 +1,28 @@
-import { useConnectionContext } from '@/features/ide-react/context/connection-context'
-import { useEffect, useState } from 'react'
import { Alerts } from '@/features/ide-react/components/alerts/alerts'
-import { useLayoutContext } from '@/shared/context/layout-context'
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'
-import { useModalsContext } from '@/features/ide-react/context/modals-context'
import { useOpenFile } from '@/features/ide-react/hooks/use-open-file'
import { useEditingSessionHeartbeat } from '@/features/ide-react/hooks/use-editing-session-heartbeat'
import { useRegisterUserActivity } from '@/features/ide-react/hooks/use-register-user-activity'
import { useHasLintingError } from '@/features/ide-react/hooks/use-has-linting-error'
+import { useConnectionState } from '@/features/ide-react/hooks/use-connection-state'
-// This is filled with placeholder content while the real content is migrated
-// away from Angular
export default function IdePage() {
- useLayoutEventTracking()
- useSocketListeners()
- useEditingSessionHeartbeat()
- useRegisterUserActivity()
- useHasLintingError()
-
- // This returns a function to open a binary file but for now we just use the
- // fact that it also patches in ide.binaryFilesManager. Once Angular is gone,
- // we can remove this hook from here and use it in the history file restore
- // component instead.
- useOpenFile()
-
- const [leftColumnDefaultSize, setLeftColumnDefaultSize] = useState(20)
- const { connectionState } = useConnectionContext()
- const { showLockEditorMessageModal } = useModalsContext()
-
- // Show modal when editor is forcefully disconnected
- useEffect(() => {
- if (connectionState.forceDisconnected) {
- showLockEditorMessageModal(connectionState.forcedDisconnectDelay)
- }
- }, [
- connectionState.forceDisconnected,
- connectionState.forcedDisconnectDelay,
- showLockEditorMessageModal,
- ])
-
- const { chatIsOpen } = useLayoutContext()
-
- const mainContent = (
-
- )
+ useLayoutEventTracking() // send event when the layout changes
+ useSocketListeners() // listen for project-related websocket messages
+ useEditingSessionHeartbeat() // send a batched event when user is active
+ useRegisterUserActivity() // record activity and ensure connection when user is active
+ useHasLintingError() // pass editor:lint hasLintingError to the compiler
+ useOpenFile() // create ide.binaryFilesManager (TODO: move to the history file restore component)
+ useConnectionState() // show modal when editor is forcefully disconnected
return (
<>
- }
- chatContent={}
- mainContent={mainContent}
- chatIsOpen={chatIsOpen}
- shouldPersistLayout
- />
+
>
)
}
diff --git a/services/web/frontend/js/features/ide-react/components/layout/layout-with-placeholders.tsx b/services/web/frontend/js/features/ide-react/components/layout/layout-with-placeholders.tsx
deleted file mode 100644
index f3f2d175f8..0000000000
--- a/services/web/frontend/js/features/ide-react/components/layout/layout-with-placeholders.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { useState } from 'react'
-import PlaceholderHeader from '@/features/ide-react/components/layout/placeholder/placeholder-header'
-import PlaceholderChat from '@/features/ide-react/components/layout/placeholder/placeholder-chat'
-import PlaceholderHistory from '@/features/ide-react/components/layout/placeholder/placeholder-history'
-import PlaceholderEditorMainContent from '@/features/ide-react/components/layout/placeholder/placeholder-editor-main-content'
-import MainLayout from '@/features/ide-react/components/layout/main-layout'
-
-export default function LayoutWithPlaceholders({
- shouldPersistLayout,
-}: {
- shouldPersistLayout: boolean
-}) {
- const [chatIsOpen, setChatIsOpen] = useState(false)
- const [historyIsOpen, setHistoryIsOpen] = useState(false)
- const [leftColumnDefaultSize, setLeftColumnDefaultSize] = useState(20)
-
- const headerContent = (
-
- )
- const chatContent =
- const mainContent = historyIsOpen ? (
-
- ) : (
-
- )
-
- return (
-
- )
-}
diff --git a/services/web/frontend/js/features/ide-react/components/layout/main-layout.tsx b/services/web/frontend/js/features/ide-react/components/layout/main-layout.tsx
index 92d05e6811..4aa409d64b 100644
--- a/services/web/frontend/js/features/ide-react/components/layout/main-layout.tsx
+++ b/services/web/frontend/js/features/ide-react/components/layout/main-layout.tsx
@@ -1,31 +1,23 @@
import { Panel, PanelGroup } from 'react-resizable-panels'
-import { ReactNode, useState } from 'react'
+import { useState } from 'react'
import { HorizontalResizeHandle } from '../resize/horizontal-resize-handle'
import useFixedSizeColumn from '@/features/ide-react/hooks/use-fixed-size-column'
import useCollapsiblePanel from '@/features/ide-react/hooks/use-collapsible-panel'
import classNames from 'classnames'
+import { useLayoutContext } from '@/shared/context/layout-context'
+import EditorNavigationToolbar from '@/features/ide-react/components/editor-navigation-toolbar'
+import ChatPane from '@/features/chat/components/chat-pane'
+import { EditorAndSidebar } from '@/features/ide-react/components/editor-and-sidebar'
const CHAT_DEFAULT_SIZE = 20
-type PageProps = {
- headerContent: ReactNode
- chatContent: ReactNode
- mainContent: ReactNode
- chatIsOpen: boolean
- shouldPersistLayout: boolean
-}
-
// The main area below the header is split into two: the main content and chat.
// The reason for not splitting the left column containing the file tree and
// outline here is that the history view has its own file tree, so it is more
// convenient to replace the whole of the main content when in history view.
-export default function MainLayout({
- headerContent,
- chatContent,
- mainContent,
- chatIsOpen,
- shouldPersistLayout,
-}: PageProps) {
+export default function MainLayout() {
+ const { chatIsOpen } = useLayoutContext()
+
const { fixedPanelRef: chatPanelRef, handleLayout } = useFixedSizeColumn(
CHAT_DEFAULT_SIZE,
chatIsOpen
@@ -37,10 +29,10 @@ export default function MainLayout({
return (