-
Notifications
You must be signed in to change notification settings - Fork 253
DesktopHOC manages project title, rather than wrapping with TitledHOC #74
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
DesktopHOC manages project title, rather than wrapping with TitledHOC #74
Conversation
|
I labeled this "needs discussion" because it's not 100% clear yet that this is the direction we're going to go in GUI. |
cwillisf
left a comment
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.
LGTM, pending scratchfoundation/scratch-gui#5168 of course :)
|
@cwillisf I think we're ready to merge this -- could you test it to confirm that it works, before I do? |
|
@cwillisf wrote: "I tried it out and ran into two issues. One is an easy fix: in app.jsx, WrappedComponent needs canEditTitle so the title box shows up. The other issue is maybe a little stranger... I don't immediately see what's going wrong, but the setTitleFromSave stuff isn't currently working. That is, changing the project file name in the save dialog doesn't cause the title box to update." |
|
Next step: get desktop running locally, so I can debug this PR |
67f9dfc to
43f7cd5
Compare
|
OK @cwillisf, please try it out now! It should be working: |
cwillisf
left a comment
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 good! I tested it locally and everything seemed to be in working order. Thanks!

scratchfoundation/scratch-gui#5168 proposed a refactor where TitledHOC changed its role from:
Before: "wrap GUI and maintain projectTitle state, if no other external parent is maintaining it"
to
After: "wrap GUI and interface between external parent's projectTitle prop, and GUI's redux projectTitle"
This means that TitledHOC can't be used to wrap ScratchDesktopHOC anymore -- it no longer does the thing we used it for. Instead, ScratchDesktopHOC needs to maintain its own projectTitle state, since the main Electron process may send a projectTitle in on file load.
Important: this should only be merged if scratchfoundation/scratch-gui#5168 is also merged. scratchfoundation/scratch-gui#5168 should be merged first, so the resulting version of GUI can be used by scratch-desktop.