microsoft / pxt

Microsoft MakeCode (PXT - Programming eXperience Toolkit)
https://makecode.com
MIT License
2.1k stars 588 forks source link

Hide Toolbox in Minecraft Python Hour of Code #10234

Closed thsparks closed 1 month ago

thsparks commented 1 month ago

Fixes

Fixes https://github.com/microsoft/pxt-minecraft/issues/2571 This adds a hideToolbox metadata field for tutorials (only supported for monaco at the moment, not sure it makes much sense in a blocks scenario). When present, the toolbox is not shown and the user actually has to type things out.

Fixes https://github.com/microsoft/pxt-minecraft/issues/2595 It also fixes a separate issue (that I initially thought was related to these changes but actually wasn't) with the workspace header, where it was always assuming we were in blocks mode. Now it accepts a property for the workspace id, which allows it to size everything correctly (thus, fixing the border).

flyoutOnly CSS

In our Minecraft css, we've evidently started using flyoutOnly as a de facto indicator for HOC tutorials, so I've had to include it even when hideToolbox is true (and flyoutOnly is false), otherwise all the styling disappears. Ideally, this css class would be refactored/renamed to something more generic, but I worry doing so will be a big, cross-repo change and could have unexpected side-effects, so I've left it for now.

Patch to avoid content changes

After chatting with Abhijith, it sounds like we don't want to require any content updates for the existing 2024 HOC tutorials, so I've added a quick patch setting hideToolbox to true automatically for python tutorials with the legacy layout and flyoutOnly set to true (actual flyoutOnly mode is not supported anyway).

Screenshot

Python: image

Blocks mode unaffected: image

Related change: https://github.com/microsoft/pxt-minecraft/pull/2596

abchatra commented 1 month ago

Nice. Thank you!