StampyAI / stampy-ui

AI Safety Q&A web frontend
https://aisafety.info
MIT License
35 stars 9 forks source link

Height of answer not always correct #274

Closed mruwnik closed 1 year ago

mruwnik commented 1 year ago

https://aisafety.info/?state=8EL7_ doesn't always display the correct height - sometimes it cuts the bottom off.

Possibly an issue of the height being calculated before the image gets displayed? This is reproducible on slower connections, where the answer is displayed without the image, after which the image gets inserted but the div isn't stretched.

Aprillion commented 1 year ago

could be related to image loading 🤔

however, right now no image loaded for me at all, so I was not able to reproduce this small issue because of that bigger issue... Google returning HTTP 403 for https://lh5.googleusercontent.com/foQ3MGOahQrs7-ZewNV02v9etemQl6R9NDR2-QUCzjPpHerbnYCjlBSF_Y_wMLyPgDJys9X-osz1KkGsnm3mFBR8B-O1EbbF7aD8FnHXbhOBr8H6UFSsmCf6queXBlEpqZL-AUr5w8Y2JG_5tOE2csNnb6eB304N

Aprillion commented 1 year ago

Looks like I can detect load event of <img> in capture phase on document element => https://peter.hozak.info/react-auto-height/?path=/story/autoheight--image-without-specified-height works fine when tested in Firefox on Win+Mac+Android, Chrome on Win+Mac and Safari on Mac => I will update UI code to handle height resize on image load and leave it up to https://github.com/StampyAI/GDocsRelatedThings/issues/24 to figure out image hosting.