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

Layout problem when there are many attachments #113

Open
jsfan3 opened this issue Jan 8, 2024 · 2 comments
Open

Layout problem when there are many attachments #113

jsfan3 opened this issue Jan 8, 2024 · 2 comments

Comments

@jsfan3
Copy link

jsfan3 commented Jan 8, 2024

Please see this screenshot: there is not enough space for the email body. I suggest that attachments should be in a box that automatically collapses when the email is opened.

screenshot

mjl- added a commit that referenced this issue Jan 12, 2024
@mjl-
Copy link
Owner

mjl- commented Jan 12, 2024

Not decoding the filenames with this charset made them longer, that should be fixed with the commit just now.
But then we can still have long lists of files. I think the easiest fix indeed is to collapse the list. Probably just show the first N filenames, and a button to show/hide the rest. Let's leave this issue open until I've implemented the show/hide button. It'll be similar to the show/hide button for the To/Cc/Bcc addresses.

For the long term, it could be good to just scroll the entire message view (especially with top/down view). But that's not currently possible because the webmail code doesn't have access to the isolated iframe that holds the message, so can't read its size, so the full message view height can't be calculated. Perhaps there is a different solution, or perhaps the isolation can be relaxed a bit (the open question for me is whether that is safe to do).

@jsfan3
Copy link
Author

jsfan3 commented Jan 13, 2024

I am not familiar with this coding problem, and I also did not understand exactly what the problem is. However, communication between iframe and parent window is possible with the javascript Window.postMessage() method. It allows for safe cross-origin communication between the parent page and the iframe.

You can have the iframe send a message to the parent window whenever its size changes (like when the content is fully loaded or if dynamic changes occur). This message would contain the height of the iframe's content.

In the parent window, an event listener can get messages from the iframe. When a message is received, you can use the provided height to adjust the size of the iframe element in the parent document.

Documentation: https://dev-bay.com/iframe-and-parent-window-postmessage-communication/

mjl- added a commit that referenced this issue Apr 20, 2024
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

No branches or pull requests

2 participants