From 3d9b1bb177b94c56d10dd0809f1420ffc36d9a5d Mon Sep 17 00:00:00 2001 From: David <33458145+davidmcpowell@users.noreply.github.com> Date: Wed, 12 Mar 2025 09:32:37 +0000 Subject: [PATCH] Merge pull request #23914 from overleaf/dp-history Add existing history view into new editor GitOrigin-RevId: 0d35ba1f38dafd8a71087f231f2cddc1b0424401 --- .../ide-redesign/components/main-layout.tsx | 98 +++++++++++-------- .../features/ide-redesign/components/rail.tsx | 14 ++- .../toolbar/show-history-button.tsx | 37 +++++++ .../components/toolbar/toolbar.tsx | 19 +--- 4 files changed, 105 insertions(+), 63 deletions(-) create mode 100644 services/web/frontend/js/features/ide-redesign/components/toolbar/show-history-button.tsx diff --git a/services/web/frontend/js/features/ide-redesign/components/main-layout.tsx b/services/web/frontend/js/features/ide-redesign/components/main-layout.tsx index dec242f163..cf71ed07cb 100644 --- a/services/web/frontend/js/features/ide-redesign/components/main-layout.tsx +++ b/services/web/frontend/js/features/ide-redesign/components/main-layout.tsx @@ -11,6 +11,7 @@ import { useLayoutContext } from '@/shared/context/layout-context' import { useState } from 'react' import EditorPanel from './editor-panel' import { useRailContext } from '../contexts/rail-context' +import HistoryContainer from '@/features/ide-react/components/history-container' export default function MainLayout() { const [resizing, setResizing] = useState(false) @@ -30,6 +31,7 @@ export default function MainLayout() { view === 'editor' || view === 'file' || pdfLayout === 'sideBySide' const { t } = useTranslation() + return (
@@ -42,49 +44,59 @@ export default function MainLayout() { })} > - -
- -
-
- - - - - + + + + +
+ +
+
+ + + + + + +
diff --git a/services/web/frontend/js/features/ide-redesign/components/rail.tsx b/services/web/frontend/js/features/ide-redesign/components/rail.tsx index 6e00e71738..66c6c9d4c7 100644 --- a/services/web/frontend/js/features/ide-redesign/components/rail.tsx +++ b/services/web/frontend/js/features/ide-redesign/components/rail.tsx @@ -29,6 +29,7 @@ import { } from '@/features/ui/components/bootstrap-5/dropdown-menu' import { RailHelpShowHotkeysModal } from './help/keyboard-shortcuts' import { RailHelpContactUsModal } from './help/contact-us' +import { HistorySidebar } from '@/features/ide-react/components/history-sidebar' type RailElement = { icon: AvailableUnfilledIcon @@ -109,7 +110,11 @@ export const RailLayout = () => { togglePane, setResizing, } = useRailContext() - const { setLeftMenuShown } = useLayoutContext() + + const { view, setLeftMenuShown } = useLayoutContext() + + const isHistoryView = view === 'history' + const railActions: RailAction[] = useMemo( () => [ { @@ -154,7 +159,7 @@ export const RailLayout = () => { onSelect={onTabSelect} id="ide-rail-tabs" > -
+