lbry-desktop/ui
infinite-persistence fc7edc875b
ChannelThumbnail improvements
- [x] (6332) The IntersectionObserver method of lazy-loading loads cached images visibly late on slower devices. Previously, it was also showing the "broken image" icon briefly, which we mended by placing a dummy transparent image as the initial src.
  - Reverted that ugly transparent image fix.
  - Use the browser's built-in `loading="lazy"` instead. Sorry, Safari.

- [x] Size-optimization did not take "device pixel ratio" into account.
  - When resizing an image through the CDN, we can't just take the dimensions of the tag in pixels directly -- we need to take zooming into account, otherwise the image ends up blurry.
  - Previously, we quickly disabled optimization for the channel avatar in the Channel Page because of this. Now that we know the root-cause, the change was reverted and we now go through the CDN with appropriate sizes. This also improves our Web Vital scores.

- [x] Size-optimization wasn't really implemented for all ChannelThumbnail instances.
  - The CDN-optimized size was hardcoded to the largest instance, so small images like sidebar thumbnails are still loading images that are unnecessarily larger.
  - There's a little-bit of hardcoding of values from CSS here, but I think it's a ok compromise (not something we change often). It also doesn't need to be exact -- the "device pixel ratio" calculate will ensure it's slightly larger than what we need.

- [x] Set `width` and `height` of `<img>` to improve CLS.
  - Addresses Ligthhouse complaints, although technically the shifting was addressed at the `ClaimPreviewTile` level (sub-container dimensions are well defined).
  - Notes: the values don't need to be the final CSS-adjusted sizes. It just needs to be in the right aspect ratio to help the browser pre-allocate space to avoid shifts.

- [x] Add option to disable lazy-load Channel Thumbnails
  - The guidelines mentioned that items that are already in the viewport should not enable `loading="lazy"`.
  - We have a few areas where it doesn't make sense to lazy-load (e.g. thumbnail in Header, channel selector dropdown, publish preview, etc.).
2021-07-05 16:04:10 +08:00
..
component ChannelThumbnail improvements 2021-07-05 16:04:10 +08:00
constants updated code 2021-07-03 14:42:37 -04:00
effects Wunderbar: change throttle to debounce + add min chars 2021-06-23 14:15:59 -04:00
modal ChannelThumbnail improvements 2021-07-05 16:04:10 +08:00
page ChannelThumbnail improvements 2021-07-05 16:04:10 +08:00
redux Show comment failure reason 2021-07-03 13:07:05 -04:00
scss updated code 2021-07-03 14:42:37 -04:00
util RSS feed for channels 2021-07-02 13:03:21 +08:00
analytics.js Fix lint (removal of videoFetchDuration) 2021-06-10 10:14:52 -04:00
app.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
comments.js Commentron Moderation Delegation API 2021-06-18 15:46:51 -04:00
i18n.js Revert "Simplify language lists" 2021-04-06 15:42:27 -04:00
index.jsx CodeSplit: Load 3rd-party css before ours. 2021-06-25 16:00:45 +08:00
logWarningConsoleMessage.js new lbc icon 2020-09-29 17:12:32 -04:00
native.js working 2020-12-16 10:52:22 -05:00
reducers.js wip 2021-06-08 13:25:52 -04:00
rewards.js When a new reward is acquired, only close modals if the reward comes from reward_code 2021-01-08 08:16:41 -07:00
store.js wip 2021-06-08 13:25:52 -04:00