Reader: Support Stories in detail view - #14965
Conversation
|
You can trigger an installable build for these changes by visiting CircleCI here. |
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
leandroalonso
left a comment
There was a problem hiding this comment.
@aforcier it works like described!
Just a question though:
- The story doesn't open in fullscreen, is that expected?
- The video doesn't seem to play for me: https://d.pr/v/1YronD
- When I manually hit play, it shows as a default video (with OS controls). This is the default behavior of the web view, so there isn't much we can do here AFAIK. Just double-checking that you're aware of it.
| view?.scroll(to: hash) | ||
| } else if url.pathExtension.contains("gif") || url.pathExtension.contains("jpg") || url.pathExtension.contains("jpeg") || url.pathExtension.contains("png") { | ||
| presentImage(url) | ||
| } else if url.query?.contains("wp-story") ?? false { |
There was a problem hiding this comment.
Don't we want to open that in fullscreen?
This is def a bug. Would you mind opening an issue for it? |
|
Thanks @leandroalonso!
It's expected in the sense that I'd like it to open fullscreen but don't see a way to 😀. Visiting a story from iOS Safari directly also doesn't fully fullscreen and hide the controls so I thought this is as far as fullscreen goes. Do you know of a way to fullscreen, either in the web view or in Safari itself (though I think it's not possible in Safari)?
Great find! I guess I hadn't tried a video on iOS. When I inspect the window I see an error in the console:
From some digging around it seems like autoplay for videos doesn't work for Safari because a user action is required to play audio by default. I think there are three possible fixes here:
I'll check in with @Tug and follow up on this one, might be a case of going with 1 for now and making the improvement from 2 or 3 later.
Hmmm. Seems specific to the web view as this works correctly on Safari. Is there a way to open Safari instead of a webview instead? (This is what we're also doing on Android but for different reasons.) |
No problem! #15009 |
We have 2 options:
I guess we can try the
Thank you! |
|
Thanks @leandroalonso! Still looking into this, I wrote up all the issues and options in #15026. This PR is still good enough as a first iteration to actually get stories working in the Reader, so I'll merge it for now and follow up with improvements later. |
Tweaks the Reader to support the Story block in detail view:
The bulk of the work for this has been done in the shared CSS file in Calypso and already deployed: Automattic/wp-calypso#45397
Extra changes that were needed for WPiOS:
Image
a hreftag wrappingThe in-app custom CSS wraps all images with a link tag, which breaks the Story markup (and Stories have their own link set anyway). I added an exception for Stories in f7667f5.
(Incidentally the existing behavior also wraps images that already had custom links of their own, so the original link can no longer be visited -not sure if this was intentional, just noting it here.)
Story link handling
I had to modify the logic when tapping a Reader detail link. The idea is for tapping a story to open the WebView so the story can be loaded in fullscreen and autoplay. The link is to the post itself, with extra query parameters, like this:
https://site.wordpress.com/2020/09/02/a-story-post/?wp-story-load-in-fullscreen=true&wp-story-play-on-load=trueThis worked correctly for Jetpack sites, however for WordPress.com sites the
ReaderDetailCoordinatorinterprets the link as a WordPress.com post and opens it in a new detail screen. This looks like the same post being loaded again and again.I added an exception for stories in 242781b, by filtering for a query param containing
wp-story.Android PR: wordpress-mobile/WordPress-Android#13002
To test:
reader-mobile.cssPR submission checklist:
RELEASE-NOTES.txtif necessary.