-
Notifications
You must be signed in to change notification settings - Fork 806
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
[RNMobile] Sync VideoPress metadata when post is manually saved #30131
Conversation
Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run
to get started. More details: p9dueE-5Nn-p2 |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. |
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.
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.
Tested different flows in both platforms and confirmed that VideoPress metadata is saved in the below cases:
iOS:
- Published post - Tap
Update
button and then close the editor. ✅ - Published post - Close editor and save unsaved changes. ✅
- Draft post - Tap
Update
button and then close the editor. ✅ - Draft post - Close editor and save unsaved changes. ✅
- Draft post - Tap
Three dots button/Publish
and open the post again. ✅ - Scheduled post - Tap
Update
button and then close the editor. ✅ - Scheduled post - Close the editor and save unsaved changes. ✅
Android:
- Published post - Tap
Update
button and open the post again. ✅ - Published post - Close the editor with unsaved changes. ✅
- Published post - Tap
Schedule
button and open the post again. ✅ - Draft post - Tap
Three dots button/Save
and open the post again. ✅ - Draft post - Close the editor and save unsaved changes. ✅
- Draft post - Tap
Publish
and open the post again. ✅ - Scheduled post - Tap
Schedule
and open the post again. ✅ - Scheduled post - Close the editor and save unsaved changes. ✅
- Scheduled post - Tap
Publish Now
and open the post again. ✅
However, I noticed an issue when previewing a post or switching to HTML mode. It seems unrelated to these changes, so I wouldn't block the PR, but we'd need to track it.
Preview a post
- Having a VideoPress block with a video.
- Change some of the settings that will be synced (e.g. title).
- Tap on the three dots button.
- Tap on
Preview
. - Close the preview.
- Open the block settings and observe that the settings changes were discarded.
Switch to HTML mode
- Having a VideoPress block with a video.
- Change some of the settings that will be synced (e.g. title).
- Tap on the three dots button.
- Tap on
HTML Mode
. - Switch back to Visual Mode.
- Open the block settings and observe that the settings changes were discarded.
Apart from the above-unrelated issue, the PR looks great to me. I only added a comment that would be great to tackle before approving it.
projects/packages/videopress/src/client/block-editor/hooks/use-sync-media/index.ts
Outdated
Show resolved
Hide resolved
Feedback ref: #30131 (comment)
@fluiddot, thank you for catching those issues with preview and toggle mode! I've gone ahead to create an issue in wordpress-mobile/gutenberg-mobile#5677 and have added it to our project board. 🙇♀️ |
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 re-tested some of the cases shared in my last review. However, I'm trying to test the web version but I'm having trouble to have the VideoPress block registered 🤔.
projects/packages/videopress/src/client/block-editor/hooks/use-sync-media/index.ts
Outdated
Show resolved
Hide resolved
projects/packages/videopress/src/client/block-editor/hooks/use-sync-media/index.ts
Outdated
Show resolved
Hide resolved
projects/packages/videopress/src/client/block-editor/hooks/use-sync-media/index.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Carlos Garcia <[email protected]>
Co-authored-by: Carlos Garcia <[email protected]>
…attic/jetpack into rnmobile/detect-when-post-is-saved
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.
As internally discussed (p1681833498706689/1681831906.251289-slack-C03TA48NSUX), we'd need to move this import to a native file because the package is only available in the native version.
I've gone ahead to move the native functionality to a new The removal of native-specific functionality from the main file can be found in f050d65. For the new native file, it was possible to remove a bunch of (currently) unused functionality, as shown in 321d343. |
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 🎊 !
I tested the web version and worked as expected ✅ . Nevertheless, it would be great to request a second review from web folks to confirm no regressions are introduced.
Regarding the native version, I re-tested some of the cases shared here in both platforms and worked as expected ✅.
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.
No regressions on web version. Nice work!
Fixes wordpress-mobile/gutenberg-mobile#5666
Related PRs
Gutenberg
: [RNMobile] Listen for post save events WordPress/gutenberg#49781Gutenberg Mobile
: [RNMobile] Listen for post save events wordpress-mobile/gutenberg-mobile#5663iOS
: [Gutenberg] Emit editor save events wordpress-mobile/WordPress-iOS#20522Android
: [Gutenberg] Emit editor save events wordpress-mobile/WordPress-Android#18279Proposed changes:
Other information:
Jetpack product discussion
p9ugOq-3mV-p2
Does this pull request change what data or activity we track or use?
No, it doesn't.
Testing instructions:
Android flows
Flows for saving a draft⤵️
Flows for saving a published post⤵️
Flows for saving a scheduled post⤵️
iOS flows
Flows for saving a draft⤵️
Flows for saving a published post⤵️
Flows for saving a scheduled post⤵️