From 5f1c5259fd618b3d36bb6c0d957d7c8a429c395e Mon Sep 17 00:00:00 2001 From: David <33458145+davidmcpowell@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:40:45 +0000 Subject: [PATCH] Merge pull request #22720 from overleaf/dp-editor-redesign Editor redesign skeleton page GitOrigin-RevId: 966c88ac3714e4cc7de3e21951e4e1641bfd6852 --- .../src/Features/Project/ProjectController.js | 1 + .../ide-react/components/layout/ide-page.tsx | 20 ++++++- .../ide-redesign/components/main-layout.tsx | 53 +++++++++++++++++++ .../stylesheets/bootstrap-5/pages/all.scss | 1 + .../pages/editor/ide-redesign.scss | 22 ++++++++ 5 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 services/web/frontend/js/features/ide-redesign/components/main-layout.tsx create mode 100644 services/web/frontend/stylesheets/bootstrap-5/pages/editor/ide-redesign.scss diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index 18c1619302..7f5648f507 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -354,6 +354,7 @@ const _ProjectController = { 'ai-add-on', 'reviewer-role', 'papers-integration', + 'editor-redesign', ].filter(Boolean) const getUserValues = async userId => 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 160cd1e55c..c73c5fe1ef 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,3 +1,4 @@ +import { lazy, Suspense } from 'react' import { Alerts } from '@/features/ide-react/components/alerts/alerts' import { MainLayout } from '@/features/ide-react/components/layout/main-layout' import EditorLeftMenu from '@/features/editor-left-menu/components/editor-left-menu' @@ -10,6 +11,11 @@ import { useHasLintingError } from '@/features/ide-react/hooks/use-has-linting-e import { Modals } from '@/features/ide-react/components/modals/modals' import { GlobalAlertsProvider } from '@/features/ide-react/context/global-alerts-context' import { GlobalToasts } from '../global-toasts' +import { useFeatureFlag } from '@/shared/context/split-test-context' + +const MainLayoutNew = lazy( + () => import('@/features/ide-redesign/components/main-layout') +) export default function IdePage() { useLayoutEventTracking() // sent event when the layout changes @@ -19,12 +25,22 @@ export default function IdePage() { useHasLintingError() // pass editor:lint hasLintingError to the compiler useOpenFile() // create ide.binaryFilesManager (TODO: move to the history file restore component) + const newEditor = useFeatureFlag('editor-redesign') + return ( - - + {newEditor ? ( + + + + ) : ( + <> + + + + )} ) 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 new file mode 100644 index 0000000000..8d89e44977 --- /dev/null +++ b/services/web/frontend/js/features/ide-redesign/components/main-layout.tsx @@ -0,0 +1,53 @@ +import { Panel, PanelGroup } from 'react-resizable-panels' +import classNames from 'classnames' +import { HorizontalResizeHandle } from '@/features/ide-react/components/resize/horizontal-resize-handle' + +export default function MainLayout() { + return ( +
+
Toolbar
+
+
+ Left menu +
+ + +
+ Side bar +
+
+ + +
+ Editor +
+
+ + +
+ PDF +
+
+
+
+
+ ) +} diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/all.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/all.scss index a4983796e9..4b4c8eff76 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/pages/all.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/pages/all.scss @@ -6,6 +6,7 @@ @import 'project-list-ds-nav'; @import 'sidebar-v2-dash-pane'; @import 'editor/ide'; +@import 'editor/ide-redesign'; @import 'editor/toolbar'; @import 'editor/online-users'; @import 'editor/hotkeys'; diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/editor/ide-redesign.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/editor/ide-redesign.scss new file mode 100644 index 0000000000..f312cc3a8a --- /dev/null +++ b/services/web/frontend/stylesheets/bootstrap-5/pages/editor/ide-redesign.scss @@ -0,0 +1,22 @@ +.ide-redesign-body { + display: flex; + flex-grow: 1; + background-color: var(--bg-light-secondary); + overflow-y: hidden; + z-index: 0; +} + +.ide-redesign-main { + height: 100%; + display: flex; + flex-direction: column; +} + +.ide-skeleton-block { + border: 1px solid grey; + background-color: white; +} + +.ide-redesign-full-height { + height: 100%; +}