mustang-im / mustang

Mustang - New full-featured desktop email, chat and video conference client
https://mustang.im
Other
9 stars 2 forks source link

Chat viewer: iframe sized to content #141

Open benbucksch opened 3 months ago

benbucksch commented 3 months ago

Reproduction

Actual result

Expected result

Cause

jermy-c commented 3 months ago

Progress Update

  1. Messages are loaded in <webview/> using the Shared/WebView Component
  2. The height it sized to to the height of the content except when the content is minimal because there's min-height for the iframe within the . I'm still not sure how to set the min-height for the iframe that is within the webview. The min-height is 126px. 圖片 圖片
jermy-c commented 2 months ago

183

Known Issues:

Tried:

TODO

benbucksch commented 2 months ago

Make the webview tag have a max-width of it's parent

Try to set the max-width at the start, before rendering, i.e. at the same time when we set the content, not in the resize handler.

Normal (non-hvbox-flex-grid) layout works by first determining the width, then the layout including line wraps happens, and then the height is a result of the content height. Without knowing the width, the browser doesn't know where to wrap lines and therefore doesn't know how many text lines there are and therefore cannot know the know the height. That's why the width needs to be set, before the height can be determined.

benbucksch commented 1 month ago

Hey Jeremy, thanks for PR #185 . It makes the sizing work much better. I just merged it. But still disabled for now.

benbucksch commented 1 month ago

Remaining issues that I could see: