maildev@lists.thunderbird.net

Thunderbird email developers

View all threads

Using insertItem to move item from toolbar palette to toolbar no longer works, what is replacement?

JK
Jonathan Kamens
Sun, Apr 28, 2019 7:42 PM

One of my add-ons adds a button to a toolbar palette in XUL. Then in
code, it checks if that button has been added to the corresponding
toolbar, and if not, then it calls insertItem on the toolbar to add the
button, specifying the ID of the button.

This broke some time in the past few days, insertItem is no longer a
function on the toolbar object.

What should I do instead?

I tried to figure out how to use insertBefore, but that requires that I
specify the actual button that I want to add, not its ID. I don't know
how to get the button, since it's not actually in the document. It's in
the palette, whose children do not show up in searches done with
document.getElementById.

I've done a bit of searching and I can't figure out how to access the
palette from my JavaScript code.

I could take the button out of my XUL and construct it manually in my
JavaScript, but I'd rather avoid that if possible.

Suggestions?

Thanks,

Jonathan Kamens

One of my add-ons adds a button to a toolbar palette in XUL. Then in code, it checks if that button has been added to the corresponding toolbar, and if not, then it calls insertItem on the toolbar to add the button, specifying the ID of the button. This broke some time in the past few days, insertItem is no longer a function on the toolbar object. What should I do instead? I tried to figure out how to use insertBefore, but that requires that I specify the actual button that I want to add, not its ID. I don't know how to get the button, since it's not actually in the document. It's in the palette, whose children do not show up in searches done with document.getElementById. I've done a bit of searching and I can't figure out how to access the palette from my JavaScript code. I could take the button out of my XUL and construct it manually in my JavaScript, but I'd rather avoid that if possible. Suggestions? Thanks, Jonathan Kamens
JK
Jonathan Kamens
Mon, Apr 29, 2019 7:12 PM

Update: the problem isn't that insertItem no longer exists for toolbars.
The problem is that folderPane-toolbar is no longer a toolbar. Geoff
decided that having it be a toolbar "provides no benefit over <hbox>
https://hg.mozilla.org/comm-central/rev/3bdcf6d1a44527cdef3f0d953e0ce722d8f73c6c".
I guess the ability of add-on maintainers to provide optional
customizations for it using the standard toolbar palette / customization
mechanism is not considered a benefit?

Anyway, I've updated my add-on to reflect this change, but I can't say I
entirely agree with it.

  jik

On 4/28/19 3:42 PM, Jonathan Kamens wrote:

One of my add-ons adds a button to a toolbar palette in XUL. Then in
code, it checks if that button has been added to the corresponding
toolbar, and if not, then it calls insertItem on the toolbar to add
the button, specifying the ID of the button.

This broke some time in the past few days, insertItem is no longer a
function on the toolbar object.

What should I do instead?

I tried to figure out how to use insertBefore, but that requires that
I specify the actual button that I want to add, not its ID. I don't
know how to get the button, since it's not actually in the document.
It's in the palette, whose children do not show up in searches done
with document.getElementById.

I've done a bit of searching and I can't figure out how to access the
palette from my JavaScript code.

I could take the button out of my XUL and construct it manually in my
JavaScript, but I'd rather avoid that if possible.

Suggestions?

Thanks,

Jonathan Kamens

Update: the problem isn't that insertItem no longer exists for toolbars. The problem is that folderPane-toolbar is no longer a toolbar. Geoff decided that having it be a toolbar "provides no benefit over <hbox> <https://hg.mozilla.org/comm-central/rev/3bdcf6d1a44527cdef3f0d953e0ce722d8f73c6c>". I guess the ability of add-on maintainers to provide optional customizations for it using the standard toolbar palette / customization mechanism is not considered a benefit? Anyway, I've updated my add-on to reflect this change, but I can't say I entirely agree with it.   jik On 4/28/19 3:42 PM, Jonathan Kamens wrote: > > One of my add-ons adds a button to a toolbar palette in XUL. Then in > code, it checks if that button has been added to the corresponding > toolbar, and if not, then it calls insertItem on the toolbar to add > the button, specifying the ID of the button. > > This broke some time in the past few days, insertItem is no longer a > function on the toolbar object. > > What should I do instead? > > I tried to figure out how to use insertBefore, but that requires that > I specify the actual button that I want to add, not its ID. I don't > know how to get the button, since it's not actually in the document. > It's in the palette, whose children do not show up in searches done > with document.getElementById. > > I've done a bit of searching and I can't figure out how to access the > palette from my JavaScript code. > > I could take the button out of my XUL and construct it manually in my > JavaScript, but I'd rather avoid that if possible. > > Suggestions? > > Thanks, > > Jonathan Kamens > >
JB
John Bieling
Mon, Apr 29, 2019 7:43 PM

