Closed Bug 1498794 Opened 6 years ago Closed 6 years ago

[de-xbl] Migrate folderSummaryMessage to custom element.

Categories

(Thunderbird :: Mail Window Front End, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 65.0

People

(Reporter: arshad, Assigned: mkmelin)

References

Details

(Whiteboard: [fixed by bug 1497544])

Attachments

(1 file, 2 obsolete files)

https://searchfox.org/comm-central/source/mail/base/content/mailWidgets.xml#2401
Assignee: nobody → arshdkhn1
Status: NEW → ASSIGNED
Attached patch foldersummarymessage.patch (obsolete) (deleted) β€” β€” Splinter Review
Attachment #9016946 - Flags: review?(mkmelin+mozilla)
how do i inspect a the tree element?
I don't think they are inspectable.
Comment on attachment 9016946 [details] [diff] [review]
foldersummarymessage.patch

Review of attachment 9016946 [details] [diff] [review]:
-----------------------------------------------------------------

Unfortunately this doesn't work. The popup is completely missing all text. 
I don't get any errors anywhere.

::: mail/base/content/mailWidgets.js
@@ +152,5 @@
> +    this._senderLabel.classList.add("folderSummary-sender");
> +    this._senderLabel.setAttribute("crop", "right");
> +
> +    this._springElement = document.createElement("spring");
> +    this._springElement.setAttribute("flex", "100%");

Looks like <spring> has been dropped a long long time ago (in favour of <spacer>). 
Is it possible to just remove this?

@@ +168,5 @@
> +
> +    this.appendChild(vbox);
> +
> +    ChromeUtils.import("resource:///modules/MailUtils.jsm");
> +    ChromeUtils.import("resource://gre/modules/Services.jsm", this);

odd place to import, and MailUtils are used already in the constructor. 
I suggest to move these to the top of the file.

For the Services one, don't import it into the this scope but use the global scope

@@ +170,5 @@
> +
> +    ChromeUtils.import("resource:///modules/MailUtils.jsm");
> +    ChromeUtils.import("resource://gre/modules/Services.jsm", this);
> +
> +    if (!this.Services.prefs.getBoolPref("mail.biff.alert.show_preview")) {

so the this. would go here

@@ +195,5 @@
> +
> +  _updateAttributes() {
> +    if (
> +      !this._subjectLabel || !this._senderLabel || !this._springElement || !this._previewDescription
> +    ) {

odd formatting. please make it

    if (!this._subjectLabel || !this._senderLabel || !this._springElement ||
        !this._previewDescription) {
       return;
    }
Attachment #9016946 - Flags: review?(mkmelin+mozilla) → review-
Attached patch foldersummarymessage.patch (obsolete) (deleted) β€” β€” Splinter Review
Attachment #9016946 - Attachment is obsolete: true
Attached patch foldersummarymessage.patch (deleted) β€” β€” Splinter Review
hey can you please check this out? I am not able to debug the patch but i think it will work this time. :(
Attachment #9018553 - Attachment is obsolete: true
Attachment #9018588 - Flags: feedback?(mkmelin+mozilla)
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=d964e9f9e0c2fa8ea8590d7d2717b8ef42031099
Comment on attachment 9018588 [details] [diff] [review]
foldersummarymessage.patch

Review of attachment 9018588 [details] [diff] [review]:
-----------------------------------------------------------------

Doesn't work actually, since for this "window" we don't get the DOMWindowCreated event, and thus custom elements don't get loaded. Dunno why.

Anyway, that could be worked around by simply adding this widget script to the window scripts. 
However, I started looking more closely on this overall (the folderSummary* xbl) and it's a huge mess. I'm going to look into making this sane at the same time with folderSummary.
Attachment #9018588 - Flags: feedback?(mkmelin+mozilla)
Assignee: arshdkhn1 → mkmelin+mozilla
Status: ASSIGNED → NEW
Fixed by bug 1504088. Not a custom element but just a function to create the xul for the message.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [fixed by bug 1504088]
Target Milestone: --- → Thunderbird 65.0
I meant bug 1497544
Whiteboard: [fixed by bug 1504088] → [fixed by bug 1497544]
Type: enhancement → task
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: