Expected behavior
The minimum width and height of posted images will remain unrestricted, however if the image is below 48px in height or width, the image will be placed inside a container with a 1px border and 4px corner radii. This allows for a larger click/tap area vs restricting or having to scale the image which may not be desired by users.
Image examples:
If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
image examples not visible in description. Please reupload
@niklabh Done
Hi, I would like to work on this issue.
@esethna, I've a few questions about the expected behavior:
Would you please attach or add links to the sources of the example images (without borders and the added width/height)?
Thanks!
@asaadmahmood can you give some information here?
@abdusabri sorry the delay in the reply.
@andrewbrown00 The floor is yours.
@abdusabri, thanks for your interest here:
See example of a single image attachment: https://community-release.mattermost.com/core/pl/cbaeoe4mrtbsdn5ezo1axj67ya
Thanks @abdusabri for taking this ticket 馃槃. Answers to your questions are below:
Images attached
@andrewbrown00 Thanks for the feedback and for attaching the sources!
Re in-line markdown images, please check this PR 馃檪 https://github.com/mattermost/mattermost-webapp/pull/3639, that's why I asked and Eric confirmed
Re background color (and border), here is how it looks like in my early stage implementation
I've used the center channel theme color as Eric suggested (which is currently white 馃檪). It would be great if you just confirm the below style rules, especially for the border
background: var(--center-channel-bg);
border: 1px solid var(--center-channel-color-30);
Here are a couple of screenshots showing a whole range of cases to demonstrate the expected behavior
@esethna, while testing, i discovered an existing issue where images with a big height don't respect max height constraints
Existing issue
Fix before container is added
Fix with container added
Let me know whether i should include this fix or you would like to have it fixed in a separate ticket. Thanks!
Thanks for the catch @abdusabri, feel free to fix in this PR (with container added)
@abdusabri thanks for the excellent PRs recently, feel free to direct message me on our Community server if you are looking for new tickets, I'm sure we have many more that may be of interest!
https://community-daily.mattermost.com/core/channels/tickets
Thanks @esethna, my pleasure! 馃檪