Last Comment Bug 512882 - Create new option scheme for add-ons
: Create new option scheme for add-ons
Status: VERIFIED FIXED
:
Product: Fennec Graveyard
Classification: Graveyard
Component: General (show other bugs)
: Trunk
: x86 Linux
: -- normal with 1 vote (vote)
: ---
Assigned To: Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
:
Mentors:
Depends on:
Blocks: 491601
  Show dependency treegraph
 
Reported: 2009-08-26 20:22 PDT by Mark Finkle (:mfinkle) (use needinfo?)
Modified: 2013-12-10 09:59 PST (History)
8 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch (9.78 KB, patch)
2009-08-27 08:55 PDT, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
mark.finkle: review-
Details | Diff | Splinter Review
screenshot (72.30 KB, image/png)
2009-08-27 09:01 PDT, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
no flags Details
Patch v0.2 (28.72 KB, patch)
2009-08-28 06:17 PDT, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
mark.finkle: review-
Details | Diff | Splinter Review
screenshot (73.43 KB, image/png)
2009-08-28 06:18 PDT, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
no flags Details
Patch v0.3 (29.41 KB, patch)
2009-09-03 08:50 PDT, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
mark.finkle: review+
Details | Diff | Splinter Review

Description Mark Finkle (:mfinkle) (use needinfo?) 2009-08-26 20:22:53 PDT
Fennec currently has an <iframe> that is used to display the <optionsURL> of an add-on. This fails for so many reasons:
* Sizing failure1: the option XUL is very like not to fit inside the iframe
* Sizing failure2: the iframe has a hard time resiing itself to fit the content, even if it is small enough to see on the screen.
* The UI look and feel for options in Fennec is broken by using random XUL

Therefore we need a new way to display options for an addon:
* No iframe. We will add the contents directly to the add-ons manager.
* <richpref> widgets only. We want the add-on options to look like other Fennec options.
* Less is more. We want to encourage add-on developers to re-think the options exposed by their add-ons when developing for Fennec.

The details:
* Add-ons will override, via chrome manifest, the optionsURL they use for Firefox when installing into Fennec
* Fennec will expect a valid snippet of XUL, built using <richpref>, in the optionsURL file
* Fennec will use XHR to load the XUL and append it to the add-on manager row item, inside an <xul:vbox>.

The result should be a list of options that look like Fennec options and are still pannable in the add-ons list. The nsPromptService patch uses XHR to load "dialogs" the same way I am suggesting we load the options list.
Comment 1 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2009-08-27 08:55:49 PDT
Created attachment 397014 [details] [diff] [review]
Patch

I've add a 'richtitle' binding to allow extensions's developers to separate their sections (as we do).
Comment 2 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2009-08-27 09:01:35 PDT
Created attachment 397015 [details]
screenshot
Comment 3 Mark Finkle (:mfinkle) (use needinfo?) 2009-08-27 19:42:02 PDT
Comment on attachment 397014 [details] [diff] [review]
Patch

Looks like you can remove _optionsHandler altogether. The only part of it you still use is .box and you can just make that a field on the binding itself.

Also, let's get Madhava to see if he wants to somehow visually show that the listed options are "part" of the add-on. Right now you really can't tell that the options are associated with the add-on.

