-
Notifications
You must be signed in to change notification settings - Fork 889
feat: [UEPR-252] add manual save of thumnails #9638
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
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.
Pull Request Overview
This PR introduces a manual thumbnail-saving flow by adding a feature flag, an informational modal on first use, and routing the thumbnail update through a custom handler.
- Add
MANUALLY_SAVE_THUMBNAILS
env var in Webpack and pass it through to the client - Create a tooltip and
UpdateThumbnailInfoModal
to explain manual saves on first use - Update
Preview
andPreviewPresentation
to use ahandleManualThumbnailUpdate
path and pass the new flag
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
webpack.config.js | Inject MANUALLY_SAVE_THUMBNAILS default into client env |
src/views/preview/update-thumbnail-info-modal.scss | Styles for the first-use info modal |
src/views/preview/update-thumbnail-info-modal.jsx | New modal component explaining manual thumbnail saves |
src/views/preview/project-view.scss | Tooltip styling and driver.js overrides for manual-save hint |
src/views/preview/project-view.jsx | Wire up handleManualThumbnailUpdate , tooltip, modal, and flag |
src/views/preview/presentation.jsx | Pass manuallySaveThumbnails (and userOwnsProject ) to GUI |
src/views/preview/l10n.json | Add localized strings for tooltip and info modal |
Comments suppressed due to low confidence (1)
src/views/preview/project-view.jsx:852
- The new
handleManualThumbnailUpdate
flow, including first-time tooltip and modal logic, doesn’t have any unit or integration tests. Adding tests for both the initial modal display and subsequent updates will help catch regressions.
handleManualThumbnailUpdate (id, blob) {
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.
I commented on a couple nits, but overall this looks great!
@@ -414,6 +415,8 @@ const PreviewPresentation = ({ | |||
onUpdateProjectId={onUpdateProjectId} | |||
onUpdateProjectThumbnail={onUpdateProjectThumbnail} | |||
shouldStopProject={shouldStopProject} | |||
manuallySaveThumbnails={manuallySaveThumbnails} | |||
userOwnsProject={userOwnsProject} |
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.
Is this flag actually used? I don't see it mentioned anywhere else in this PR...
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.
It's used in the editor to make sure we only show the update thumbnail button if the project is created by us:
scratchfoundation/scratch-editor#264
Co-authored-by: Christopher Willis-Ford <[email protected]>
Resolves
https://scratchfoundation.atlassian.net/browse/UEPR-252
Proposed Changes
Update logic, so that thumbnails are now updated manually
Reason for Changes
This will hopefully allow us to reduce monthly costs connected with thumbnail updates