Repository navigation
Hide the Simulator embed option in the share dialog for headless (Minecraft) targets - #11776
Draft
Abhijith Chatra (abchatra) wants to merge 2 commits into
Draft
Abhijith Chatra (abchatra) wants to merge 2 commits into
Abhijith Chatra (abchatra) wants to merge 2 commits into
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Changes
react-common/components/share/ShareInfo.tsxpxt.appTarget.simulator?.headlessis falsy. This is the flag the webapp already uses for Minecraft (hasSimulatorinsidepanel.tsx, the immersive reader's fullscreen button), so pxt-minecraft needs no changes.simulatorconfig still get the option.webapp/src/app.tsxstill fills inshareData.embed.simulator; it just can't be selected on headless targets.EditorToggleCSS already supports a two-item toggle (50% handle width and offset), so no style changes are needed.tests/share-test/share.spec.jsShareInfocomponent with the react-common LESS and base theme, reusing theproject-tools-testbundling and browser helpers.Code,Editor. Switching tabs updates the embed code, and the highlight covers exactly the selected half of the toggle.Code,Editor,Simulator, and selecting Simulator shows the simulator embed code.gulpfile.jstestshareuitask and includes it ingulp test.