Repository navigation
Use default thumbnails as a fallback while real ones are loading - #3934
Open
thatbudakguy wants to merge 1 commit into
Open
thatbudakguy wants to merge 1 commit into
thatbudakguy wants to merge 1 commit into
Conversation
Member
Author
|
I upstreamed this from geoblacklight/geoblacklight#1970, since it didn't feel specific to GeoBlacklight. |
thatbudakguy
force-pushed
the
thumbnail-fallback
branch
from
October 16, 2026 20:05
e4980e5 to
673c5a9
Compare
thatbudakguy
marked this pull request as ready for review
October 16, 2026 20:05
jcoyne
force-pushed
the
thumbnail-fallback
branch
from
October 16, 2026 20:30
673c5a9 to
147c133
Compare
jcoyne
requested changes
Oct 16, 2026
jcoyne
reviewed
Oct 17, 2026
| grid-area: 1 / 1; | ||
| } | ||
|
|
||
| .thumbnail-fallback { |
Member
There was a problem hiding this comment.
So, we're placing both images in one cell and only centering the fallback? If the default image is larger than the record image, parts of the default remain visible around the loaded image, right?
Member
Author
There was a problem hiding this comment.
Member
Author
There was a problem hiding this comment.
...realized this was from the earlier branch in GBL, and I forgot to port that part. great catch.
Member
Author
There was a problem hiding this comment.
Updated so that the real thumbnail is always at least as large as the fallback.
thatbudakguy
force-pushed
the
thumbnail-fallback
branch
4 times, most recently
from
October 28, 2026 18:59
c6b00f3 to
605eea3
Compare
You can set default_thumbnail to a single value or a proc or method, which currently allows GeoBlacklight to render an icon thumbnail for every record based on its content type. This is pretty useful. This PR takes advantage of that in the case where we have both a default_thumbnail and the record has a thumbnail image of its own. In this case loading the thumbnail from an external location can sometimes be quite slow (if it's not cached yet) or even fail. This change just renders the default thumbnail with the record's real one stacked on top of it, so that the default gets used as a fallback while the loading happens, and stays there if the loading fails. The items are stacked using CSS, so there's no javascript needed to make it work.
thatbudakguy
force-pushed
the
thumbnail-fallback
branch
from
October 28, 2026 20:22
605eea3 to
ee91242
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


You can set default_thumbnail to a single value or a proc or method,
which currently allows GeoBlacklight to render an icon thumbnail
for every record based on its content type. This is pretty useful.
This PR takes advantage of that in the case where we have both
a default_thumbnail and the record has a thumbnail image of its own.
In this case loading the thumbnail from an external location can
sometimes be quite slow (if it's not cached yet) or even fail.
This change just renders the default thumbnail with the record's
real one stacked on top of it, so that the default gets used as
a fallback while the loading happens, and stays there if the
loading fails. The items are stacked using CSS, so there's no
javascript needed to make it work.