Skip to content
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

Stories: 16.8 Bug Fixes #15996

Merged
merged 8 commits into from
Mar 2, 2021
Merged

Stories: 16.8 Bug Fixes #15996

merged 8 commits into from
Mar 2, 2021

Conversation

bjtitus
Copy link
Contributor

@bjtitus bjtitus commented Mar 2, 2021

Related Kanvas PR: tumblr/kanvas-ios#93

  • Fixes a bug where the Media Picker could be rotated to landscape and mess up the UI. Notice the size of the view controller + tab bar and the "Add" button in the "before" video below:
Rotation.mp4
  • Fixes a bug when scaling Portrait video to fill the device screen. Note that this does slow down video import a little.
Before After
  • Disables Stories on iPad for the 16.8 release.

Testing

  • Open the Story Editor.
  • Open the Media Picker using the button in the bottom left.
  • Rotate the device to landscape and ensure that the status bar remains fixed.
  • Select a video which was taken in Portrait by your iPhone.
  • Ensure that the video appears in the correct aspect ratio and is not warped.

iPad

  • Tap on the FAB from the Blog Details or Post list screens
  • Ensure that the "Story post" option is not available on iPad
  • When attempting to edit a story, ensure that a message appears when tapping the edit button.
  • The Story block should not be available in the block picker when adding a new block.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

bjtitus added 4 commits March 1, 2021 22:12
This can be done by the Kanvas Metal renderer but we need to work out a few bugs first. For now, we'll rotate these on import.
@bjtitus bjtitus added this to the 16.8 ❄️ milestone Mar 2, 2021
@bjtitus bjtitus self-assigned this Mar 2, 2021
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Mar 2, 2021

You can trigger an installable build for these changes by visiting CircleCI here.

# Conflicts:
#	WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Mar 2, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@aforcier
Copy link
Contributor

aforcier commented Mar 2, 2021

Gave this a try, things seem to work as expected 🎉 Found one possible issue.

  • Confirmed that adding a video filmed in portrait mode used to be warped, and now isn't
  • Confirmed that nothing breaks when rotating the device (I'm not sure I understood the step - the expected result is that landscape mode is effectively disabled, is that right?)
  • On an iPad simulator, ensured that "Story post" was not available as an option in the create sheet from either blog details or post list, and confirmed that tapping a story in an existing post shows a message and prevents the story editor from being loaded.

The issue I found is that the story block still shows up in the Gutenberg block picker list on an iPad. We should probably hide it from there as well. However the message that iPad is not supported shows up correctly when attempting to populate the block, so nothing breaks, and we found this to be rarely used on Android - so if it's for some reason difficult/dangerous to implement it's probably fine to leave it in.

@bjtitus bjtitus requested a review from aerych March 2, 2021 16:15
@bjtitus bjtitus marked this pull request as ready for review March 2, 2021 16:15
Copy link
Member

@aerych aerych left a comment

Choose a reason for hiding this comment

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

Hola @bjtitus 👋
Looking good! Tested on an iPhone device and iPad simulator. I had some very nitpicky comments code wise but nothing that's a blocker (tho getting rid of the optional would be delightful). :shipit: from me, and if you decide to make any other changes let me know and I'll quickly re-review. :)

let controller = try StoryEditor.editor(blog: blog, context: ContextManager.shared.mainContext, updated: {_ in }, uploaded: { [weak self] result in
switch result {
case .success:
()
Copy link
Member

Choose a reason for hiding this comment

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

I know this was an existing expression, but what would you think about changing the () to a break since that's the more expected syntax for a switch/case skip. (Maybe this predates break being added to Swift 🤔)

switch error {
case StoryEditor.EditorCreationError.unsupportedDevice:
let title = NSLocalizedString("Unsupported Device", comment: "Title for stories unsupported device error.")
let message = NSLocalizedString("We are still working on the Stories editor for iPad. In the meantime, please try Stories on your iPhone.", comment: "Message for stories unsupported device error.")
Copy link
Member

Choose a reason for hiding this comment

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

I might be a little overly cautious about the wording here, but I'm wondering if it could run afoul of Apple's "no betas" rule if we get a reviewer that's particularly fussy. Instead of "We are still working on the Stories editor for iPad" would it be safer to say something like "The Stories editor for is not currently available for your iPad"?

/// Applies the `preferredTransform` of the video track.
/// - Returns: Returns both an AVMutableComposition containing video + audio and an AVVideoComposition of the rotate video.
private func rotate() -> (AVMutableComposition, AVVideoComposition) {
let videoTrack = tracks(withMediaType: .video).first!
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this could be tweaked to avoid the implicitly unwrapped optional?

@bjtitus bjtitus merged commit 3f8fece into release/16.8 Mar 2, 2021
@bjtitus bjtitus deleted the stories/16-8-fixes branch March 2, 2021 20:36
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.

3 participants