Closed Bug 1902549 Opened 1 year ago Closed 1 year ago

Right-clicking on an unselected message causes it to be selected, in a synthetic view

Categories

(Thunderbird :: Folder and Message Lists, defect)

Thunderbird 115
defect

Tracking

(thunderbird_esr115 wontfix, thunderbird128? fixed)

RESOLVED FIXED
129 Branch
Tracking Status
thunderbird_esr115 --- wontfix
thunderbird128 ? fixed

People

(Reporter: darktrojan, Assigned: darktrojan)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 3 obsolete files)

Because synthetic views aren't real, saving the selection does nothing, then when the context menu closes and the selection restored nothing happens and the temporary selection (for the context menu) becomes permanent.

Fortunately because synthetic views live in their own tab we can hack the selection saving mechanism to fix this.

Attachment #9407416 - Attachment description: WIP: Bug 1902549 - Fix saving and restoring the selection of a synthetic view. → Bug 1902549 - Fix saving and restoring the selection of a synthetic view. r=#thunderbird-reviewers

This is somehow just as fast, if we ignore a bunch of notifications about the data changing while
restoring the selection. FindIndexOfMsgHdr behaves very differently to FindIndexFromKey which
causes the notifications.

Summary: Right-clicking on an unselected message causes it to be selected, in a synthetic view → Right-clicking on an unselected message causes it to be selected, in a synthetic view or cross-folder virtual folder

Is this something you think should go in 128? If so please add the needed tracking flag.
Also is this change "safe" at this stage so close to ESR? Do you think there might be some unknown regressions due to these changes?
As you probably guessed, I'm being annoying and paranoid.

The first patch is pretty safe. The second is a bit more risky but with a few weeks of beta scrutiny (especially at this time of year) it should be okay. I was about to upgrade a test for it, but first I need to repair the test.

JFYI: Saving the message headers directly seems to work as well and may be a little less complicated. Apparently this takes just as much time and memory as saving message URIs, but doesn't expand previously selected threads when restoring. (I wrote most of this some time ago but had hoped that the new global message db would make this unnecessary.)

Attachment #9407511 - Attachment is obsolete: true

(In reply to Hartmut Welpmann [:welpy-cw] from comment #5)

Apparently this takes just as much time and memory as saving message URIs, but doesn't expand previously selected threads when restoring.

Actually the expansion of threads has nothing to do with URIs vs. headers, there was some fiddling needed to get this (apparently) right ...

I used keys (and now URIs) because I don't want to keep references to objects. What's in the Map could remain there for the rest of the session, and if it's one or more header objects, that prevents a bunch of stuff from being garbage collected. (Like a memory leak, but on purpose.) Knowing our code they're probably not collected anyway, but there's no need to make it worse.

Blocks: tb128found

Let's ship the first patch and I'll move the others to a different bug.

Target Milestone: --- → 129 Branch
Blocks: 1903910
Summary: Right-clicking on an unselected message causes it to be selected, in a synthetic view or cross-folder virtual folder → Right-clicking on an unselected message causes it to be selected, in a synthetic view

Comment on attachment 9407442 [details]
Bug 1902549 - When saving the selection, use message URIs instead of keys. r=#thunderbird-reviewers

Revision D213727 was moved to bug 1903910. Setting attachment 9407442 [details] to obsolete.

Attachment #9407442 - Attachment is obsolete: true

Comment on attachment 9407805 [details]
Bug 1902549 - Add cross-folder virtual folders to browser_mailContext.js. r=#thunderbird-reviewers

Revision D213916 was moved to bug 1903910. Setting attachment 9407805 [details] to obsolete.

Attachment #9407805 - Attachment is obsolete: true

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/031b2780f9e0
Fix saving and restoring the selection of a synthetic view. r=freaktechnik

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

Comment on attachment 9407416 [details]
Bug 1902549 - Fix saving and restoring the selection of a synthetic view. r=#thunderbird-reviewers

[Approval Request Comment]
Regression caused by (bug #): supernova
User impact if declined: papercut, selection isn't restored properly after a right-click in rare circumstances
Testing completed (on c-c, etc.): on c-c 3 days
Risk to taking this patch (and alternatives if risky): low

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

Comment on attachment 9407416 [details]
Bug 1902549 - Fix saving and restoring the selection of a synthetic view. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9407416 - Flags: approval-comm-beta? → approval-comm-beta+
Version: unspecified → Thunderbird 115
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: