Conversation
|
||
* options | ||
* `String` label: the text displayed in the menuitem. | ||
* `Array` `Integer` or `String` menu: describes menu which the menuitem will live under. If a array is used then the first valid parent in the array will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posting my comment from bugzilla:
I think I would suggest to rephrase as follows:
Array of group constants that menu may be placed in. Note that menu item will appear only under one, most appropriate parent from the given options. Add-on's provides is given from left to right. This enables add-ons to handle different platforms in order of their preference (note not all groups will be available
on all platforms).I don't like that this property is string or number or array of them. I think it
should always be an array and instead of string or numbers we should expose constants with readable names representing different parent groups. This would
also align with identical approach in places API. This is also going to allow us
to start with just a few well thought out groups and later we may add more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erikvold Note sure if it slipped trough or if you disagree with my comment, but I'd like to know your opinion on this.
To elaborate about why I would like to always have array is to encourage users putting multiple items in it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we'll agree that context
proposed in #1214 is a good way to go, I think it would make a lot more sense to convert this to context as well. Not saying we have to, or that we should wait on resolution on the context
subject, it's just be prepared that we may have to adjust this later, unless you disagree in regards that context
here would make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I didn't like group, but I do like context so I'll make that change.
One general comment, in Navbar Buttons we do have notion of chained states. Here we don't seem to have that, maybe it does not makes sense or maybe it does make sense to have state differences across windows ? For example following a location bar button example if you are on a new tab page you don't get bookmark button because it's redundant (I guess it's on UX build because I see it on nightly), but also "Bookmarks > subscribe to this page" is disabled if I'm on tab without RSS feed, making me think that contextual state does in fact makes sense. |
If anyone asks for it then we can still add it, for now I'd like to avoid doing so. |
The reason being that I don't like how this was implemented in buttons, and you haven't weighed in on my proposed alternative in the mailing list yet, and ZER0 seems to be against it or doesn't understand it. |
|
||
var menuitem = Menuitem({ | ||
label: "Not Checked", | ||
menu: [ Menuitem.FILE_MENU, Menuitem.APP_MENU ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should expose constants as module exports to be consistent with places API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that in the docs you call this context
and here you call it menu
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gozala, could you point to an example about what you mean mentioning the Places API? From what you said it sounds like Place API are not consistent with all the rest of high level API we have in the SDK, but maybe I misunderstood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gozala, could you point to an example about what you mean mentioning the Places API? From what you said it sounds like Place API are not consistent with all the rest of high level API we have in the SDK, but maybe I misunderstood.
Both places API:
And indexed-db API:
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/modules/sdk/indexed-db.html
Export globals like this as regular exports. @ZER0 do you imply that some APIs export them as properties of
the constructor ? I don't seem to recall or see it to be a case.
That works for me, as far as I can see it will just work as navbar buttons global state, to which we will be able to add per window and per tab state support in next iterations. |
@erikvold I have not seen that alternative API I'm afraid. Again I think our JEP feedback loop was very broken. Let's don't go over it again, but now I think we have a process that hopefully will work, so let's use it! Please comment on To be honest I was pushing @ZER0 towards more FRP style API but was told that everyone hated it & current API seemed like a good compromise. Now all this aside, we do need to have a common API for dealing with this, if @erikvold you see issues with a current API please outline them so we can address (and it's almost if not already too late). Once we have settle |
@Gozala I'm starting to think that we should use Looking at the comments above it looks like you were not against using |
This is addressed in bug 912208 |
…`context` constructor option description
Bug 899434 Menuitem JEP r=@Gozala
* `String` label: the text displayed in the menuitem. | ||
* `Array` menu: describes menu which the menuitem will live under. In the array, the most appriopriate parent in the array will be used (likely the first in the array). | ||
* `Boolean` [diabled]: this should be `false` if you want the menuitem to be displayed and unclickable. | ||
* `Boolean` [visible]: this should be `false` if you want the menuitem to be hidden, default is `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is visible
really needed ? I would leave it out unless you're sure about it! We can always add it later too. Either way I think it would make sense to rename it to hidden
to be more consistent with disabled
.
No description provided.