diff --git a/docs/API-Reference/command/Commands.md b/docs/API-Reference/command/Commands.md
index 631fa03621..37a71de251 100644
--- a/docs/API-Reference/command/Commands.md
+++ b/docs/API-Reference/command/Commands.md
@@ -458,6 +458,12 @@ Toggles sidebar visibility
## VIEW\_TOGGLE\_DESIGN\_MODE
Toggles the design (full live-preview) mode — collapses/expands the editor
+**Kind**: global variable
+
+
+## VIEW\_TOGGLE\_LP\_FULL\_SCREEN
+Toggles live-preview full screen (design mode with the sidebar hidden)
+
**Kind**: global variable
diff --git a/docs/API-Reference/view/WorkspaceManager.md b/docs/API-Reference/view/WorkspaceManager.md
index eff290c760..1f26abee19 100644
--- a/docs/API-Reference/view/WorkspaceManager.md
+++ b/docs/API-Reference/view/WorkspaceManager.md
@@ -29,6 +29,7 @@ Events:
* [.EVENT_WORKSPACE_PANEL_SHOWN](#module_view/WorkspaceManager..EVENT_WORKSPACE_PANEL_SHOWN)
* [.EVENT_WORKSPACE_PANEL_HIDDEN](#module_view/WorkspaceManager..EVENT_WORKSPACE_PANEL_HIDDEN)
* [.EVENT_WORKSPACE_DESIGN_MODE_CHANGE](#module_view/WorkspaceManager..EVENT_WORKSPACE_DESIGN_MODE_CHANGE)
+ * [.EVENT_WORKSPACE_LP_FULL_SCREEN_CHANGE](#module_view/WorkspaceManager..EVENT_WORKSPACE_LP_FULL_SCREEN_CHANGE)
* [.createBottomPanel(id, $panel, [minSize], [title], [options])](#module_view/WorkspaceManager..createBottomPanel) ⇒ Panel
* [.destroyBottomPanel(id)](#module_view/WorkspaceManager..destroyBottomPanel)
* [.createPluginPanel(id, $panel, [minSize], $toolbarIcon, [initialSize])](#module_view/WorkspaceManager..createPluginPanel) ⇒ Panel
@@ -39,6 +40,8 @@ Events:
* [.setPluginPanelWidth(width)](#module_view/WorkspaceManager..setPluginPanelWidth)
* [.isInDesignMode()](#module_view/WorkspaceManager..isInDesignMode) ⇒ boolean
* [.setDesignMode(active)](#module_view/WorkspaceManager..setDesignMode)
+ * [.isInLPFullScreen()](#module_view/WorkspaceManager..isInLPFullScreen) ⇒ boolean
+ * [.setLPFullScreen(active)](#module_view/WorkspaceManager..setLPFullScreen)
* [.addEscapeKeyEventHandler(consumerName, eventHandler)](#module_view/WorkspaceManager..addEscapeKeyEventHandler) ⇒ boolean
* [.removeEscapeKeyEventHandler(consumerName)](#module_view/WorkspaceManager..removeEscapeKeyEventHandler) ⇒ boolean
@@ -96,6 +99,13 @@ Event triggered when a panel is hidden.
Event triggered when design mode (editor collapsed, full live preview) is
entered or exited. Payload: `(active: boolean)`.
+**Kind**: inner constant of [view/WorkspaceManager](#module_view/WorkspaceManager)
+
+
+### view/WorkspaceManager.EVENT\_WORKSPACE\_LP\_FULL\_SCREEN\_CHANGE
+Event triggered when live-preview full screen (design mode with the sidebar
+hidden) is entered or exited. Payload: `(active: boolean)`.
+
**Kind**: inner constant of [view/WorkspaceManager](#module_view/WorkspaceManager)
@@ -220,6 +230,32 @@ callers should use the dedicated toggle command instead.
| --- | --- |
| active | boolean |
+
+
+### view/WorkspaceManager.isInLPFullScreen() ⇒ boolean
+Returns true while live preview is expanded to full screen, meaning design mode
+with the sidebar hidden so live preview owns everything to the right of the
+central control bar.
+
+Full screen is a superset of design mode, so `isInDesignMode()` is true here
+too. Use `isInDesignMode()` if you only care that the editor is collapsed;
+use this only when the sidebar state matters.
+
+**Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager)
+
+
+### view/WorkspaceManager.setLPFullScreen(active)
+Sets the live-preview full-screen flag and fires
+EVENT_WORKSPACE_LP_FULL_SCREEN_CHANGE when the value actually changes.
+Intended to be called by the control bar; other callers should use the
+dedicated toggle command instead.
+
+**Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager)
+
+| Param | Type |
+| --- | --- |
+| active | boolean |
+
### view/WorkspaceManager.addEscapeKeyEventHandler(consumerName, eventHandler) ⇒ boolean
diff --git a/src/command/Commands.js b/src/command/Commands.js
index b2586a1656..11a39c1ed4 100644
--- a/src/command/Commands.js
+++ b/src/command/Commands.js
@@ -260,6 +260,9 @@ define(function (require, exports, module) {
/** Toggles the design (full live-preview) mode — collapses/expands the editor */
exports.VIEW_TOGGLE_DESIGN_MODE = "view.toggleDesignMode"; // view/CentralControlBar.js _setEditorCollapsed()
+ /** Toggles live-preview full screen (design mode with the sidebar hidden) */
+ exports.VIEW_TOGGLE_LP_FULL_SCREEN = "view.toggleLivePreviewFullScreen"; // view/CentralControlBar.js _setLPFullScreen()
+
/** Toggles tabbar visibility */
exports.TOGGLE_TABBAR = "view.toggleTabbar";
// extensionsIntegrated/TabBar/main.js
diff --git a/src/extensionsIntegrated/Phoenix-live-preview/live-preview.css b/src/extensionsIntegrated/Phoenix-live-preview/live-preview.css
index 40fcf5e973..cfc18c4e57 100644
--- a/src/extensionsIntegrated/Phoenix-live-preview/live-preview.css
+++ b/src/extensionsIntegrated/Phoenix-live-preview/live-preview.css
@@ -370,13 +370,13 @@
}
#reloadLivePreviewButton,
-#designModeToggleLivePreviewButton {
+#fullScreenLivePreviewButton {
border: 1px solid transparent;
border-radius: 3px;
}
#live-preview-plugin-toolbar #reloadLivePreviewButton:hover,
-#live-preview-plugin-toolbar #designModeToggleLivePreviewButton:hover {
+#live-preview-plugin-toolbar #fullScreenLivePreviewButton:hover {
border-color: rgba(255, 255, 255, 0.1) !important;
background: transparent !important;
box-shadow: none !important;
diff --git a/src/extensionsIntegrated/Phoenix-live-preview/main.js b/src/extensionsIntegrated/Phoenix-live-preview/main.js
index 3e99097216..1f8dc1e25b 100644
--- a/src/extensionsIntegrated/Phoenix-live-preview/main.js
+++ b/src/extensionsIntegrated/Phoenix-live-preview/main.js
@@ -190,7 +190,7 @@ define(function (require, exports, module) {
$modeBtn,
$modeBtnGroup,
$previewBtn,
- $designModeBtn;
+ $fullScreenBtn;
let customLivePreviewBannerShown = false;
@@ -800,7 +800,7 @@ define(function (require, exports, module) {
livePreview: Strings.LIVE_DEV_STATUS_TIP_OUT_OF_SYNC,
clickToReload: Strings.LIVE_DEV_CLICK_TO_RELOAD_PAGE,
clickToToggleEdit: Strings.LIVE_PREVIEW_MODE_TOGGLE_EDIT,
- switchToDesignMode: Strings.CCB_SWITCH_TO_DESIGN_MODE,
+ fullScreenLivePreview: Strings.LIVE_PREVIEW_FULL_SCREEN,
livePreviewSettings: Strings.LIVE_DEV_SETTINGS,
livePreviewConfigureModes: Strings.LIVE_PREVIEW_CONFIGURE_MODES,
clickToPopout: Strings.LIVE_DEV_CLICK_POPOUT,
@@ -833,7 +833,7 @@ define(function (require, exports, module) {
$modeBtn = $panel.find("#livePreviewModeBtn");
$modeBtnGroup = $panel.find("#lpModeBtnGroup");
$previewBtn = $panel.find("#previewModeLivePreviewButton");
- $designModeBtn = $panel.find("#designModeToggleLivePreviewButton");
+ $fullScreenBtn = $panel.find("#fullScreenLivePreviewButton");
// Markdown theme toggle — persist user choice
MarkdownSync.setThemeToggleHandler((theme) => {
@@ -918,28 +918,25 @@ define(function (require, exports, module) {
Metrics.countEvent(Metrics.EVENT_TYPE.LIVE_PREVIEW, "reloadBtn", "click");
});
- // Design-mode toggle: mirrors the CCB's pen-nib button so the user can
- // enter/exit design mode without moving focus to the sidebar strip.
- // Icon swaps between fa-expand (enter) and fa-compress (exit).
- function _updateDesignModeButton() {
- const on = WorkspaceManager.isInDesignMode && WorkspaceManager.isInDesignMode();
- const $icon = $designModeBtn.find("i");
- $icon.removeClass("fa-expand fa-compress")
+ function _updateFullScreenButton() {
+ const on = WorkspaceManager.isInLPFullScreen && WorkspaceManager.isInLPFullScreen();
+ $fullScreenBtn.find("i")
+ .removeClass("fa-expand fa-compress")
.addClass(on ? "fa-compress" : "fa-expand");
- $designModeBtn.attr("title",
- on ? Strings.CCB_SWITCH_TO_CODE_EDITOR : Strings.CCB_SWITCH_TO_DESIGN_MODE);
- if ($modeBtn) {
- $modeBtn.toggle(!on && !_isMdviewrActive);
- }
+ $fullScreenBtn.attr("title",
+ on ? Strings.LIVE_PREVIEW_EXIT_FULL_SCREEN : Strings.LIVE_PREVIEW_FULL_SCREEN);
}
- $designModeBtn.click(()=>{
- CommandManager.execute(Commands.VIEW_TOGGLE_DESIGN_MODE);
- Metrics.countEvent(Metrics.EVENT_TYPE.LIVE_PREVIEW, "designModeBtn", "click");
+ $fullScreenBtn.click(()=>{
+ CommandManager.execute(Commands.VIEW_TOGGLE_LP_FULL_SCREEN);
+ Metrics.countEvent(Metrics.EVENT_TYPE.LIVE_PREVIEW, "fullScreenBtn", "click");
});
WorkspaceManager.off(WorkspaceManager.EVENT_WORKSPACE_DESIGN_MODE_CHANGE + ".livePreview");
WorkspaceManager.on(WorkspaceManager.EVENT_WORKSPACE_DESIGN_MODE_CHANGE + ".livePreview",
- _updateDesignModeButton);
- _updateDesignModeButton();
+ _updateLPControlsForMdviewer);
+ WorkspaceManager.off(WorkspaceManager.EVENT_WORKSPACE_LP_FULL_SCREEN_CHANGE + ".livePreview");
+ WorkspaceManager.on(WorkspaceManager.EVENT_WORKSPACE_LP_FULL_SCREEN_CHANGE + ".livePreview",
+ _updateFullScreenButton);
+ _updateFullScreenButton();
// init the status overlay
_initOverlay();
diff --git a/src/extensionsIntegrated/Phoenix-live-preview/panel.html b/src/extensionsIntegrated/Phoenix-live-preview/panel.html
index 0a32900fd1..1a24d179a8 100644
--- a/src/extensionsIntegrated/Phoenix-live-preview/panel.html
+++ b/src/extensionsIntegrated/Phoenix-live-preview/panel.html
@@ -4,7 +4,7 @@
-