Skip to content

RaspberryPiFoundation feature enhancements #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

sebjacobs
Copy link

@sebjacobs sebjacobs commented Jul 8, 2025

Proposed Changes

This pull request includes a number of changes from the RaspberryPiFoundation fork of scratch-gui:

  • Remove duplicate remixProject export
  • Allow the MenuBar to be hidden (by providing the menuBarHidden prop).
  • Export manualUpdateProject reducer action.
  • Export setStageSize reducer action.

Reason for Changes

We maintain a number of forks of scratch-gui across the RaspberryPiFoundation which we are looking at rationalising. We believe that these particular changes could be useful for other people and therefore would be keen to get these features merged upstream.

Test Coverage

We were unable to find an existing unit test for the Gui component and so we have not added any test coverage around the new menuBarHidden prop.

Copy link

github-actions bot commented Jul 8, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@sebjacobs
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@sebjacobs
Copy link
Author

recheck

@sebjacobs sebjacobs marked this pull request as ready for review July 8, 2025 15:32
@sebjacobs sebjacobs requested a review from a team as a code owner July 8, 2025 15:32
sebjacobs and others added 4 commits July 24, 2025 14:56
The remixProject reducer is already being exported from the
`src/exported-reducers.ts` file which makes this export redundant.
The MenuBar is quite specific to the canonical version of the online Scratch
editor [1]. In RaspberryPiFoundation projects we want to make use of the
scratch-gui package without displaying the MenuBar.

The MenuBar can be hidden by passing in the `menuBarHidden` prop.

Since the height of the menu bar is hard-coded as a CSS variable, I've
had to override the height calculation for the body wrapper when the
menu bar is not visible. Ideally the height of the menu bar wouldn't be
hard-coded and this wouldn't be necessary.

We were unable to find an existing unit test for the Gui component and so we
have not added any test coverage around the new `menuBarHidden` prop.

[1]: https://scratch.mit.edu/projects/editor

Co-authored-by: James Mead <[email protected]>
This will allow us to trigger the saving of a project from outside the GUI
component.

Co-authored-by: James Mead <[email protected]>
This will allow us to override the default stage size or change the stage size
from outside of the GUI component.
@sebjacobs sebjacobs force-pushed the rpf-upstream-features branch from e60adaa to 440fcaf Compare July 24, 2025 13:57
Copy link
Contributor

@cwillisf cwillisf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about remixProject; if there's a good reason for that change, then this looks great! Otherwise, it looks 99% great ;)

Either way, thank you for sharing your work!

@sebjacobs
Copy link
Author

One question about remixProject; if there's a good reason for that change, then this looks great! Otherwise, it looks 99% great ;)

Either way, thank you for sharing your work!

@cwillisf thanks for taking a look. Sorry for the confusion I explained my reasoning in the individual commits but did not mention them in the PR description. I have also responded to your query inline on the diff.

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