Great job!
Comment 4 Mark Finkle (:mfinkle) (use needinfo?) 2009-08-27 19:43:12 PDT
Oh, now I really want to change "richpref" -> "setting" :)
Comment 5 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2009-08-28 05:39:35 PDT
(In reply to comment #3)
> Also, let's get Madhava to see if he wants to somehow visually show that the
> listed options are "part" of the add-on. Right now you really can't tell that
> the options are associated with the add-on.

yes, we have discussed about that with Madhava yesterday on IRC (not sure that only read Madhava's thoughts and say yes to all his suggestions is really a discussion :))

(In reply to comment #4)
> Oh, now I really want to change "richpref" -> "setting" :)

Any idea for the richtitle name? maybe "settingstitle" ?
Comment 6 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2009-08-28 06:17:28 PDT
Created attachment 397261 [details] [diff] [review]
Patch v0.2

* rename richpref to setting
* rename richtitle to settingstitle
* Add a margin before the "options" button and the prefs

hmm, did 'hg rename' keep the history? it seems strange in the patch...
Comment 7 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2009-08-28 06:18:34 PDT
Created attachment 397262 [details]
screenshot
Comment 8 Mark Finkle (:mfinkle) (use needinfo?) 2009-08-28 20:31:28 PDT
Comment on attachment 397261 [details] [diff] [review]
Patch v0.2

Overall, this looks good.I want to test it a bit more before final review.

Also, I like the padding, except for the "Options" button itself. Can we keep it without padding, so we maximize space for buttons in portrait and we are consistent with the buttons in the "Get Add-ons" sections.

Lastly, we need to inform existing add-on developers, weave for example, that we are renaming the richpref bindings.

Oh, really last thing, "settingstitle": I'm wondering if that should be "settings" and act as a container for "setting" elements. More on that after I think about it more.
Comment 9 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2009-08-29 08:16:15 PDT
(In reply to comment #8)
> (From update of attachment 397261 [details] [diff] [review])
> Also, I like the padding, except for the "Options" button itself. Can we keep
> it without padding, so we maximize space for buttons in portrait and we are
> consistent with the buttons in the "Get Add-ons" sections.

Madhava?

> 
> Lastly, we need to inform existing add-on developers, weave for example, that
> we are renaming the richpref bindings.

What's the usual method for that? Should i add a needdocumention flag to the bug?

> 
> Oh, really last thing, "settingstitle": I'm wondering if that should be
> "settings" and act as a container for "setting" elements. More on that after I
> think about it more.

I find <settings><children/></settings> a good idea.
Comment 10 Mark Finkle (:mfinkle) (use needinfo?) 2009-09-01 15:10:19 PDT
Oh, this should be blocking
Comment 11 Mark Finkle (:mfinkle) (use needinfo?) 2009-09-02 13:43:10 PDT
Comment on attachment 397261 [details] [diff] [review]
Patch v0.2

* Let's do the settingstitle -> settings change and make it a container for setting elements
* Do not pad the "Options" button
* Use millimeters for the left padding, not "32px" (2.2mm on hildon and 1.1mm on wince)
* Make the "Options" button stay pressed while the options list is visible
Comment 12 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2009-09-03 08:50:30 PDT
Created attachment 398397 [details] [diff] [review]
Patch v0.3

(In reply to comment #11)
> (From update of attachment 397261 [details] [diff] [review])
> * Let's do the settingstitle -> settings change and make it a container for
> setting elements
> * Do not pad the "Options" button
> * Use millimeters for the left padding, not "32px" (2.2mm on hildon and 1.1mm
> on wince)
> * Make the "Options" button stay pressed while the options list is visible

Adress comments except the pressed state of the "Options button" which is more a css related problem. (there is no class for that :( )
Comment 13 Mark Finkle (:mfinkle) (use needinfo?) 2009-09-03 15:06:51 PDT
pushed with some tweaks after talking to madhava:
https://hg.mozilla.org/mobile-browser/rev/13167a569cae
Comment 14 Fabrice Desré 2009-09-04 00:13:37 PDT
The code at https://hg.mozilla.org/mobile-browser/rev/13167a569cae#l1.90 will fail if the xhr.responseDocument is null. Should we fill a new bug on this ?
Comment 15 Mark Finkle (:mfinkle) (use needinfo?) 2009-09-04 05:42:25 PDT
(In reply to comment #14)
> The code at https://hg.mozilla.org/mobile-browser/rev/13167a569cae#l1.90 will
> fail if the xhr.responseDocument is null. Should we fill a new bug on this ?

Yes, please. Good catch.
Comment 16 Joel Maher ( :jmaher ) 2009-09-21 07:16:39 PDT
addons seem to be working solid.
verified on my n810 with 20090921 1.9.2 nightly build
Comment 17 Brian King [:kinger] 2009-11-09 10:55:49 PST
The override option described at:

http://starkravingfinkle.org/blog/2009/09/fennec-handling-add-on-options/

... is quite straightforward. 

However, what if there is no options url to override? So, the mobile add-on is sharing the same code-base as the desktop add-on, and former has options but the latter does not, i.e. no em:optionsUrl.

Know any good hacks to keep the button disabled on desktop while enabling it on mobile?

Note You need to log in before you can comment on or make changes to this bug.