Jonathan, can you describe what type of customization is now no longer
possible? Is it, that hat the user no longer can decide, what icons he
wants to have in that toolbar?

Thanks,
John

On 29.04.2019 21:12, Jonathan Kamens via Maildev wrote:

Update: the problem isn't that insertItem no longer exists for
toolbars. The problem is that folderPane-toolbar is no longer a
toolbar. Geoff decided that having it be a toolbar "provides no
benefit over <hbox>
https://hg.mozilla.org/comm-central/rev/3bdcf6d1a44527cdef3f0d953e0ce722d8f73c6c".
I guess the ability of add-on maintainers to provide optional
customizations for it using the standard toolbar palette /
customization mechanism is not considered a benefit?

Anyway, I've updated my add-on to reflect this change, but I can't say
I entirely agree with it.

  jik

On 4/28/19 3:42 PM, Jonathan Kamens wrote:

One of my add-ons adds a button to a toolbar palette in XUL. Then in
code, it checks if that button has been added to the corresponding
toolbar, and if not, then it calls insertItem on the toolbar to add
the button, specifying the ID of the button.

This broke some time in the past few days, insertItem is no longer a
function on the toolbar object.

What should I do instead?

I tried to figure out how to use insertBefore, but that requires that
I specify the actual button that I want to add, not its ID. I don't
know how to get the button, since it's not actually in the document.
It's in the palette, whose children do not show up in searches done
with document.getElementById.

I've done a bit of searching and I can't figure out how to access the
palette from my JavaScript code.

I could take the button out of my XUL and construct it manually in my
JavaScript, but I'd rather avoid that if possible.

Suggestions?

Thanks,

Jonathan Kamens

Jonathan, can you describe what type of customization is now no longer possible? Is it, that hat the user no longer can decide, what icons he wants to have in that toolbar? Thanks, John On 29.04.2019 21:12, Jonathan Kamens via Maildev wrote: > > Update: the problem isn't that insertItem no longer exists for > toolbars. The problem is that folderPane-toolbar is no longer a > toolbar. Geoff decided that having it be a toolbar "provides no > benefit over <hbox> > <https://hg.mozilla.org/comm-central/rev/3bdcf6d1a44527cdef3f0d953e0ce722d8f73c6c>". > I guess the ability of add-on maintainers to provide optional > customizations for it using the standard toolbar palette / > customization mechanism is not considered a benefit? > > Anyway, I've updated my add-on to reflect this change, but I can't say > I entirely agree with it. > >   jik > > On 4/28/19 3:42 PM, Jonathan Kamens wrote: >> >> One of my add-ons adds a button to a toolbar palette in XUL. Then in >> code, it checks if that button has been added to the corresponding >> toolbar, and if not, then it calls insertItem on the toolbar to add >> the button, specifying the ID of the button. >> >> This broke some time in the past few days, insertItem is no longer a >> function on the toolbar object. >> >> What should I do instead? >> >> I tried to figure out how to use insertBefore, but that requires that >> I specify the actual button that I want to add, not its ID. I don't >> know how to get the button, since it's not actually in the document. >> It's in the palette, whose children do not show up in searches done >> with document.getElementById. >> >> I've done a bit of searching and I can't figure out how to access the >> palette from my JavaScript code. >> >> I could take the button out of my XUL and construct it manually in my >> JavaScript, but I'd rather avoid that if possible. >> >> Suggestions? >> >> Thanks, >> >> Jonathan Kamens >> >> > > _______________________________________________ > Maildev mailing list > Maildev@lists.thunderbird.net > http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net
JK
Jörg Knobloch
Mon, Apr 29, 2019 8:08 PM

On 29/04/2019 21:12, Jonathan Kamens via Maildev wrote:

Update: the problem isn't that insertItem no longer exists for toolbars. The problem is that folderPane-toolbar is no longer a toolbar. Geoff decided that having it be a toolbar "provides no benefit over <hbox>". I guess the ability of add-on maintainers to provide optional customizations for it using the standard toolbar palette / customization mechanism is not considered a benefit?

Anyway, I've updated my add-on to reflect this change, but I can't say I entirely agree with it.

