Page MenuHomePhabricator

Fix page preview renderings in storybook?
Closed, ResolvedPublic3 Estimated Story Points

Description

Two of our storybook thumbnails appear to not be rendering correctly:
https://doc.wikimedia.org/Popups/master/js/ui/?path=/story/thumbnails--landscape-svg
https://doc.wikimedia.org/Popups/master/js/ui/?path=/story/thumbnails--landscape-thin-thumbnail

Looking a little closer the URL for the image is being modified. For example in .storybook/mocks/models.js the URL for the thumbnail is expressed as img/258px-Barker_poster.jpg but for some reason this gets modified to substitute the URL with the height to img/Barker_poster.jpg/640px-Barker_poster.jpg

We should investigate what's going on here and if there's a larger problem caused by this outside storybook land.

Event Timeline

Jdlrobson renamed this task from Did we break certain page preview renderings or just storybook? to Fix page preview renderings in storybook?.Dec 16 2020, 8:24 PM

Needed to test T269336

Change 649957 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/Popups@master] Fix storybook IMG assets

https://gerrit.wikimedia.org/r/649957

Change 649957 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Fix storybook IMG assets

https://gerrit.wikimedia.org/r/649957

I was happy to merge https://gerrit.wikimedia.org/r/649957 as it did fix the positioning issue. However, there still appears to be an issue with (at least my) Storybook where the incorrect thumbnails are being requested:

Screenshot 2021-01-06 at 18.05.44.png (1×2 px, 411 KB)

I think this has something to do with the use of scaleDownThumbnail(), which mangles the thumbnail URL, in createPopup() in .storybook/helpers/createPopup.js.

ovasileva set the point value for this task to 3.Jan 7 2021, 6:47 PM

We decided that I'd make a list of the issues that I can see with Page Preview's Storybook codebase, get it reviewed, and then remove this task from the current iteration.

Issues that I've found with Page Preview's Storybook codebase:

page_previews_storybook_1.png (1×2 px, 419 KB)

  • The spacing of the previews is still a little… off:

page_previews_storybook_2.png (1×2 px, 340 KB)

  • @Jdrewniak's CSS resource (which gives everything a red border) isn't shown:

page_previews_storybook_3.png (1×2 px, 242 KB)

Are we repurposing this task as a "fix storybook" or should I create a new task with /T266797#6731438 ?

Note, the images are showing for me.. both locally and in docs.. .https://doc.wikimedia.org/Popups/master/js/ui/?path=/story/thumbnails--portrait-svg