In a couple threads we've been debating back and forth about what we currently 
have as navigator.mozHour12 in Firefox OS.

It's a tri-value setting (undefined, true, false) that we take from mozSettings 
to adjust our Clock to use user chosen setting.

For a while, I've been asking to get it in the platform and the response was 
that we should aim to standardize it.

The challenge with standardizing it is that it is just one of many values that 
we will want to have. We can standardize just this single variable, but soon, 
we will have to standardize another, and then another and so on.

When I brought it up asking to design the API to flexible for future values, it 
instantly scaled up complexity for some participants.

So, I spent some time planning and thinking about it, and I came up with a set 
of user-defined variables that we should expose to web authors, and a proposal 
for an API to do so.

The variables:

 ! hour 12/24 clock (undefined, true, false)
 ! first day of the week (integer 0-6)
 ! weather unit (celsius, fahrenheit, kelvin)
 ! distance units (metric, imperial)
 - weekendStarts (integer 0-6)
 - weekendEnds (integer 0-6)
 - show seconds (undefined, true, false)
 - calendar (string - gregorian, buddhist, coptic etc.)
 - currentTimezone
 - currency
 - sorting settings

And those are only l10n/intl related ones. I can imagine that other areas might 
have similar needs:

 - accessibility (high-contrast, reverse colors etc.)
 - parental controls (hide explicit content)
 - notifications (lots of opportunity here)
 - sounds settings (mute, vibrate, level for different sound types)

and even some things that we already expose in various ways that would really 
fit as part of that API:

 - network status (online, offline, download speed, upload speed)

Not all of them are needed now, I marked the ones we should expose now with 
"!", but those are the kind of values that we may want at some point to:
 - allow users to set in Settings
 - have some automatic value for that may be dynamically computed (like, 
default hour12 depends on language settings)
 - allow apps to retrieve

I understand that we want to start small, but I'm confident that we should for 
the 4 settings market by me with "!" start looking for a solution.

And I believe that it shouldn't be that we expose each variable separately, on 
navigator. I believe that we should plan it as a counterpart to mozSettings API 
because it is, after all, read-only view of user settings.

Currently, any app that needs any of that information, has to get elevated 
privileges to let it *set* them, while almost every app that works with UI will 
just want to retrieve that.

Can we get something for our platform for now so that we can increase security 
and move forward with allowing ourselves and third-party devs create good UX in 
Firefox OS, and then merge this feature with our work to standardize 
mozSettings?

Thanks,
zb.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to