Skip to content

Hide the Simulator embed option in the share dialog for headless (Minecraft) targets - #11776

Draft
Abhijith Chatra (abchatra) wants to merge 2 commits into
masterfrom
copilot/remove-simulator-tab
Draft

Abhijith Chatra (abchatra) wants to merge 2 commits into
masterfrom
copilot/remove-simulator-tab

Conversation

@abchatra

@abchatra Abhijith Chatra (abchatra) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

In Minecraft, the share dialog's embed panel offers a Simulator embed, but Minecraft has no visible simulator, so the option does nothing. This change hides the option for headless-simulator targets; all other targets keep it.

// Headless targets (e.g. Minecraft) have no visible simulator, so there's nothing worth embedding.
if (!pxt.appTarget.simulator?.headless) {
    embedOptions.push({
        name: "simulator",
        label: lf("Simulator"),
        title: lf("Simulator"),
        focusable: true,
        onClick: () => setEmbedState("simulator")
    });
}

Changes

  • react-common/components/share/ShareInfo.tsx
    • The Simulator option is now added only when pxt.appTarget.simulator?.headless is falsy. This is the flag the webapp already uses for Minecraft (hasSimulator in sidepanel.tsx, the immersive reader's fullscreen button), so pxt-minecraft needs no changes.
    • Targets without a simulator config still get the option.
  • Scope
    • Only the UI changes. webapp/src/app.tsx still fills in shareData.embed.simulator; it just can't be selected on headless targets.
    • The existing EditorToggle CSS already supports a two-item toggle (50% handle width and offset), so no style changes are needed.
  • Tests: tests/share-test/share.spec.js
    • New Puppeteer test that renders the real ShareInfo component with the react-common LESS and base theme, reusing the project-tools-test bundling and browser helpers.
    • Headless target: the visible tabs and the accessible (keyboard/screen-reader) tab list are both Code, Editor. Switching tabs updates the embed code, and the highlight covers exactly the selected half of the toggle.
    • Regular target: the tabs are Code, Editor, Simulator, and selecting Simulator shows the simulator embed code.
  • gulpfile.js
    • Adds a testshareui task and includes it in gulp test.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@abchatra Abhijith Chatra (abchatra) changed the title [WIP] Remove simulator tab from the share page for Minecraft Hide the Simulator embed option in the share dialog for headless (Minecraft) targets Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants