From 8a1053a8670437d6009faa93a8930438eee8f077 Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Thu, 19 Oct 2023 10:31:11 -0700 Subject: [PATCH] tweak toggle simulator settings menu option in headless mode --- webapp/src/app.tsx | 4 ++++ webapp/src/container.tsx | 11 ++++++++--- webapp/src/headerbar.tsx | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/webapp/src/app.tsx b/webapp/src/app.tsx index 8137525ce49d..18798bb6c53b 100644 --- a/webapp/src/app.tsx +++ b/webapp/src/app.tsx @@ -654,6 +654,10 @@ export class ProjectView return; } + if (pxt.appTarget.simulator?.headless && !this.state.collapseEditorTools) { + this.toggleSimulatorCollapse(); + } + const mainBlocks = pkg.mainEditorPkg().files[pxt.MAIN_BLOCKS]; if (this.isJavaScriptActive() || (this.shouldTryDecompile && !this.state.embedSimView)) this.textEditor.openBlocks(); diff --git a/webapp/src/container.tsx b/webapp/src/container.tsx index e383e047738f..30382e3809e8 100644 --- a/webapp/src/container.tsx +++ b/webapp/src/container.tsx @@ -114,6 +114,7 @@ export interface SettingsMenuProps extends ISettingsProps { greenScreen: boolean; accessibleBlocks: boolean; showShare?: boolean; + inBlocks: boolean; } // This Component overrides shouldComponentUpdate, be sure to update that if the state is updated @@ -281,7 +282,8 @@ export class SettingsMenu extends data.Component this.dropdown = ref}> {showHome && } {showShare && } @@ -325,7 +330,7 @@ export class SettingsMenu extends data.Component : undefined} {!isController ? : undefined} {targetTheme.timeMachine ? : undefined} - {showSimCollapse ? : undefined} + {showSimCollapse ? : undefined}
{targetTheme.selectLanguage ? : undefined} {targetTheme.highContrast ? : undefined} diff --git a/webapp/src/headerbar.tsx b/webapp/src/headerbar.tsx index f2ea55ed8a71..249bf7e00ce1 100644 --- a/webapp/src/headerbar.tsx +++ b/webapp/src/headerbar.tsx @@ -224,7 +224,7 @@ export class HeaderBar extends data.Component { return case "tutorial-tab": case "editor": - return + return default: return
}