diff --git a/services/web/frontend/js/features/ide-react/components/history-container.tsx b/services/web/frontend/js/features/ide-react/components/history-container.tsx
new file mode 100644
index 0000000000..32c4b2c70b
--- /dev/null
+++ b/services/web/frontend/js/features/ide-react/components/history-container.tsx
@@ -0,0 +1,25 @@
+import { useLayoutContext } from '../../../shared/context/layout-context'
+import { FullSizeLoadingSpinner } from '../../../shared/components/loading-spinner'
+import { ErrorBoundaryFallback } from '../../../shared/components/error-boundary-fallback'
+import withErrorBoundary from '../../../infrastructure/error-boundary'
+import { lazy, Suspense } from 'react'
+
+const HistoryRoot = lazy(
+ () => import('@/features/ide-react/components/history-root')
+)
+
+function HistoryContainer() {
+ const { view } = useLayoutContext()
+
+ if (view !== 'history') {
+ return null
+ }
+
+ return (
+ }>
+
+
+ )
+}
+
+export default withErrorBoundary(HistoryContainer, ErrorBoundaryFallback)
diff --git a/services/web/frontend/js/features/ide-react/components/history-root.tsx b/services/web/frontend/js/features/ide-react/components/history-root.tsx
new file mode 100644
index 0000000000..6dad985eda
--- /dev/null
+++ b/services/web/frontend/js/features/ide-react/components/history-root.tsx
@@ -0,0 +1,11 @@
+import { memo } from 'react'
+import { HistoryProvider } from '@/features/history/context/history-context'
+import History from './history'
+
+const HistoryRoot = () => (
+
+
+
+)
+
+export default memo(HistoryRoot)
diff --git a/services/web/frontend/js/features/ide-react/components/history-sidebar.tsx b/services/web/frontend/js/features/ide-react/components/history-sidebar.tsx
index d929d3f9d1..e010951a46 100644
--- a/services/web/frontend/js/features/ide-react/components/history-sidebar.tsx
+++ b/services/web/frontend/js/features/ide-react/components/history-sidebar.tsx
@@ -1,5 +1,10 @@
import React from 'react'
export function HistorySidebar() {
- return
+ return (
+
+ )
}
diff --git a/services/web/frontend/js/features/ide-react/components/history.tsx b/services/web/frontend/js/features/ide-react/components/history.tsx
index 173b039b5f..160f5ca27a 100644
--- a/services/web/frontend/js/features/ide-react/components/history.tsx
+++ b/services/web/frontend/js/features/ide-react/components/history.tsx
@@ -7,7 +7,7 @@ import { useHistoryContext } from '@/features/history/context/history-context'
export default function History() {
const { updatesInfo } = useHistoryContext()
- const fileTreeContainer = document.querySelector('.history-file-tree')
+ const fileTreeContainer = document.getElementById('history-file-tree')
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 7da8e4060d..204c087502 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
@@ -7,13 +7,12 @@ import EditorNavigationToolbar from '@/features/ide-react/components/editor-navi
import ChatPane from '@/features/chat/components/chat-pane'
import { HorizontalToggler } from '@/features/ide-react/components/resize/horizontal-toggler'
import { HistorySidebar } from '@/features/ide-react/components/history-sidebar'
-import { HistoryProvider } from '@/features/history/context/history-context'
-import History from '@/features/ide-react/components/history'
import EditorSidebar from '@/features/ide-react/components/editor-sidebar'
import { useTranslation } from 'react-i18next'
import { useSidebarPane } from '@/features/ide-react/hooks/use-sidebar-pane'
import { useChatPane } from '@/features/ide-react/hooks/use-chat-pane'
import { EditorAndPdf } from '@/features/ide-react/components/editor-and-pdf'
+import HistoryContainer from '@/features/ide-react/components/history-container'
export const MainLayout: FC = () => {
const { view } = useLayoutContext()
@@ -86,11 +85,7 @@ export const MainLayout: FC = () => {
- {view === 'history' && (
-
-
-
- )}
+