This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 828
Fix: Images no longer reserve their space in the timeline correctly #10571
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7533eef
test case
9c6eb1e
fix + lint
16204e0
refix strictNullChecks issue
d5860d6
add comment about max image size
43f4752
tweak
714d4ac
use safer magic number
7f7daa1
Merge branch 'develop' into kerry/25082/image-placeholder
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
36 changes: 36 additions & 0 deletions
36
test/components/views/messages/__snapshots__/MImageBody-test.tsx.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<MImageBody/> should show a thumbnail while image is being downloaded 1`] = ` | ||
<div> | ||
<div | ||
class="mx_MImageBody" | ||
> | ||
<div | ||
class="mx_MImageBody_thumbnail_container" | ||
style="max-height: 50px; max-width: 40px;" | ||
> | ||
<div | ||
class="mx_MImageBody_placeholder" | ||
> | ||
<div | ||
class="mx_Spinner" | ||
> | ||
<div | ||
aria-label="Loading…" | ||
class="mx_Spinner_icon" | ||
data-testid="spinner" | ||
role="progressbar" | ||
style="width: 32px; height: 32px;" | ||
/> | ||
</div> | ||
</div> | ||
<div | ||
style="max-height: 50px; max-width: 40px;" | ||
/> | ||
<div | ||
style="height: 50px; width: 40px;" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not better be set to a fallback of 🤷 50px for good measure? If the conditions below don't work there will be a huuuge thumbnail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is clamped down later by
suggestedImageSize
tomaxHeight
maxWidth
, then these values are only used to set aspect ratio. I've changed it to a safer magic number