Hmm, I understand that some "crazy" toolbars got removed, like the "Folder Pane Toolbar" where the "All Folders", "Unread Folders", ..., "Unified Folders" can be selected. This area shouldn't really be customised, however you could before that change. Other toolbars were converted, too.

A little unfortunate that it's still called "View > Toolbars > Folder Pane Toolbar" when it is now a "Folder Pane Selector".

Jörg.

JK
Jonathan Kamens
Mon, Apr 29, 2019 8:21 PM

On 4/29/19 3:43 PM, John Bieling wrote:

Jonathan, can you describe what type of customization is now no longer
possible? Is it, that hat the user no longer can decide, what icons he
wants to have in that toolbar?

Yes.

On 4/29/19 3:43 PM, John Bieling wrote: > Jonathan, can you describe what type of customization is now no longer > possible? Is it, that hat the user no longer can decide, what icons he > wants to have in that toolbar? Yes.
JK
Jonathan Kamens
Mon, Apr 29, 2019 8:21 PM

On 4/29/19 4:08 PM, Jörg Knobloch wrote:

On 29/04/2019 21:12, Jonathan Kamens via Maildev wrote:

Update: the problem isn't that insertItem no longer exists for
toolbars. The problem is that folderPane-toolbar is no longer a
toolbar. Geoff decided that having it be a toolbar "provides no
benefit over <hbox>
https://hg.mozilla.org/comm-central/rev/3bdcf6d1a44527cdef3f0d953e0ce722d8f73c6c".
I guess the ability of add-on maintainers to provide optional
customizations for it using the standard toolbar palette /
customization mechanism is not considered a benefit?

Anyway, I've updated my add-on to reflect this change, but I can't
say I entirely agree with it.

Hmm, I understand that some "crazy" toolbars got removed, like the
"Folder Pane Toolbar" where the "All Folders", "Unread Folders", ...,
"Unified Folders" can be selected. This area shouldn't really be
customised,

Why not?

On 4/29/19 4:08 PM, Jörg Knobloch wrote: > On 29/04/2019 21:12, Jonathan Kamens via Maildev wrote: >> >> Update: the problem isn't that insertItem no longer exists for >> toolbars. The problem is that folderPane-toolbar is no longer a >> toolbar. Geoff decided that having it be a toolbar "provides no >> benefit over <hbox> >> <https://hg.mozilla.org/comm-central/rev/3bdcf6d1a44527cdef3f0d953e0ce722d8f73c6c>". >> I guess the ability of add-on maintainers to provide optional >> customizations for it using the standard toolbar palette / >> customization mechanism is not considered a benefit? >> >> Anyway, I've updated my add-on to reflect this change, but I can't >> say I entirely agree with it. >> > Hmm, I understand that some "crazy" toolbars got removed, like the > "Folder Pane Toolbar" where the "All Folders", "Unread Folders", ..., > "Unified Folders" can be selected. This area shouldn't really be > customised, > Why not?
A
ace
Mon, Apr 29, 2019 8:25 PM

Dňa 29. 4. 2019 o 22:08 Jörg Knobloch napísal(a):

Anyway, I've updated my add-on to reflect this change, but I can't say
I entirely agree with it.

Hmm, I understand that some "crazy" toolbars got removed, like the
"Folder Pane Toolbar" where the "All Folders", "Unread Folders", ...,
"Unified Folders" can be selected. This area shouldn't really be
customised, however you could before that change. Other toolbars were
converted, too.

A little unfortunate that it's still called "View > Toolbars > Folder
Pane Toolbar" when it is now a "Folder Pane Selector".

Jörg.

