Closed Bug 1917465 Opened 5 months ago Closed 23 days ago

Incorrect scrolling position in local folder at startup

Categories

(Thunderbird :: Folder and Message Lists, defect)

Thunderbird 128
defect

Tracking

(thunderbird_esr115 wontfix, thunderbird_esr128 affected, thunderbird135 fixed)

RESOLVED FIXED
136 Branch
Tracking Status
thunderbird_esr115 --- wontfix
thunderbird_esr128 --- affected
thunderbird135 --- fixed

People

(Reporter: tssajo, Assigned: darktrojan)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0

Steps to reproduce:

I open Thunderbird.

Actual results:

The inbox message list has the focus, but the newest message displayed is somewhere in the middle of the total list of messages in the inbox.

Expected results:

The newest message displayed should be the one with the newest timestamp. This is the behavior I saw before ~115.10.x.


This bug is still present in Thunderbird 128.2.0esr as of September 8th, 2024

I run Thunderbird 128.2.0esr on Windows 10
(I fully updated Windows 10 on September 8th, 2024)

When this was fixed for ESR 115 in bug 1827042, it was implemented this way:

This scrolls the view to the most relevant end of the tree if no selections are to be
restored, no new message has been scrolled to just before, and no user scrolling has been
detected before all messages have been loaded.

So maybe some scrolling was detected for some reason?

Well, the problem only occurs when I launch Thunderbird. I don't scroll at all.
Thunderbird just starts and the Inbox is shown, but the scroll position is wrong. Then if I click on any other folder (e.g. Drafts) and then click on Inbox then the scroll position is perfect. In other words, I just need to click-away and then come back to the original folder and then the scroll position is perfect.
Also, it is not just happening with the Inbox. No. If I was viewing e.g. the Sent folder when I closed down Thunderbird. Then when I start Thunderbird again, it will show the Sent folder on startup as it correctly remembers the last folder viewed. But the scroll position is wrong there then, too. Just right after the startup, and only then.

tssajo, are you still seeing this?

Flags: needinfo?(tssajo)

Yes, I see it every time I launch Thunderbird. For months now. It is extremely annoying. I will create a video demoing the issue and post the link here, shortly. So you all can see it.
Thanks!

Here is the demo:

https://www.youtube.com/watch?v=FpGEBqVUJWk

I know, this is NOT the latest version of Thunderbird. In fact it is Betterbird 115.18.0-bb36 in the video.
However, this is exact same issue is present in Thunderbird 128.5 too!

Note: I won't leave this video up on Youtube for long. Only for a few days, so you guys can see what the actual issue is. Then I'll delete this video.
Thanks!

Flags: needinfo?(tssajo)

I was able to reproduce this for local folders in Thunderbird ESR 115, 128, etc.

When the last selected folder is restored at startup, messages in a local folder are loaded immediately (earlier than messages in an IMAP folder would be). When the view then scrolls to the bottom of the thread pane, it has to calculate the vertical size of the pane. For some reason, however, it gets exactly the same size as if the message pane were collapsed, whereas the pane splitter should already be expanded at this point, as debugging has shown.

A quick fix would be to delay scrolling for a tick by changing this line to setTimeout(() => window.threadPane.scrollToLatestRowIfNoSelection());, but I'm not so sure that's the best solution. Maybe Alex or Geoff have more insight.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(geoff)
Flags: needinfo?(alessandro)
Keywords: regression
Summary: Incorrect scrolling position in Inbox when Thunderbird starts → Incorrect scrolling position in local folder at startup

Thanks for investigating this and finding where the inconsistency happens.

I don't fully understand that whole stack, as I'm not really sure why we call window.threadPane.scrollToLatestRowIfNoSelection() only there but not for any other condition, or after we dispatch the "allMessagesLoaded" event.

My suggestion would be to check the stack trace of the thread loading and maybe find a better place for that method?

I don't know if this is a symptom of a more system issue, in which case Geoff might have better insights.

Flags: needinfo?(alessandro)

Thanks for commenting and therefore keeping this bug ticket active!
But when will this get fixed?
I reported this bug over 4 months ago.
I "experience" this issue every day for about half a year now. Note: I didn't report it right away hoping that someone else would also notice this regression and that the issue will be fixed soon. That didn't happen for a month or two so then I decided to report it, that was over 4 months ago.
It would be nice if this could get fixed in the next release! Thanks!

Thanks for investigating Hartmut. You've saved me a bunch of time trying things that are irrelevant.

Sorry it has taken a while tssajo, we are a very small team and don't have time to jump on every issue straight away, and we have been flat-out working on more serious issues.

It's happening because the resize observer watching for changes in the message list height is triggered after everything else happens (as that's how a ResizeObserver works). So the message list is using a stale cached value for its height (we cache it to avoid causing expensive layout calculation in other circumstances).

I see two potential ways around this:

Flags: needinfo?(geoff)
Assignee: nobody → geoff
Status: NEW → ASSIGNED
Target Milestone: --- → 136 Branch

Pushed by arschmitz@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/ef737872808c
Delay initial folder selection until resize observers have fired. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 23 days ago
Resolution: --- → FIXED

Comment on attachment 9459046 [details]
Bug 1917465 - Delay initial folder selection until resize observers have fired. r=#thunderbird-reviewers

[Approval Request Comment]
Regression caused by (bug #): unknown
User impact if declined: the message list scrolls to the wrong place on start-up
Testing completed (on c-c, etc.): landed over a week ago
Risk to taking this patch (and alternatives if risky): low

Attachment #9459046 - Flags: approval-comm-beta?

Comment on attachment 9459046 [details]
Bug 1917465 - Delay initial folder selection until resize observers have fired. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9459046 - Flags: approval-comm-beta? → approval-comm-beta+
See Also: → 1910940
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: