Fix double wrapped thumbnail icon#5142
Fix double wrapped thumbnail icon#5142ozer550 wants to merge 4 commits intolearningequality:unstablefrom
Conversation
MisRob
left a comment
There was a problem hiding this comment.
Hi @ozer550, thank you. Looks like a good start.
Next step would be to improve thumbnail icon scaling logic. I think the goal of the issue was to remove the extra <svg>, but without any changes to user experience. However as of now, icon scaling is lost - for example, if I gradually resize /channels browser window, the thumbnail icon behaves quite differently from before. Here's few places, but it affects almost every screen size.
| Screen width | Before / expected | After |
|---|---|---|
600px |
![]() |
![]() |
1380px |
![]() |
![]() |
Looking into code, there seemed to be lots of effort into implementing smooth scaling experience:
$svg-scale: 1.25;
$svg-width: calc(100% * 9 / 16 / #{$svg-scale});
$svg-top: calc((100% * 9 / 16 / 2) - ($svg-width / 2));
svg.thumbnail-image {
top: 0;
left: calc(50% - (#{$svg-width} / 4));
width: calc(#{$svg-width} / 4);
...
Even though we want to remove extra svg, I don't think it was intended to get rid of this logic completely. We'd rather want to reapply it in a way that works with KIcon.
contentcuration/contentcuration/frontend/shared/views/files/Thumbnail.vue
Outdated
Show resolved
Hide resolved
contentcuration/contentcuration/frontend/shared/views/files/Thumbnail.vue
Outdated
Show resolved
Hide resolved
contentcuration/contentcuration/frontend/shared/views/files/Thumbnail.vue
Show resolved
Hide resolved
contentcuration/contentcuration/frontend/shared/views/files/Thumbnail.vue
Show resolved
Hide resolved
|
#5147 has now been merged, so can rebase here. |
|
To sum up our co-hack:
|
92bc058 to
70f156f
Compare
|
Hi @ozer550, overall looking good, and I like the way it's simpler now. I previewed both compact and non-compact mode and haven't noticed any regressions. Nice work. Just two clarifications. |
| [kind]: compact, | ||
| 'icon-only': compact, | ||
| nothumbnail: !showThumbnail && !compact, | ||
| 'with-caption': showCaption, |
There was a problem hiding this comment.
Where can I preview before / after of thumbnails with captions?
| $svg-scale: 1.25; | ||
| $aspect-ratio: 9 / 16; | ||
|
|
||
| $aspect-percentage: $aspect-ratio * 100%; |
There was a problem hiding this comment.
Even though it's referenced from .thumbnail, is that style actually taking effect? Seems like something that was closely interconnected with the calculations we're now removing. So just double-checking if this is something to be cleaned up as well.




Summary
References
closes #4991
Reviewer guidance