Skip to content

Commit 8ebb563

Browse files
gnpricechrisbobbe
authored andcommitted
content: Show spinner for thumbnail placeholders
This is a port of zulip/zulip#30477. That PR isn't yet merged, but it's been deployed on chat.zulip.org and I believe the styling is unlikely to change. (If it does get tweaked, we can always update.) The placeholder `img` elements already come with a `src` pointing to this same `loader-black.svg` file, but on the Zulip server. So the effects of this change are: * The placeholder image is local instead of remote, which may improve the experience a bit on a slow connection. * In dark theme, we use an appropriately contrasting white spinner, instead of a black spinner that blends in with the background. Fixes: #5875
1 parent 40b19fd commit 8ebb563

File tree

5 files changed

+106
-0
lines changed

5 files changed

+106
-0
lines changed

src/webview/css/cssNight.js

+3
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ body {
1717
.highlight {
1818
background-color: hsla(51, 100%, 64%, 0.42);
1919
}
20+
.message_inline_image img.image-loading-placeholder {
21+
content: url("images/loader-white.svg");
22+
}
2023
`;

src/webview/static/base.css

+3
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ time {
552552
height: 160px;
553553
object-fit: scale-down;
554554
}
555+
.message_inline_image img.image-loading-placeholder {
556+
content: url("images/loader-black.svg");
557+
}
555558

556559
.message_inline_video {
557560
position: relative;
+49
Loading
+49
Loading

tools/build-webview

+2
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ sync "src/webview/static" "${dest}" <<EOF
195195
+ /base.css
196196
+ /images/
197197
+ /images/follow.svg
198+
+ /images/loader-black.svg
199+
+ /images/loader-white.svg
198200
+ /images/play_button.svg
199201
- *
200202
EOF

0 commit comments

Comments
 (0)