-
Notifications
You must be signed in to change notification settings - Fork 258
WS-1674 Implement Temporary UX Solution for Portrait Video Promo Display on Index Pages #13432
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
base: latest
Are you sure you want to change the base?
Conversation
|
Just curious on the No JS fallback for this and how it looks? |
Ah figured it out - it's actually effecting a fair few things, fixing those this morning! |
Tested on Safari mobile as well and it doesn't seem to work. Feel like this would be an issue as iOS is quite high usage for us. |
Strange - what version are you on? As it works for me on both safari mobile and desktop, checking https://simorgh1.belfrage-preview.test.api.bbc.com/persian/topics/c6z7mnr559gt?renderer_env=live @Isabella-Mitchell @amoore108 |
Preview works for me on Safari desktop and mobile with the preview link. I had only tested local. |
Thanks for the preview link, yea that works on desktop and mobile for me although quite visibly 'jumps' between the image filling the container and going portrait. |
Yeahh i think i might check this with UX before merge , my decision process for this was here. The only way to prevent this really is to assume all images are portrait at first, but then this makes landscape images do the visible jumps, and it felt like those are more prominent across the site so we should prioritise those? |
Ideally we should avoid the jumping behaviour completely, its happening because of the |
Yeahhh i know, ive just tried to play around with setting isPortrait to null iniitally and displaying the placeholder for longer while we figure out if the image is portrait or not, but i couldnt really get it working properly. I also have tried messing around with aspect ratios to see if i can get the pure css working but it doesnt seem possible to account for portrait and landscape this way 😢 I could check if the background colour is necessary, but even without it we'd still have the jumpy problem :/ @amoore108 |
|
I can still see some snapshots in Chromatic with diffs that I wouldn't expect. The other way around this would be to extract the gradient background into its own component and use it directly in the simorgh/src/app/components/FrostedGlassPromo/index.tsx Lines 138 to 144 in aae34f9
It has the Its good work here, feels more permanent than temporary though which is why I'm trying to keep the complexity and potential side-effects down. Just don't want a bunch of work to go into a solution that will be taken away? May be worth a huddle with a few folks to discuss? |
|
Hey hey, I know this is temporary solution but just to highlight (if I'm understanding correctly) I think that will trigger an extra image load and
So there might be a risk that each canonical image (including any lazy loaded/offscreen renders) could start fetching/processing right away, bypassing lazy-load deferral for that extra fetch and that could add significant CPU/network cost across the site. Awesome job, this seems a bit fiddly |
pvaliani
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.
just left comment above ^
Which ones in the chromatic would you not expect? Ive had a quick look through and it looks like it's all just promos that have changed which would be correct - i thought by keeping the isPromo boolean in place it would prevent it making changes to images everywhere - might have missed something though! |
nvm i think i've prevented this a little by calling it conditionally just for portrait image promos |
| background: `rgba(${colour?.rgb?.join(',')}, 0.62)`, | ||
| }, | ||
| }), | ||
| }, |
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 agree with Aaron on making a separate component for this as I'm not 100% sure about having these changes in our native image component for this "temporary" fix. It feels like the colour stuff should be encapsulated within it's own component to prevent any accidental re-rendering or other side effects.
This feels more permanent than temporary. Is there something simpler we could do like just having a black background across the board? If we stick with the isPortrait mechanism, we should probably align the API we have already for the orientation value that we use on media players, to make it a lil more consistent.
Maybe we do a huddle on this to discuss our options?








Resolves JIRA: WS-1674
Paper Doc
Summary
Detects 16x9 Portrait images and styles them to fit the 9x16 image promo to ensure the whole image is visible, and adds a gradient that pulls through a main colour from the image.
The detection of portrait images happens onLoad for lazy loaded images, and in a useEffect to account for images above the fold and/or that have been previously cached.
Code changes
useImageColourfunction to pull through the main colour of the imagecover:containto ensure whole portrait image is visibleuseImageColourFunctionTesting
Additional Testing Steps
Useful Links