Skip to content

Commit c9b089b

Browse files
committed
chore: switch to lp edit mode on project switch and html games always in highlight mode
1 parent 2ddf544 commit c9b089b

File tree

1 file changed

+17
-0
lines changed
  • src/extensionsIntegrated/Phoenix-live-preview

1 file changed

+17
-0
lines changed

src/extensionsIntegrated/Phoenix-live-preview/main.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,8 +884,25 @@ define(function (require, exports, module) {
884884
}
885885
}
886886

887+
function _switchToEditModeIfNeeded() {
888+
// Auto-switch mode based on project and user type
889+
const projectPath = ProjectManager.getProjectRoot().fullPath;
890+
const exploreProjectPath = ProjectManager.getExploreProjectPath();
891+
const isExploreProject = projectPath === exploreProjectPath;
892+
893+
if (isExploreProject) {
894+
// Always use highlight mode for explore project
895+
LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_HIGHLIGHT_MODE);
896+
} else if (isProEditUser) {
897+
// Pro users: auto-switch to edit mode on regular projects
898+
LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_EDIT_MODE);
899+
}
900+
// Non-pro users on regular projects: keep current mode (no change)
901+
}
902+
887903
let startupFilesLoadHandled = false;
888904
async function _projectOpened() {
905+
_switchToEditModeIfNeeded();
889906
customLivePreviewBannerShown = false;
890907
$panel.find(".live-preview-custom-banner").addClass("forced-hidden");
891908
_openReadmeMDIfFirstTime();

0 commit comments

Comments
 (0)