diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js
index 3333f2ccce..ce0f91282d 100644
--- a/services/web/app/src/Features/Project/ProjectController.js
+++ b/services/web/app/src/Features/Project/ProjectController.js
@@ -948,11 +948,16 @@ const ProjectController = {
!Features.hasFeature('saas') ||
(user.features && user.features.symbolPalette)
- res.render('project/editor', {
+ const template =
+ detachRole === 'detached'
+ ? 'project/editor_detached'
+ : 'project/editor'
+ res.render(template, {
title: project.name,
priority_title: true,
bodyClasses: ['editor'],
project_id: project._id,
+ projectName: project.name,
user: {
id: userId,
email: user.email,
diff --git a/services/web/app/views/project/editor.pug b/services/web/app/views/project/editor.pug
index 5055de3ecb..fb3f16c394 100644
--- a/services/web/app/views/project/editor.pug
+++ b/services/web/app/views/project/editor.pug
@@ -65,11 +65,7 @@ block content
span.sr-only #{translate("close")}
.system-message-content(ng-bind-html="htmlContent")
- if detachRole === 'detached'
- div.full-size
- pdf-preview()
- else
- include ./editor/main
+ include ./editor/main
script(type="text/ng-template", id="genericMessageModalTemplate")
.modal-header
diff --git a/services/web/app/views/project/editor/meta.pug b/services/web/app/views/project/editor/meta.pug
index b6026d4b3e..4c0d8a7fbe 100644
--- a/services/web/app/views/project/editor/meta.pug
+++ b/services/web/app/views/project/editor/meta.pug
@@ -1,5 +1,6 @@
meta(name="ol-useV2History" data-type="boolean" content=useV2History)
meta(name="ol-project_id" content=project_id)
+meta(name="ol-projectName" content=projectName)
meta(name="ol-userSettings" data-type="json" content=userSettings)
meta(name="ol-user" data-type="json" content=user)
meta(name="ol-learnedWords" data-type="json" content=learnedWords)
diff --git a/services/web/app/views/project/editor_detached.pug b/services/web/app/views/project/editor_detached.pug
new file mode 100644
index 0000000000..104eca8e79
--- /dev/null
+++ b/services/web/app/views/project/editor_detached.pug
@@ -0,0 +1,16 @@
+extends ../layout
+
+block entrypointVar
+ - entrypoint = 'ide-detached'
+
+block vars
+ - var suppressNavbar = true
+ - var suppressFooter = true
+ - var suppressSkipToContent = true
+ - metadata.robotsNoindexNofollow = true
+
+block content
+ #pdf-preview-detached-root()
+
+block append meta
+ include ./editor/meta
diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json
index a7ef41cba1..78871e37b9 100644
--- a/services/web/frontend/extracted-translations.json
+++ b/services/web/frontend/extracted-translations.json
@@ -342,6 +342,7 @@
"sync_project_to_github_explanation": "",
"sync_to_dropbox": "",
"sync_to_github": "",
+ "tab_connecting": "",
"tab_no_longer_connected": "",
"tags": "",
"template_approved_by_publisher": "",
diff --git a/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.js b/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.js
index d82a5a5b2f..af4aa1fec0 100644
--- a/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.js
+++ b/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.js
@@ -7,7 +7,6 @@ import IconChecked from '../../../shared/components/icon-checked'
import ControlledDropdown from '../../../shared/components/controlled-dropdown'
import IconEditorOnly from './icon-editor-only'
import IconPdfOnly from './icon-pdf-only'
-import { useCompileContext } from '../../../shared/context/compile-context'
import { useLayoutContext } from '../../../shared/context/layout-context'
import * as eventTracking from '../../../infrastructure/event-tracking'
@@ -59,13 +58,10 @@ function LayoutDropdownButton() {
pdfLayout,
} = useLayoutContext(layoutContextPropTypes)
- const { stopCompile } = useCompileContext()
-
const handleDetach = useCallback(() => {
detach()
- stopCompile()
eventTracking.sendMB('project-layout-detach')
- }, [detach, stopCompile])
+ }, [detach])
const handleReattach = useCallback(() => {
if (detachRole !== 'detacher') {
diff --git a/services/web/frontend/js/features/pdf-preview/components/detach-compile-button.js b/services/web/frontend/js/features/pdf-preview/components/detach-compile-button.js
index 0f0ece8e1d..e0e52913cf 100644
--- a/services/web/frontend/js/features/pdf-preview/components/detach-compile-button.js
+++ b/services/web/frontend/js/features/pdf-preview/components/detach-compile-button.js
@@ -1,26 +1,13 @@
-import { memo, useCallback } from 'react'
+import { memo } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import { useLayoutContext } from '../../../shared/context/layout-context'
-import { useCompileContext } from '../../../shared/context/compile-context'
-import useDetachAction from '../../../shared/hooks/use-detach-action'
+import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
import PdfCompileButtonInner from './pdf-compile-button-inner'
export function DetachCompileButton() {
const { compiling, hasChanges, startCompile } = useCompileContext()
- const startOrTriggerCompile = useDetachAction(
- 'start-compile',
- startCompile,
- 'detacher',
- 'detached'
- )
-
- const handleStartCompile = useCallback(
- () => startOrTriggerCompile(),
- [startOrTriggerCompile]
- )
-
return (
diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-clear-cache-button.js b/services/web/frontend/js/features/pdf-preview/components/pdf-clear-cache-button.js
index d28028e394..368ff74416 100644
--- a/services/web/frontend/js/features/pdf-preview/components/pdf-clear-cache-button.js
+++ b/services/web/frontend/js/features/pdf-preview/components/pdf-clear-cache-button.js
@@ -2,7 +2,7 @@ import Icon from '../../../shared/components/icon'
import { Button } from 'react-bootstrap'
import { useTranslation } from 'react-i18next'
import { memo } from 'react'
-import { useCompileContext } from '../../../shared/context/compile-context'
+import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
function PdfClearCacheButton() {
const { compiling, clearCache, clearingCache } = useCompileContext()
@@ -14,7 +14,7 @@ function PdfClearCacheButton() {
bsSize="small"
bsStyle="danger"
className="logs-pane-actions-clear-cache"
- onClick={clearCache}
+ onClick={() => clearCache()}
disabled={clearingCache || compiling}
>
{clearingCache ? : }
diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.js b/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.js
index 42a53f3982..583e68f07d 100644
--- a/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.js
+++ b/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.js
@@ -4,7 +4,7 @@ import ControlledDropdown from '../../../shared/components/controlled-dropdown'
import { useTranslation } from 'react-i18next'
import { memo } from 'react'
import classnames from 'classnames'
-import { useCompileContext } from '../../../shared/context/compile-context'
+import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
import PdfCompileButtonInner from './pdf-compile-button-inner'
function PdfCompileButton() {
@@ -84,7 +84,7 @@ function PdfCompileButton() {