I myself do not understand that change and feature removal. And I
published it in the bug
(https://bugzilla.mozilla.org/show_bug.cgi?id=1535265). It seems to me
to be just a random undiscussed decision without any technical necessity
(toolbar support itself isn't going away yet).

And I hope that some "Folder Pane Selector" (that toggles the folder
modes) ISN'T now hardcoded in place of the customizable toolbar over the
folder pane.

Dňa 29. 4. 2019 o 22:08 Jörg Knobloch napísal(a): >> Anyway, I've updated my add-on to reflect this change, but I can't say >> I entirely agree with it. >> > Hmm, I understand that some "crazy" toolbars got removed, like the > "Folder Pane Toolbar" where the "All Folders", "Unread Folders", ..., > "Unified Folders" can be selected. This area shouldn't really be > customised, however you could before that change. Other toolbars were > converted, too. > > A little unfortunate that it's still called "View > Toolbars > Folder > Pane Toolbar" when it is now a "Folder Pane Selector". > > Jörg. I myself do not understand that change and feature removal. And I published it in the bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1535265). It seems to me to be just a random undiscussed decision without any technical necessity (toolbar support itself isn't going away yet). And I hope that some "Folder Pane Selector" (that toggles the folder modes) ISN'T now hardcoded in place of the customizable toolbar over the folder pane.
T
Tanstaafl
Mon, Apr 29, 2019 8:35 PM

On Mon Apr 29 2019 16:21:45 GMT-0400 (Eastern Standard Time), Jonathan
Kamens via Maildev maildev@lists.thunderbird.net wrote:

On 4/29/19 4:08 PM, Jörg Knobloch wrote:

Hmm, I understand that some "crazy" toolbars got removed, like the
"Folder Pane Toolbar" where the "All Folders", "Unread Folders", ...,
"Unified Folders" can be selected. This area shouldn't really be
customised,

Why not?

I agree... Why not?

I would love to be able to customize that view to make it much easier to
switch between the only 2 or 3 I need. I have zero need for any of the
'Compact' views, so they just get in t he way (I'd like to be able to
remove/hide them).

I'd also love to be able to create/add custom Views...

See these bugs for some of what I'm talking about:

Bring back folder pane view arrows for Unified Folders, but as an option
bug 1164818 - https://bugzilla.mozilla.org/show_bug.cgi?id=1164818

Allow 'Pinning' (and re-ordering) one or more 'Folder Views' to the top
of the Folder Pane
bug 1163555 - https://bugzilla.mozilla.org/show_bug.cgi?id=1163555

Allow customization of choices in View > Folders (Unified Folders) - bug
1159713 - https://bugzilla.mozilla.org/show_bug.cgi?id=1159713

On Mon Apr 29 2019 16:21:45 GMT-0400 (Eastern Standard Time), Jonathan Kamens via Maildev <maildev@lists.thunderbird.net> wrote: > On 4/29/19 4:08 PM, Jörg Knobloch wrote: >> Hmm, I understand that some "crazy" toolbars got removed, like the >> "Folder Pane Toolbar" where the "All Folders", "Unread Folders", ..., >> "Unified Folders" can be selected. This area shouldn't really be >> customised, > Why not? I agree... Why not? I would love to be able to customize that view to make it much easier to switch between the only 2 or 3 I need. I have zero need for any of the 'Compact' views, so they just get in t he way (I'd like to be able to remove/hide them). I'd also love to be able to create/add custom Views... See these bugs for some of what I'm talking about: Bring back folder pane view arrows for Unified Folders, but as an option bug 1164818 - https://bugzilla.mozilla.org/show_bug.cgi?id=1164818 Allow 'Pinning' (and re-ordering) one or more 'Folder Views' to the top of the Folder Pane bug 1163555 - https://bugzilla.mozilla.org/show_bug.cgi?id=1163555 Allow customization of choices in View > Folders (Unified Folders) - bug 1159713 - https://bugzilla.mozilla.org/show_bug.cgi?id=1159713
JK
Jonathan Kamens
Tue, Apr 30, 2019 2:09 AM

It is absolutely possible for an add-on to add custom views. When the
rewrite was done that yielded the current folder pane, pluggable
extensibility was baked into the rewrite on purpose.

Regarding customizing the view to make it much easier to switch between
the only 2 or 3 you need, look at my Folder Pane View Switcher add-on,
which does exactly that (that's what I was trying to fix in the
discussion yesterday and today).

  jik

On 4/29/19 4:35 PM, Tanstaafl wrote:

On Mon Apr 29 2019 16:21:45 GMT-0400 (Eastern Standard Time), Jonathan
Kamens via Maildev maildev@lists.thunderbird.net wrote:

On 4/29/19 4:08 PM, Jörg Knobloch wrote:

Hmm, I understand that some "crazy" toolbars got removed, like the
"Folder Pane Toolbar" where the "All Folders", "Unread Folders", ...,
"Unified Folders" can be selected. This area shouldn't really be
customised,

Why not?

I agree... Why not?

I would love to be able to customize that view to make it much easier to
switch between the only 2 or 3 I need. I have zero need for any of the
'Compact' views, so they just get in t he way (I'd like to be able to
remove/hide them).

I'd also love to be able to create/add custom Views...

See these bugs for some of what I'm talking about:

Bring back folder pane view arrows for Unified Folders, but as an option
bug 1164818 - https://bugzilla.mozilla.org/show_bug.cgi?id=1164818

Allow 'Pinning' (and re-ordering) one or more 'Folder Views' to the top
of the Folder Pane
bug 1163555 - https://bugzilla.mozilla.org/show_bug.cgi?id=1163555

Allow customization of choices in View > Folders (Unified Folders) - bug
1159713 - https://bugzilla.mozilla.org/show_bug.cgi?id=1159713


Maildev mailing list
Maildev@lists.thunderbird.net
http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net

It is absolutely possible for an add-on to add custom views. When the rewrite was done that yielded the current folder pane, pluggable extensibility was baked into the rewrite on purpose. Regarding customizing the view to make it much easier to switch between the only 2 or 3 you need, look at my Folder Pane View Switcher add-on, which does exactly that (that's what I was trying to fix in the discussion yesterday and today).   jik On 4/29/19 4:35 PM, Tanstaafl wrote: > On Mon Apr 29 2019 16:21:45 GMT-0400 (Eastern Standard Time), Jonathan > Kamens via Maildev <maildev@lists.thunderbird.net> wrote: >> On 4/29/19 4:08 PM, Jörg Knobloch wrote: >>> Hmm, I understand that some "crazy" toolbars got removed, like the >>> "Folder Pane Toolbar" where the "All Folders", "Unread Folders", ..., >>> "Unified Folders" can be selected. This area shouldn't really be >>> customised, >> Why not? > I agree... Why not? > > I would love to be able to customize that view to make it much easier to > switch between the only 2 or 3 I need. I have zero need for any of the > 'Compact' views, so they just get in t he way (I'd like to be able to > remove/hide them). > > I'd also love to be able to create/add custom Views... > > See these bugs for some of what I'm talking about: > > Bring back folder pane view arrows for Unified Folders, but as an option > bug 1164818 - https://bugzilla.mozilla.org/show_bug.cgi?id=1164818 > > Allow 'Pinning' (and re-ordering) one or more 'Folder Views' to the top > of the Folder Pane > bug 1163555 - https://bugzilla.mozilla.org/show_bug.cgi?id=1163555 > > Allow customization of choices in View > Folders (Unified Folders) - bug > 1159713 - https://bugzilla.mozilla.org/show_bug.cgi?id=1159713 > > _______________________________________________ > Maildev mailing list > Maildev@lists.thunderbird.net > http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net >
MM
Magnus Melin
Tue, Apr 30, 2019 7:21 AM

On 29-04-2019 23:21, Jonathan Kamens via Maildev wrote:

Hmm, I understand that some "crazy" toolbars got removed, like the
"Folder Pane Toolbar" where the "All Folders", "Unread Folders", ...,
"Unified Folders" can be selected. This area shouldn't really be
customised,

Why not?

The removed customization of these toolbars (now hboxes) is really about
user-facing customizability of them. Add-ons can adjust the code to make
it work like before. We had a huge amount of these kind of toolbars that
were customizable toolbars just because. In practice, there was not much
or anything you could reasonably customize there.

Our toolbar customization code has unfortunately diverged pretty far
from what Firefox has at the moment. I think we should move in that
direction, and having random customization support makes that pretty
hard to support. Another angle is that defaults are really powerful -
most users don't customize at all I'd bet. So if there are features that
should be on the toolbars by default we should add them there, and not
avoid the issue by saying people can customize it to their liking. Sure,
everybody don't want the exact same setup, but most users will just get
a sub-par experience if the defaults aren't what they are should be.

 -Magnus

On 29-04-2019 23:21, Jonathan Kamens via Maildev wrote: >> >> Hmm, I understand that some "crazy" toolbars got removed, like the >> "Folder Pane Toolbar" where the "All Folders", "Unread Folders", ..., >> "Unified Folders" can be selected. This area shouldn't really be >> customised, >> > Why not? The removed customization of these toolbars (now hboxes) is really about user-facing customizability of them. Add-ons can adjust the code to make it work like before. We had a huge amount of these kind of toolbars that were customizable toolbars just because. In practice, there was not much or anything you could reasonably customize there. Our toolbar customization code has unfortunately diverged pretty far from what Firefox has at the moment. I think we should move in that direction, and having random customization support makes that pretty hard to support. Another angle is that defaults are really powerful - most users don't customize at all I'd bet. So if there are features that should be on the toolbars by default we should add them there, and not avoid the issue by saying people can customize it to their liking. Sure, everybody don't want the exact same setup, but most users will just get a sub-par experience if the defaults aren't what they are should be.  -Magnus