Closed Bug 1780770 Opened 3 years ago Closed 3 years ago

attachmentView height calculation ignores userChrome.css

Categories

(Thunderbird :: Message Reader UI, defect)

Thunderbird 102
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: fstboard-mozilla, Unassigned)

Details

Attachments

(2 files)

Attached image attachments.jpg

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

Having mailnews.attachments.display.start_expanded set to true in user.js I tried to remove the attachment bar as there is no need for it anymore. So I set
#attachmentBar {
display: none!important;
}
in userChrome.css.

Actual results:

It works in that the attachment bar vanishes, but the height of the attachmentView vbox is still calculated as if the bar was there. Thus, the attachmentView vbox is too high. However, when selecting a different message and then going back to the one with the attachments, then the height is calculated correctly and the attachmentView vbox is the correct size. Likely the height initially is calculated before the userChrome.css has been read and applied.

However, this happends for every mail. I.e., I start TB, select the first mail with attachments, size wrong. I select another mail and then the first one again => correct size. Now I select another mail with attachments => also wrong size and corrected on the second visit.

Thus it seems that every time I select another mail the size is again calculated without respecting what has been set in userChrome.css.

Expected results:

The height of the vbox should always be calculated after user css files were applied so that it is always has the correct size and not only on subsequent visits.

Attached image attachments2.jpg

No, it's a little bit a different than I though. The calculation on the second visit is not done correctly, it is just reduced to one line. In attachments2.jpg is an example of a mail with many attachments and the attachment bar enabled and initially opened. The first visit shows all the attachments. The second visit of the mail shows just the first line. But when collapsing and uncollapsing all attachments line are shown again.

I guess it should work this way:

  1. if attachment bar is disabled by css (you might consider adding an config option for this) the height should be calculated without the space for the non-visible attachment bar
  2. if attachment bar is opened, either all lines or only the first line (with a scroll bar at the right, this does correctly exist when neccessary) should be shown, but always the same way. It should not be different after collapsing and uncollapsing. I.e. it should always look like in the "first visit" in attachments2.jpg or like in "second visit".
  3. if all lines are shown or only one (or a certain maximum number) should be configurable either by a config option or with user css by e.g. setting a max-height for #attachmentView

Note that when hiding the attachmentBar with css, the effect for this multi-attachment mail is the same. Initially the box is to high, but on the second visit there is only one line and a vertical scrollbar on the right.

The whole problem seems to be caused only by the flex formatting. Using this

#attachmentView { 
  display: block!important;
}
#attachmentList { 
  display:block!important;
}
.attachmentItem { 
  display:inline-block!important;
}

in userChrome.css always shows all attachments without any wrong additional space on the first visit with the attachment bar hidden. If attachment bar is shown, there is some wrong additional space on first visit and after collapsing and uncollapsing the attachments.

Reporter, do you still see this issue when using the latest version?
What information can you add to clarify the steps to reproduce this issue?

Whiteboard: [closeme 2023-04-25]

In 102.9.1 everything works fine now with the attachmentBar set to "display:none". If the attachmentBar is displayed, there is only a little glitch left: On the first visit of a mail with enough attachments that at least two lines are needed to display them, there is some additional space below the attachments, about the height of one attachment line. On the second visit this is gone. This doesn't happen if the attachments fit into one single line. Everything else looks the same on both visits and just as it should.

Resolved per whiteboard and Comment 5

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
Whiteboard: [closeme 2023-04-25]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: