Closed
Bug 602685
Opened 14 years ago
Closed 14 years ago
Sync UI: Implement easy setup for Fennec
Categories
(Firefox for Android Graveyard :: General, defect)
Firefox for Android Graveyard
General
Tracking
(fennec2.0b3+)
VERIFIED
FIXED
Tracking | Status | |
---|---|---|
fennec | 2.0b3+ | --- |
People
(Reporter: philikon, Assigned: mfinkle)
References
Details
(Keywords: feature, Whiteboard: [strings] [metro-mvp])
Attachments
(3 files, 4 obsolete files)
(deleted),
patch
|
mfinkle
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mbrubeck
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mbrubeck
:
review+
philikon
:
feedback+
|
Details | Diff | Splinter Review |
No description provided.
Comment 1•14 years ago
|
||
Here's a link to some of the desktop design work: http://people.mozilla.com/~faaborg/files/firefox4Mockups/jpakeFlow-i1/jpakeFlow-i1.htm
more details in this comment: https://bugzilla.mozilla.org/show_bug.cgi?id=602682#c25
Assignee | ||
Updated•14 years ago
|
Assignee: nobody → mark.finkle
tracking-fennec: --- → 2.0b3+
Comment 2•14 years ago
|
||
Note that we're string frozen for fennec, too.
Assignee | ||
Comment 3•14 years ago
|
||
Beta 3 string freeze for Fennec is Nov 12th
Assignee | ||
Updated•14 years ago
|
Whiteboard: [strings]
Comment 4•14 years ago
|
||
All the UI discussion is going on over in bug 602682
Comment 5•14 years ago
|
||
Two amendments to the image in
http://www.flickr.com/photos/madhava_work/5164874423/
1. replace "auto-sync data [yes|no]" with "Synchronize [ On | Off ]"
(default is On, obviously)
2. Instead of a confirmation dialog on "Remove", let's
- disconnect
- change the UI so it looks like you're not connected (i.e. pre-jpake)
- put up a notification bar:
-----------------------------------------------------
Your Firefox Sync account has been removed. (x)
( undo )
-----------------------------------------------------
and dismiss this when the user leaves the manager, or hits the (x)
Comment 6•14 years ago
|
||
This is the connection flow:
http://www.flickr.com/photos/madhava_work/5164827140/sizes/l/
Assignee | ||
Comment 7•14 years ago
|
||
This patch switches fennec over to host all it's own sync related strings for UI. We also add the new setup screens. The JPAKE screen is useless for now, but the fallback screen works with the existing Sync impl. Other parts of the UI are not operational too: Synchronize toggle and the Remove button for example. Remove button just does a simple disconnect for now.
The patch supports all the different states found in the design mockups. We should be able to show all the screens in their correct context.
Attachment #490683 -
Flags: review?(mbrubeck)
Updated•14 years ago
|
Attachment #490683 -
Attachment is patch: true
Attachment #490683 -
Attachment mime type: application/octet-stream → text/plain
Comment 8•14 years ago
|
||
Comment on attachment 490683 [details] [diff] [review]
patch (mostly for stings)
>"From a Firefox Sync connected computer, go to Sync options and select 'Add a device'"
I think we need some sort of "Help" link or button after these instructions. It should open a web page with detailed instructions for the following cases:
* Getting Firefox Sync and creating an account.
* Finding the "Add a device" command in desktop Firefox.
* What to do if desktop Firefox has an old version without "Add a device."
These situations need more than just the "I'm not near my computer" fallback link.
I don't want to land this without at least a plan for addressing this, because this is going to be the common case until all desktop Firefox users are updated to Fx4 beta 8 or later, or have a newer Firefox Sync add-on installed. So we need to solve this for b3, and the change may involve string changes or additions.
Assignee | ||
Comment 9•14 years ago
|
||
I kinda detest using "links" in mobile UIs, but we could add something or a button to get help. Help could be a live link or an in-product page
Comment 10•14 years ago
|
||
Are all casings in those strings as they should be? I don't know the rules why it would be "Sync Now" vs "Sync now" or "Account Name" vs "Account name".
Just want to make sure we have those nasty details in check, too.
Comment 11•14 years ago
|
||
Comment on attachment 490683 [details] [diff] [review]
patch (mostly for stings)
>+ <button label="&sync.remove;" oncommand="WeaveGlue.disconnect();" />
I agree with tchung's comment on IRC that "Remove" is a weird name for this button. "Log out" or "Disconnect" seems better to me.
>+ <textbox readonly="true">code</textbox>
>+ <textbox readonly="true">goes</textbox>
>+ <textbox readonly="true">here</textbox>
The vertical alignment of the text in these boxes is off, in my Linux build.
I suggest styling these so they look more disabled. Right now it looks like I'm supposed to type in them.
>+ <description style="font-size: 18px; text-decoration: underline" onclick="document.getElementById('syncsetup-jpake').hidden = true; document.getElementById('syncsetup-manual').hidden = false;">&sync.fallback;</description>
After you click on this, there's no way to get back to the JPAKE UI - even if you cancel setup and then click on "Connect" again. There should be a "Back" button, or it should be reset when you press "Cancel."
Pressing escape should cancel setup (or go back to the previous setup screen).
>+ <button id="syncsetup-customserver-checkbox" type="checkbox" class="button-checkbox" pack="start">
>+ <image class="button-image-icon"/>
>+ <description class="prompt-checkbox-label" flex="1">&sync.customServer;</description>
>+ </button>
>+ <textbox id="syncsetup-customserver" placeholder="&sync.serverURL;"/>
We should check the "custom server" checkbox automatically if you start typing into the textbox.
>+ changeSync: function changeSync() {
>+ // XXX enable/disable sync without actually disconnecting
>+ },
Needs a fix, or a blocking followup bug.
>--- a/locales/en-US/chrome/preferences.dtd
>-<!ENTITY sync.account2 "Account Name">
>+++ b/locales/en-US/chrome/sync.dtd
>+<!ENTITY sync.account "Account Name">
Why did this change from sync.account2 back to sync.account?
>+lastSync.label=Last Update: %S
I think this should be "Last update: %S" to match the capitalization of the other preference labels.
>+<!ENTITY sync.account "Account Name">
>+<!ENTITY sync.syncKey "Sync Key">
...and should these textbox hints be sentence-case too?
>+remove.label=Your Firefox Sync account has been removed
>+remove.undo=Undo
These are unused. Will they be used in a followup?
Updated•14 years ago
|
Attachment #490683 -
Flags: review?(mbrubeck) → review-
Comment 12•14 years ago
|
||
(In reply to comment #11)
> I agree with tchung's comment on IRC that "Remove" is a weird name for this
> button. "Log out" or "Disconnect" seems better to me.
I was looking for something stronger than disconnect, given that disconnect, in the current version, merely logs you out (leaving your credentials in place) -- in practice, it's more like a "suspend syncing". What this actually does is dissociate your account from the device. Thinking about it more now, and independently of what "disconnect" means in the current UI, I could see using it, given the symmetry with what "Connect" does. Also, we have the "undo" design now, which make misinterpretation here less severe.
> The vertical alignment of the text in these boxes is off, in my Linux build.
>
> I suggest styling these so they look more disabled. Right now it looks like I'm
> supposed to type in them.
Yes - styling is still to come, presumably.
> After you click on this, there's no way to get back to the JPAKE UI - even if
> you cancel setup and then click on "Connect" again. There should be a "Back"
> button, or it should be reset when you press "Cancel."
I thought about having a button or link to go back (to toggle between the two, essentially), but ended up dropping it in the name of removing anything unnecessary -- I thought that a user could simply cancel, and, on "pressing" connect again they'd see the jpake ui again.
Reporter | ||
Comment 13•14 years ago
|
||
(In reply to comment #12)
> (In reply to comment #11)
>
> > I agree with tchung's comment on IRC that "Remove" is a weird name for this
> > button. "Log out" or "Disconnect" seems better to me.
>
> I was looking for something stronger than disconnect, given that disconnect, in
> the current version, merely logs you out (leaving your credentials in place)
Note that we want to get rid of that. Once you've paired your device with your Sync account, it will always sync. Also, I agree with your symmetry argument regarding "Connect".
Comment 14•14 years ago
|
||
(In reply to comment #13)
> Note that we want to get rid of that. Once you've paired your device with your
> Sync account, it will always sync. Also, I agree with your symmetry argument
> regarding "Connect".
OK - sold on "Disconnect" next to the Account name.
Regarding the "it will always sync" -- this is the reason for the "Syncronize [yes|no]", given that many of us in mobile-land have run into times when we don't want sync running.
Comment 15•14 years ago
|
||
(In reply to comment #11)
> We should check the "custom server" checkbox automatically if you start typing
> into the textbox.
Although leaving the field disabled until the checkbox is checked would reinforce the idea that you don't need to specify a server unless you actually want to use a custom one.
Comment 16•14 years ago
|
||
(In reply to comment #12)
> I was looking for something stronger than disconnect, given that disconnect, in
> the current version, merely logs you out (leaving your credentials in place)
With the patch here, "Remove" still leaves your credentials in place if you go through the fallback UI. Should this be fixed?
Comment 17•14 years ago
|
||
I think it should. If you're actually going to the trouble of disconnecting (rather than just turning off synchronization), I don't think we should leave your credentials "hidden" in there.
Comment 18•14 years ago
|
||
On the desktop we went with the longer string "stop using this account." The main use case is that you are about to give the computer up and don't want it associated anymore (so you don't start to capture someone else's passwords). It's assumed that the user will also be clearing out all of the local data after they disassociate.
Assignee | ||
Comment 19•14 years ago
|
||
(In reply to comment #11)
> Comment on attachment 490683 [details] [diff] [review]
> patch (mostly for stings)
I will make an updated patch with any changes to the strings, but all of the behavior changes will be a second patch on this bug. This patch is primarily to get the strings landed for l10n.
The iterative tweaking of behavior will happen afterward. I just needed enough functionality to 1) see all the screens with the new strings 2) keep sync working
Assignee | ||
Comment 20•14 years ago
|
||
Oh, and yes, I know that means this feature will be partially working / broken while the second patch is being created and reviewed - we'll live. The second patch is still slated for b3.
Assignee | ||
Comment 21•14 years ago
|
||
(In reply to comment #12)
> I thought about having a button or link to go back (to toggle between the two,
> essentially), but ended up dropping it in the name of removing anything
> unnecessary -- I thought that a user could simply cancel, and, on "pressing"
> connect again they'd see the jpake ui again.
Yes, this is the way it will work
Assignee | ||
Comment 22•14 years ago
|
||
(In reply to comment #17)
> I think it should. If you're actually going to the trouble of disconnecting
> (rather than just turning off synchronization), I don't think we should leave
> your credentials "hidden" in there.
Yep, also planned
Assignee | ||
Comment 23•14 years ago
|
||
(In reply to comment #10)
> Are all casings in those strings as they should be? I don't know the rules why
> it would be "Sync Now" vs "Sync now" or "Account Name" vs "Account name".
>
> Just want to make sure we have those nasty details in check, too.
Good point. I'll double check those. As pointed out by Matt, some are wrong.
Comment 24•14 years ago
|
||
Comment on attachment 490683 [details] [diff] [review]
patch (mostly for stings)
r+ with the following string changes, just to get the strings and basic UI in:
sync.account -> sync.account2
Remove -> Disconnect
Last Update -> Last update
Account Name -> Account name
Sync Key -> Sync key
All of the behavior changes we can do in a followup bug.
Attachment #490683 -
Flags: review- → review+
Assignee | ||
Comment 25•14 years ago
|
||
(In reply to comment #24)
> Comment on attachment 490683 [details] [diff] [review]
> patch (mostly for stings)
>
> r+ with the following string changes, just to get the strings and basic UI in:
>
> sync.account -> sync.account2
I reverted the entity bump since the string has been moved to a brand new file
> Remove -> Disconnect
> Last Update -> Last update
Done
> Account Name -> Account name
> Sync Key -> Sync key
We don't have good guidelines for placeholder case. Desktop Firefox uses sentence case for one placeholder but title case for 2 others. Fennec uses title case in the urlbar placeholder.
Since the placeholders are taking the place of labels, and labels have title case, I stuck with title case.
> All of the behavior changes we can do in a followup bug.
I plan to do followup patch on this bug
Assignee | ||
Comment 26•14 years ago
|
||
Just the strings and basic UI. Part 2 will fix more behavior.
Attachment #490683 -
Attachment is obsolete: true
Attachment #490810 -
Flags: review+
Assignee | ||
Comment 27•14 years ago
|
||
pushed part 1:
http://hg.mozilla.org/mobile-browser/rev/fabd294b1266
The sync ui is not hooked into the back button; it should go back to the preferences.
Comment 29•14 years ago
|
||
This layout of prefs controls (after discussion with stuart) gets rid of most of the ambiguity about what "synchronize [on|off]" does:
http://www.flickr.com/photos/madhava_work/5183207328/in/photostream/
Assignee | ||
Comment 30•14 years ago
|
||
(In reply to comment #29)
> This layout of prefs controls (after discussion with stuart) gets rid of most
> of the ambiguity about what "synchronize [on|off]" does:
>
> http://www.flickr.com/photos/madhava_work/5183207328/in/photostream/
Really? Could you write down what that meaning is? It looks like "Enable Sync" controls whether or not I can even connect to Sync.
Comment 31•14 years ago
|
||
Here's a mockup with the disabled states. There are two options shown - the first of the two (disabled, not invisible) is my preferred.
http://www.flickr.com/photos/madhava_work/5184268555/
Comment 32•14 years ago
|
||
(In reply to comment #31)
> Here's a mockup with the disabled states. There are two options shown - the
> first of the two (disabled, not invisible) is my preferred.
>
> http://www.flickr.com/photos/madhava_work/5184268555/
In these mockups, there is no way to manually sync ("Sync Now") while auto-sync is disabled...
Assignee | ||
Comment 33•14 years ago
|
||
(In reply to comment #32)
> (In reply to comment #31)
> > Here's a mockup with the disabled states. There are two options shown - the
> > first of the two (disabled, not invisible) is my preferred.
> >
> > http://www.flickr.com/photos/madhava_work/5184268555/
>
> In these mockups, there is no way to manually sync ("Sync Now") while auto-sync
> is disabled...
I think that is on purpose.
Comment 34•14 years ago
|
||
Icon for the connect screen is here:
http://mozilla.seanmartell.com/fennec/sync-64x64.png
Comment 35•14 years ago
|
||
(In reply to comment #32)
> (In reply to comment #31)
> > Here's a mockup with the disabled states. There are two options shown - the
> > first of the two (disabled, not invisible) is my preferred.
> >
> > http://www.flickr.com/photos/madhava_work/5184268555/
>
> In these mockups, there is no way to manually sync ("Sync Now") while auto-sync
> is disabled...
yeah - a working manual sync button makes sense if you've just turned off _auto_ sync, but less so when the switch enables/disables sync overall.
Comment 37•14 years ago
|
||
Madhava: were you going to add the two "Show me how" support links we have when adding computers on desktop?
-How to find "Add a device" (filed bug 613415)
-How to find your Sync Key (filed bug 613417)
On a related note, do SUMO articles format correctly when being displayed on a mobile device running fennec?
Comment 38•14 years ago
|
||
For the second device, if the code expires, or the user needs a new code because they entered the first one incorrectly, I think we should just refresh the code on the device (when they look back there is a new one).
Comment 39•14 years ago
|
||
(In reply to comment #27)
> pushed part 1:
> http://hg.mozilla.org/mobile-browser/rev/fabd294b1266
Hi guys,
Apart from the obvious "code" "goes" "here" strings which I assume are just temporary placeholders, there's two hard-coded "Cancel"s and one "Connect" in http://hg.mozilla.org/mobile-browser/diff/fabd294b1266/chrome/content/browser.xul#l1.35.
Would you mind changing them to entities?
Assignee | ||
Comment 42•14 years ago
|
||
This patch adds some fucntionality and changes the theme a bit:
* Use the new black background fullscreen dialog style
* Add support for hardware back button
* Adds "subgroup" concept to preferences by removing separators and indenting
* Makes "Details" button expand and collapse the subgroup of options
* Add a CSS rule to support checked="true" for buttons to look "pressed"
* Adds support for the new "Enable Sync" option which controls all Sync functionality
** We disconnect / connect when "Enable Sync" toggles
** UI uses the 2nd approach for disabled state (http://www.flickr.com/photos/madhava_work/5184268555/) since setting widgets don't yet have a disabled state themselves.
* Setup data is stored in a JS object, not the textbox UI
* Undo disconnect uses a copy of the setup data to do the "undo"
Attachment #492402 -
Flags: review?(mbrubeck)
Assignee | ||
Comment 43•14 years ago
|
||
the patch also fixes the hardcoded strings. unfortunately, I had to re-use an add-on manager string for "Cancel". I'll fix this for beta 4 since we are string frozen for b3.
Comment 44•14 years ago
|
||
As we're using l10n-merge anyway, I'd suggest to use the real string right away.
Comment 45•14 years ago
|
||
Comment on attachment 492402 [details] [diff] [review]
part 2 (basic functionality)
>+++ b/chrome/content/browser.xul
>- <toolbarbutton id="tool-panel-close" command="cmd_panel"/>
>+ <toolbarbutton class="tool-panel-close" command="cmd_panel"/>
This requires some trivial fixes to chrome/tests/browser_preferences_*
>+ <button id="syncsetup-usecustomserver" type="checkbox" class="button-checkbox" pack="start">
> <image class="button-image-icon"/>
>+ <description class="syncsetup-label" flex="1">&sync.customServer;</description>
> </button>
> <textbox id="syncsetup-customserver" placeholder="&sync.serverURL;"/>
We should either disable this textbox when the button is unchecked, or check the button automatically when you type in the textbox.
Need a followup bug to either use the custom server setting, or remove it from the UI for b3.
>+++ b/chrome/content/sync.js
>+ openSetup: function openSetup() {
> // Show the connect UI
> document.getElementById("syncsetup-container").hidden = false;
> document.getElementById("syncsetup-jpake").hidden = false;
> document.getElementById("syncsetup-manual").hidden = true;
>+
>+ BrowserUI.pushDialog(this);
> },
A dialog needs a close() method, (for handleEscape) but you renamed close -> closeSetup below.
I still think there should be a "back" action from the manual setup back to the easy setup, but I'll leave that decision to Madhava.
>+ enableSync: function enableSync() {
Could we rename this to e.g. "toggleSyncEnabled" (or keep the name but add a boolean argument)?
>+ if (enabled) {
> // ...
>+ } else if (!enabled) {
Can just be "else".
>+ Weave.Service.login(Weave.Service.username, this.setupData.password, this.normalizePassphrase(this.setupData.syncKey));
I think we can use normalizePassphrase and hyphenatePassphrase from Weave.Utils now, and get rid of the ones in mobile-browser.
See Pike's comment about the string, above - we should use the real string ID, as long as we're sure l10n-merge will prevent it from breaking us.
Attachment #492402 -
Flags: review?(mbrubeck) → review+
Assignee | ||
Comment 46•14 years ago
|
||
(In reply to comment #45)
> Comment on attachment 492402 [details] [diff] [review]
> part 2 (basic functionality)
>
> >+++ b/chrome/content/browser.xul
>
> >- <toolbarbutton id="tool-panel-close" command="cmd_panel"/>
> >+ <toolbarbutton class="tool-panel-close" command="cmd_panel"/>
>
> This requires some trivial fixes to chrome/tests/browser_preferences_*
I added IDs to the XUL and changed the class name a little
> >+ <button id="syncsetup-usecustomserver" type="checkbox" class="button-checkbox" pack="start">
> > <image class="button-image-icon"/>
> >+ <description class="syncsetup-label" flex="1">&sync.customServer;</description>
> > </button>
> > <textbox id="syncsetup-customserver" placeholder="&sync.serverURL;"/>
>
> We should either disable this textbox when the button is unchecked, or check
> the button automatically when you type in the textbox.
I added disabling the textbox
> Need a followup bug to either use the custom server setting, or remove it from
> the UI for b3.
I put basic handling for a custom server based on Philipp's comments in bug 591661.
> >+++ b/chrome/content/sync.js
>
> >+ openSetup: function openSetup() {
> > // Show the connect UI
> > document.getElementById("syncsetup-container").hidden = false;
> > document.getElementById("syncsetup-jpake").hidden = false;
> > document.getElementById("syncsetup-manual").hidden = true;
> >+
> >+ BrowserUI.pushDialog(this);
> > },
>
> A dialog needs a close() method, (for handleEscape) but you renamed close ->
> closeSetup below.
changed back to close()
> >+ enableSync: function enableSync() {
>
> Could we rename this to e.g. "toggleSyncEnabled" (or keep the name but add a
> boolean argument)?
Renamed
> >+ if (enabled) {
> > // ...
> >+ } else if (!enabled) {
>
> Can just be "else".
Done
> >+ Weave.Service.login(Weave.Service.username, this.setupData.password, this.normalizePassphrase(this.setupData.syncKey));
>
> I think we can use normalizePassphrase and hyphenatePassphrase from Weave.Utils
> now, and get rid of the ones in mobile-browser.
Done
> See Pike's comment about the string, above - we should use the real string ID,
> as long as we're sure l10n-merge will prevent it from breaking us.
Done
Assignee | ||
Comment 47•14 years ago
|
||
pushed part 2:
http://hg.mozilla.org/mobile-browser/rev/76f01dd37fa9
Comment 48•14 years ago
|
||
(In reply to comment #37)
> Madhava: were you going to add the two "Show me how" support links we have when
> adding computers on desktop?
>
> -How to find "Add a device" (filed bug 613415)
> -How to find your Sync Key (filed bug 613417)
>
> On a related note, do SUMO articles format correctly when being displayed on a
> mobile device running fennec?
I didn't realize we were building this support content - I'll look for a way to get them in. But no, SUMO articles do not currently format well on a mobile device - you see the desktop layout.
Comment 49•14 years ago
|
||
(In reply to comment #48)
> (In reply to comment #37)
> > Madhava: were you going to add the two "Show me how" support links we have when
> > adding computers on desktop?
> >
> > -How to find "Add a device" (filed bug 613415)
> > -How to find your Sync Key (filed bug 613417)
Actually - for the latter one - is that useful to include on mobile? If they're not near their computer, will the article about finding your sync key help? And if they _are_ near their computer, wouldn't they use jpake instead?
That said, there's value to the first one, definitely.
Comment 50•14 years ago
|
||
Two variants:
http://www.flickr.com/photos/madhava_work/5201976716/
The latter is more consistent with the desktop, and also makes it more clear that it's a thing you can tap.
It takes you out of the connection flow, given that it has to open a webpage; BUT if you're lost, that's a pretty good tradeoff.
Comment 51•14 years ago
|
||
Tested custom server url: https://stage-auth.services.mozilla.com/.
Need to enter the trailing slash at the end on the fennec sync-fallback UI in order to successfully connect to the server. it fails without it.
Reporter | ||
Comment 52•14 years ago
|
||
(In reply to comment #51)
> Need to enter the trailing slash at the end on the fennec sync-fallback UI in
> order to successfully connect to the server. it fails without it.
The Firefox UI adds https:// and trailing slash when needed. Would be good if the Fennec UI could do the same.
Here's the relevant portion of the Firefox UI code: http://mxr.mozilla.org/services-central/source/fx-sync/ui/firefox/content/setup.js#663 Also note the isValid function that checks whether a server that was entered is actually a valid Sync server or not.
Reporter | ||
Comment 53•14 years ago
|
||
(In reply to comment #52)
> Also note the isValid function that checks whether a server that was entered is
> actually a valid Sync server or not.
Actually, please ignore that. isValid() is only used for account creation, not for connecting to an existing account. So please don't add that check to Fennec because it only supports existing accounts anyway.
Comment 54•14 years ago
|
||
Some nits with the styling of the current implementation:
jpake screen: https://bugzilla.mozilla.org/show_bug.cgi?id=606590
manual connect screen:
http://www.flickr.com/photos/madhava_work/5202078787/in/photostream/
Comment 55•14 years ago
|
||
that jpake screen should actually be this link: http://www.flickr.com/photos/madhava_work/5202680838/in/photostream/
Assignee | ||
Comment 56•14 years ago
|
||
This patch adds implementation of JPAKE connection, stealing heavily from the Firefox patches. It also adds code to validate the server URL and tweaks the CSS style a little, based on Madhava's input.
We still need to test the JPAKE feature when the back-end impl lands. I don't know if I like the way the sync logo looks in the dialogs.
Attachment #492913 -
Flags: review?(mbrubeck)
Attachment #492913 -
Flags: feedback?(philipp)
Assignee | ||
Comment 57•14 years ago
|
||
Oops, forgot to add the logo png to the patch
Attachment #492913 -
Attachment is obsolete: true
Attachment #492914 -
Flags: review?(mbrubeck)
Attachment #492914 -
Flags: feedback?(philipp)
Attachment #492913 -
Flags: review?(mbrubeck)
Attachment #492913 -
Flags: feedback?(philipp)
Assignee | ||
Updated•14 years ago
|
Attachment #492914 -
Flags: review?(mbrubeck) → review?(21)
Comment 58•14 years ago
|
||
Comment on attachment 492914 [details] [diff] [review]
part 3 (jpake + tweaks) v2
>diff --git a/chrome/content/browser.xul b/chrome/content/browser.xul
> <vbox align="center" flex="1">
>- <description class="syncsetup-code">code</description>
>- <description class="syncsetup-code">goes</description>
>- <description class="syncsetup-code">here</description>
>+ <description id="syncsetup-code1" class="syncsetup-code">code</description>
>+ <description id="syncsetup-code2" class="syncsetup-code">goes</description>
>+ <description id="syncsetup-code3" class="syncsetup-code">here</description>
"code goes here"?
Are those strings temporary or do we want to localize them (or remove them)?
>diff --git a/chrome/content/sync.js b/chrome/content/sync.js
>+ });
>+ this._jpakeclient.receiveNoPIN();
> },
>
> openManual: function openManual() {
> // Push the current setup data into the UI
> if (this.setupData && "account" in this.setupData) {
> this._elements.account.value = this.setupData.account;
> this._elements.password.value = this.setupData.password;
>- this._elements.synckey.value = this.setupData.syncKey;
>- if (this.setupData.customServer && this.setupData.customServer.length) {
>+ this._elements.synckey.value = this.setupData.synckey;
>+ if (this.setupData.serverURL && this.setupData.serverURL.length) {
> this._elements.usecustomserver.checked = true;
> this._elements.customserver.disabled = false;
>- this._elements.customserver.value = this.setupData.customServer;
>+ this._elements.customserver.value = this.setupData.serverURL;
> } else {
> this._elements.usecustomserver.checked = false;
> this._elements.customserver.disabled = true;
> this._elements.customserver.value = "";
> }
Is there any reason for the properties of this._elements to not be camelCase?
Same question for this.setupData.synckey?
> close: function close() {
...
> this._elements.usecustomserver.checked = false;
> this._elements.customserver.disable = true;
disabled?
>+
>+ _validateServer: function _validateServer(aURL) {
>+ let uri = Weave.Utils.makeURI(aURL);
>+
>+ if (!uri)
>+ uri = Weave.Utils.makeURI("https://" + aURL);
>+
>+ if (!uri)
>+ return "";
>+ return uri.spec;
> }
I'm a bit unsure of the name, the code does not really seem to validate a server. _getServerSpec?
r+ with nits
Attachment #492914 -
Flags: review?(21) → review+
Reporter | ||
Comment 59•14 years ago
|
||
Comment on attachment 492914 [details] [diff] [review]
part 3 (jpake + tweaks) v2
>+ onComplete: function onComplete(aCredentials) {
>+ self.close();
>+
>+ self.setupData = {};
>+ self.setupData.account = aCredentials.account;
>+ self.setupData.password = aCredentials.password;
>+ self.setupData.synckey = aCredentials.synckey;
>+ self.setupData.serverURL = aCredentials.serverURL;
You own aCredentials so you can just do
self.setupData = aCredentials;
Attachment #492914 -
Flags: feedback?(philipp) → feedback+
Reporter | ||
Comment 60•14 years ago
|
||
Comment on attachment 492914 [details] [diff] [review]
part 3 (jpake + tweaks) v2
The simplified crypto (bug 603489) is going to land shortly before the JPAKE stuff. It has a few implications on how the UI presents the Sync Key which I think should be reflected in this patch as well.
Unfortunately up until now UI code made assumptions about the Sync Key (length == 20 for example). Fortunately this will be fixed. Going forward UI should use
* Weave.Utils.hyphenatePassphrase() to convert a Sync Key value (e.g. Weave.Service.passphrase) before showing it to the user,
* Weave.Utils.normalizePassphrase() to convert a user entered value to the raw Sync Key (e.g. something that we can assign to Weave.Service.passphrase or pass to Weave.Service.login()),
* Weave.Utils.isPassphrase() to check whether the entered value is a valid Sync Key.
* We also have Weave.Utils.hyphenatePartialPassphrase() which can be used to hyphenate a Sync Key as the user types it in.
Bug 612699 implements these changes for the integrated Firefox UI (it does a bit more than that since also no longer allow custom passphrases).
>+ <textbox id="syncsetup-account" class="syncsetup-edit" placeholder="&sync.account;"/>
>+ <textbox id="syncsetup-password" class="syncsetup-edit" placeholder="&sync.password;" type="password"/>
>+ <textbox id="syncsetup-synckey" class="syncsetup-edit" placeholder="&sync.syncKey;"/>
In the Firefox UI we'll have an onkeyup event listener here to hyphenate the Sync Key as you type:
onPassphraseKeyUp: function (event) {
if (event.keyCode != event.DOM_VK_BACK_SPACE) {
let el = event.target;
el.value = Weave.Utils.hyphenatePartialPassphrase(el.value);
}
this.checkFields();
},
> // Push the current setup data into the UI
> if (this.setupData && "account" in this.setupData) {
> this._elements.account.value = this.setupData.account;
> this._elements.password.value = this.setupData.password;
>- this._elements.synckey.value = this.setupData.syncKey;
>- if (this.setupData.customServer && this.setupData.customServer.length) {
>+ this._elements.synckey.value = this.setupData.synckey;
You want to use Weave.Utils.hyphenatePassphrase() on this.setupData.synckey here before showing it in the textbox, unless this.setupData.synckey should already contain the presentable form. It's not clear to me. If the latter is the case you want to hyphenate the value you get from JPAKE.
> if (this.setupData) {
>- if (this.setupData.customServer && this.setupData.customServer.length)
>- Weave.Service.serverURL = this.setupData.customServer;
>- Weave.Service.login(Weave.Service.username, this.setupData.password, Weave.Utils.normalizePassphrase(this.setupData.syncKey));
>+ if (this.setupData.serverURL && this.setupData.serverURL.length)
>+ Weave.Service.serverURL = this.setupData.serverURL;
>+ Weave.Service.login(Weave.Service.username, this.setupData.password, Weave.Utils.normalizePassphrase(this.setupData.synckey));
Here for instance it seems like this.setupData.synckey contains the presentable form of the Sync Key.
> let pp = Weave.Service.passphrase || "";
> if (pp.length == 20)
> pp = Weave.Utils.hyphenatePassphrase(pp);
This hardcoded length assumption needs to be removed from UI code. You can use Weave.Utils.isPassphrase() instead.
Assignee | ||
Comment 61•14 years ago
|
||
OK, I am updating the patch to store setupData.synckey in raw form and only hyphenate and normalize when dealing with the UI.
Assignee | ||
Comment 62•14 years ago
|
||
Updated with Phillip's feedback
Attachment #492914 -
Attachment is obsolete: true
Comment 63•14 years ago
|
||
A probably better revision to the fennec sync screen layouts: http://grab.by/7EBh (from mart3ll)
Reporter | ||
Comment 64•14 years ago
|
||
Comment on attachment 493800 [details] [diff] [review]
part 3 (jpake + tweaks) v3
>+ //Components.utils.import("resource://services-sync/jpakeclient.js");
...
>+ this._jpakeclient = new JPAKEClient({
nit: Use Weave.JPAKEClient rather than doing the import yourself. We're trying to have UI code only go through the "Weave" namespace (it also means you're automatically being lazy about the import which is good).
I know my patch sets a bad example, I will fix that. Sorry for not spotting this earlier.
Assignee | ||
Comment 65•14 years ago
|
||
* Changed the way we import the JPAKEClient based on Philipp's comment.
* Removed key generation property
* Tweaked style a little based on Madhava's mockup (adding strings needs to wait for after b3)
Attachment #493800 -
Attachment is obsolete: true
Attachment #494930 -
Flags: review?(mbrubeck)
Attachment #494930 -
Flags: feedback?(philipp)
Comment 66•14 years ago
|
||
Comment on attachment 494930 [details] [diff] [review]
part 3 (jpake + tweaks) v4
Just some nits:
>+++ b/chrome/content/browser.xul
>+ <description id="syncsetup-code1" class="syncsetup-code">code</description>
>+ <description id="syncsetup-code2" class="syncsetup-code">goes</description>
>+ <description id="syncsetup-code3" class="syncsetup-code">here</description>
Remove the placeholder text ("code goes here") - we shouldn't need it anymore.
>+++ b/chrome/content/sync.js
>+ self.setupData = {};
>+ self.setupData.account = aCredentials.account;
>+ self.setupData.password = aCredentials.password;
>+ self.setupData.synckey = aCredentials.synckey;
>+ self.setupData.serverURL = aCredentials.serverURL;
I think this would be more readable as:
self.setupData = {
account: aCrendentials.account,
password: aCredentials.password,
/* ... */
};
(or even "self.setupData = aCredentials;")
> this.setupData = {};
> this.setupData.account = this._elements.account.value;
> this.setupData.password = this._elements.password.value;
>+ this.setupData.synckey = Weave.Utils.normalizePassphrase(this._elements.synckey.value);
>+ this.setupData.serverURL = this._validateServer(this._elements.customserver.value);
Same here.
>+ if (!this._jpakeclient)
To avoid ES5 Strict warnings, use 'if (!"_jpakeclient" in this)' or initialize _jpakeclient to null (and set it to null again instead of deleting it).
>+ onAbort: function onAbort(error) {
aError
Attachment #494930 -
Flags: review?(mbrubeck) → review+
Assignee | ||
Comment 67•14 years ago
|
||
> (or even "self.setupData = aCredentials;")
Philipp already suggested that and I forgot. Thanks.
All Matt's suggestions have been made locally.
Reporter | ||
Updated•14 years ago
|
Attachment #494930 -
Flags: feedback?(philipp) → feedback+
Assignee | ||
Comment 69•14 years ago
|
||
pushed:
http://hg.mozilla.org/mobile-browser/rev/85d4b6d54c79
I was able to receive JPAKE codes fine. I was not able to test connecting via JPAKE after adding codes to Firefox desktop via "Add a device". Will test ASAP.
Assignee | ||
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 70•14 years ago
|
||
Verified Fixed on:
Mozilla/5.0(Android; Linux armv7l; rv:2.0b8pre) Gecko/20101214 Firefox/4.0b8pre
Fennec/4.0b3pre
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•