From 7bbd63d4d9f964211fe07cd5b3656b4c328ff864 Mon Sep 17 00:00:00 2001 From: abose Date: Mon, 12 Jan 2026 12:53:47 +0530 Subject: [PATCH] chore: switch to lp edit mode on project switch and html games always in highlight mode --- .../Phoenix-live-preview/main.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/extensionsIntegrated/Phoenix-live-preview/main.js b/src/extensionsIntegrated/Phoenix-live-preview/main.js index f5a4066dc..a01286d3f 100644 --- a/src/extensionsIntegrated/Phoenix-live-preview/main.js +++ b/src/extensionsIntegrated/Phoenix-live-preview/main.js @@ -884,8 +884,25 @@ define(function (require, exports, module) { } } + function _switchToEditModeIfNeeded() { + // Auto-switch mode based on project and user type + const projectPath = ProjectManager.getProjectRoot().fullPath; + const exploreProjectPath = ProjectManager.getExploreProjectPath(); + const isExploreProject = projectPath === exploreProjectPath; + + if (isExploreProject) { + // Always use highlight mode for explore project + LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_HIGHLIGHT_MODE); + } else if (isProEditUser) { + // Pro users: auto-switch to edit mode on regular projects + LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_EDIT_MODE); + } + // Non-pro users on regular projects: keep current mode (no change) + } + let startupFilesLoadHandled = false; async function _projectOpened() { + _switchToEditModeIfNeeded(); customLivePreviewBannerShown = false; $panel.find(".live-preview-custom-banner").addClass("forced-hidden"); _openReadmeMDIfFirstTime();