Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: chat "scrolling up" because of imgs loading #4431

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

WofWca
Copy link
Collaborator

@WofWca WofWca commented Dec 22, 2024

Visual aspect, before / after:
image image

This, together with #4407,
should close #4404.

The bug was introduced in #3999.
Pior to that we used to have fixed width on quoted images as well.
This commmit practically reverts that MR, but also adds
object-fit and object-position, and is now in line with
message attachment images

@WofWca WofWca force-pushed the wofwca/fix-chat-scroll-up-quote-imgs branch from 3f8b90b to 410127a Compare December 22, 2024 17:49
@WofWca WofWca marked this pull request as ready for review December 22, 2024 17:49
@WofWca WofWca force-pushed the wofwca/fix-chat-scroll-up-quote-imgs branch from 410127a to 0b05ac9 Compare December 22, 2024 17:52
@WofWca WofWca force-pushed the wofwca/fix-chat-scroll-up-quote-imgs branch from 0b05ac9 to ada6bf5 Compare December 22, 2024 17:54
@WofWca
Copy link
Collaborator Author

WofWca commented Dec 28, 2024

An alternative solution would be #4314.

height: var(--quote-img-size);
// do not set width, to keep the aspect ratio (see https://github.com/deltachat/deltachat-desktop/issues/3931)
width: var(--quote-img-size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is object-fit: scale-down in conjunction with width: 100% not enough (and better since it does not force any image to have a 36px width)?

I tested various variants with extreme landscape ratios and text and it looked better.

But I can also live with the current solutions, since we are going to find amore adaptive generic solution for images anyway (hopefully)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried quoting a in image with a captoion or just an image?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried with text and without. But it's true, with an extrem ratio (like 1300 x 30 px) it hides the text. So let's solve that hopefully soon as said above

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

width: 100% simply makes it take up 50% of the flex container, which can be adjusted with flex-shrink. IDK if this is what we want.

This, together with #4407,
should close #4404.

The bug was introduced in #3999.
Pior to that we used to have fixed width on quoted images as well.
This commmit practically reverts that MR, but also adds
`object-fit` and `object-position`, and is now in line with
message attachment images.
@WofWca WofWca force-pushed the wofwca/fix-chat-scroll-up-quote-imgs branch from ada6bf5 to a4e2290 Compare January 6, 2025 20:07
@WofWca WofWca merged commit 1907a4f into main Jan 6, 2025
5 of 11 checks passed
@WofWca WofWca deleted the wofwca/fix-chat-scroll-up-quote-imgs branch January 6, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chat "scrolls up" right after switching to it, because images load and shift height
2 participants