Closed Bug 1538547 Opened 6 years ago Closed 5 years ago

[de-xbl] remove badgebutton binding

Categories

(Thunderbird :: Instant Messaging, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 69.0

People

(Reporter: mkmelin, Assigned: khushil324)

References

Details

(Whiteboard: [Thunderbird-testfailure: Z all][Thunderbird-disabled-test])

Attachments

(1 file, 2 obsolete files)

The badgebutton binding looks to me like it's redundant.
It is mapped to one toobarbutton #button-chat

https://searchfox.org/comm-central/source/mail/components/im/content/badgebutton.xml#13

I think all the styling can be just done on the toolbar button.

The functionality of updating the label is only called in (maybe) on place, https://searchfox.org/comm-central/rev/47187196fbf02cc0d635371b3879ddf5a49f491c/mail/components/im/content/chat-messenger.js#325

I think we should convert it to Custom Element, it will be fairly simple. What do you suggest?

I think in this case it's not needed. None of the other toolbar buttons are custom elements. Since it's so little functionality, I'd check if we can't just handle this from the outside.

It should be just removing the binding, adjusting the css slightly, and then the setting of the count. Essentially.

Okay, Sure. I will do that and make a patch.

We should wait for bug 1538983 which will make it easier and more clear what to do.

Depends on: 1538983

Bug 1519577 is the new thing to track. Bug 1538983 only converted normal buttons.

Depends on: 1519577
No longer depends on: 1538983
Type: enhancement → task

I'll have to disable mozmill/im/test-toolbar-buttons.js | test-toolbar-buttons.js::test_toolbar_and_placeholder

Keywords: leave-open
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/5ee712009254 temporarily disable test-toolbar-buttons.js::test_toolbar_and_placeholder. rs=bustage-fix
Whiteboard: [Thunderbird-testfailure: Z all][Thunderbird-disabled-test]
Attachment #9067531 - Flags: review?(mkmelin+mozilla)
Attachment #9067531 - Attachment is obsolete: true
Attachment #9067531 - Flags: review?(mkmelin+mozilla)
Attachment #9067579 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9067579 [details] [diff] [review] Bug-1538547_de-xbl_chat-badgebutton.patch Review of attachment 9067579 [details] [diff] [review]: ----------------------------------------------------------------- This doesn't atm use very similar structure as the MozToolbarbutton. Would it be possible to make it that? I mean, possibly even just let it add the fragment, and override render() to add our label? Maybe also just badgeCount as an observed attribute?
Comment on attachment 9067579 [details] [diff] [review] Bug-1538547_de-xbl_chat-badgebutton.patch Review of attachment 9067579 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/components/im/content/toolbarbutton-badge-button.js @@ +20,5 @@ > + */ > + class MozBadgebutton extends customElements.get("toolbarbutton") { > + static get inheritedAttributes() { > + return { > + ...super.inheritedAttributes, for instance, these would not be working properly since there is too much changed structure compared to the parent
Attachment #9067579 - Flags: review?(mkmelin+mozilla)

(In reply to Magnus Melin [:mkmelin] from comment #10)

This doesn't atm use very similar structure as the MozToolbarbutton.
Would it be possible to make it that? I mean, possibly even just let it add
the fragment, and override render() to add our label?

Maybe also just badgeCount as an observed attribute?

I don't think that it is possible like toolbarbutton-menu-button because we want a badge over the image. In toolbarbutton-menu-button, we are adding a dropmarker besides the toolbarbutton. We can have a badge over the whole toolbarbutton but it will not look good in terms of UI/UX.

Attachment #9067579 - Attachment is obsolete: true
Attachment #9069648 - Flags: review?(mkmelin+mozilla)
Status: NEW → ASSIGNED
Comment on attachment 9069648 [details] [diff] [review] Bug-1538547_de-xbl_chat-badgebutton.patch Sorry for stealing this. As far as I can see, this works and it's also like a cook-cutting exercise. It also fixes bug 1555136 which seems to come from some "refresh" issue due to a mix of XBL code removed here and the already de-XBL'ed other parts. The test passes, too, so I'll enable it.
Attachment #9069648 - Flags: review+
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/f6f0c189c55a [de-xbl] convert badgebutton binding to custom element. r=jorgk
Target Milestone: --- → Thunderbird 69.0
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Keywords: leave-open
Resolution: --- → FIXED
Attachment #9069648 - Flags: review?(mkmelin+mozilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: