-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Monitor save & load #1686
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
Monitor save & load #1686
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we should add an integration test for loading sb3 files saved with monitors, to parallel the one testing loading sb2 files with monitors
src/serialization/sb2.js
Outdated
} | ||
// In the case where a monitor block does not already exist, one will get created | ||
// when the target is installed because the toolbox will reload. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
As discussed offline, it looks like this approach of using the monitor block from the runtime monitorBlocks container is not going to work after all since we won't always have monitorBlock information when we need it. In player mode (thus also on the preview page), the toolbox doesn't get loaded when the project does, so the monitorBlocks container does not get populated and monitors appear empty when a project is loaded. Possible Solutions for The Future™️
|
Closing this until I can come back to it in the future. |
7a9f583
to
08f07fd
Compare
…from runtime. Fix issue where stage monitors weren't getting loaded correctly.
…y be 0 (e.g. a monitor placed in the top right corner of the stage) does not result in the monitor being treated as a new monitor and get auto-positioned.
…created when the toolbox is loaded. This approach does not work when viewing the project detached from scratch-blocks (e.g. player mode).
…relevant info if they don't exist.
…ary when the monitor is the only part of the project that uses the extension. Update extension monitor color category.
08f07fd
to
6dfc0b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the nit and question, looks good.
Resolves
Resolves #1501, monitor save/load, also mentioned in scratchfoundation/scratch-gui#3086
Proposed Changes
isMonitored
andtargetId
properties), ordata
category color to the extension color.Known Issues
Reason for Changes
Monitors should get saved and loaded in sb3s.
Test Coverage
Manual testing along with scratchfoundation/scratch-gui#3713.
Testing branch: https://llk.github.io/scratch-gui/monitors/
Added integration test monitor save/load, below is a screenshot of the stage in the fixture project added for this integration test:
Ensure the following:
loudness
andtimer
load correctly, (are visible, not empty, and update)Related PRs
cc/ @picklesrus