Skip to content
This repository has been archived by the owner. It is now read-only.

fix(styles): make setting header UI better #3089

Merged
merged 2 commits into from Oct 2, 2015
Merged

fix(styles): make setting header UI better #3089

merged 2 commits into from Oct 2, 2015

Conversation

@johngruen
Copy link
Contributor

@johngruen johngruen commented Sep 21, 2015

@pdehaan @zaach maybe give this a review? I added some stuff into the settings view to twiddle the DOM when a user adds or removes a display name.

Fixes #3055

@johngruen
Copy link
Contributor Author

@johngruen johngruen commented Sep 21, 2015

Fixes #3055

@johngruen johngruen force-pushed the issue-3055 branch from de50195 to 7b3bce6 Sep 21, 2015
@@ -35,6 +35,7 @@ $input-background-disabled-color: #f2f2f2;
$input-border-disabled-color: #dddddd;
$input-disabled-color: #64778c;
$secondary-button-border-color: #c1c1c1;
$black: #fff;

This comment has been minimized.

@pdehaan

pdehaan Sep 21, 2015
Contributor

nit: this is a bit confusing. Since $black is technically white.

This comment has been minimized.

@vladikoff

vladikoff Sep 22, 2015
Contributor

should this be $modal-border-color?

This comment has been minimized.

@johngruen

johngruen Sep 22, 2015
Author Contributor

@pdehaan that IS confusing

@rfk rfk added this to the FxA-0: quality milestone Sep 21, 2015
@vladikoff vladikoff self-assigned this Sep 21, 2015
var displayName = account.get('displayName');
var email = account.get('email');

var $cardHeader = $('.card-header');

This comment has been minimized.

@vladikoff

vladikoff Sep 22, 2015
Contributor

could we use this.$... for all these selectors here? see other usage in this same file

@@ -117,7 +117,10 @@ function ($, modal, Cocktail, Session, BaseView, AvatarMixin,
$.modal.close();
}
this.showEphemeralMessages();

This comment has been minimized.

@vladikoff

vladikoff Sep 22, 2015
Contributor

nit: extra spaces / line breaks, not needed

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Sep 22, 2015

image

Issues with the main header, letters get cut off

@vladikoff vladikoff assigned johngruen and unassigned vladikoff Sep 22, 2015
{{#showSignOut}}
<button id="signout" class="settings-button secondary">{{#t}}Sign out{{/t}}</button>
{{/showSignOut}}
</header>

<div class="settings-success-wrapper">
<div class="success settings-success">Hello</div>

This comment has been minimized.

@vladikoff

vladikoff Sep 22, 2015
Contributor

Do we still need this Hello here?

  1. it seems like it is not visible
  2. the contents of that get replaced with some "updated" message.

So should this just be <div class="success settings-success"></div> ?

@@ -156,6 +159,25 @@ function ($, modal, Cocktail, Session, BaseView, AvatarMixin,
});
},

_swapDisplayName: function () {

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Sep 22, 2015
Member

@johngruen - can you document what this does and why it does it?

This comment has been minimized.

@johngruen

johngruen Sep 22, 2015
Author Contributor

@shane-tomlinson good idea

@johngruen
Copy link
Contributor Author

@johngruen johngruen commented Sep 22, 2015

@vladikoff so i fixed everything but am unable to repro the text clipping issue in FF or Chrome. Where were did you see this?

@johngruen johngruen force-pushed the issue-3055 branch 2 times, most recently from 8b4ab83 to c44bd9a Sep 22, 2015
@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Sep 23, 2015

@johngruen Seems like text clipping was fixed but now the headers are just too close to each other:

image

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Sep 23, 2015

@johngruen the above is in latest stable chrome ^

@vladikoff vladikoff assigned johngruen and unassigned vladikoff Sep 23, 2015
@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Sep 23, 2015

It seems fine in the "small" view though, a bit close

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Sep 24, 2015

Also needs rebase

@johngruen johngruen force-pushed the issue-3055 branch 2 times, most recently from c618c47 to 0d4e898 Sep 25, 2015
$('body.settings').fadeOut(this.FADE_OUT_SETTINGS_MS, function (){
$('body').removeClass('settings').show();
});
},

This comment has been minimized.

@vladikoff

vladikoff Sep 25, 2015
Contributor

I think this change will introduce a flash of content, see gif:
flasg

@zaach ideas?

This comment has been minimized.

@zaach

zaach Sep 25, 2015
Contributor

Am I going crazy I thought we already had code that did this.

This comment has been minimized.

@zaach

zaach Sep 25, 2015
Contributor

Ugh, I didn't notice in 207dfd6 that we removed the smooth transition.

/cc @shane-tomlinson

This comment has been minimized.

@zaach

zaach Sep 25, 2015
Contributor

This effect is now implemented in base.js, which we could modify to also use a transition if the view specifies a duration.

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Sep 28, 2015
Member

Ugh, I didn't notice in 207dfd6 that we removed the smooth transition.

/cc @shane-tomlinson

Yeah, that transition messed with the removal of the layoutClassName, so I took it out.

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Sep 28, 2015
Member

Yeah, that transition messed with the removal of the layoutClassName, so I took it out.

I now see not having it messes with other things. In base.js, can you document why the transition is needed or else another drive by removal could occur.

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 1, 2015
Member

This flash still exists - can we just remove the fade out for now and file a follow on bug to re-add the behavior more generically?

cardHeader.text(displayName);
cardSubheader.text(email);
}
},

This comment has been minimized.

@vladikoff

vladikoff Sep 25, 2015
Contributor

above is not covered by unit tests, see

https://coveralls.io/builds/3670185/source?filename=app%2Fscripts%2Fviews%2Fsettings.js

Let us know if you need help adding tests for these

@johngruen johngruen force-pushed the issue-3055 branch from 0d4e898 to dae9575 Sep 30, 2015
@johngruen johngruen force-pushed the issue-3055 branch from dae9575 to 6e71b6c Oct 1, 2015
cardHeader.text(email);
cardSubheader.text('');
} else {
cardHeader.text(displayName);

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 1, 2015
Member

This line and the next are not covered by unit tests:

screen shot 2015-10-01 at 11 45 29
.

});
});

describe('with display name added', function () {

This comment has been minimized.

@johngruen

johngruen Oct 1, 2015
Author Contributor

@shane-tomlinson doesn't this cover that?

assert.equal(view.$('.card-subheader').text(), 'a@a.com');
});
});
});

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 1, 2015
Member

As noted above, one more test is needed that starts with the email address in the header, then adds a display name after the initial render. That should hit the uncovered code.

@johngruen johngruen force-pushed the issue-3055 branch from 6e71b6c to f2189b3 Oct 1, 2015
@johngruen
Copy link
Contributor Author

@johngruen johngruen commented Oct 1, 2015

@shane-tomlinson added another test that should fit the bill, also removed that fading stuff.

@@ -148,6 +149,32 @@ function ($, modal, Cocktail, Session, BaseView, AvatarMixin,
return self._showAvatar();
},

beforeDestroy: function () {

This comment has been minimized.

@shane-tomlinson shane-tomlinson force-pushed the issue-3055 branch from f2189b3 to b907fdc Oct 1, 2015
@@ -1,24 +1,30 @@
<div id="fxa-settings-header-wrapper">
<header id="fxa-settings-header">
<h1 id="fxa-manage-account">{{#t}}Manage account{{/t}}</h1>
<h1 id="fxa-manage-account">{{#t}}Firefox Account{{/t}}</h1>

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 1, 2015
Member

Do you want Account or Accounts here. I understand the rationale for Account, but that doesn't seem right.

This comment has been minimized.

@ryanfeeley

ryanfeeley Oct 1, 2015
Contributor

I prefer "Accounts". It fits in more with the domain and the emails we are sending. You are at a site that has accounts, and maybe one day you'll be able to be signed into multple accounts, like Google.

@shane-tomlinson
Copy link
Member

@shane-tomlinson shane-tomlinson commented Oct 1, 2015

As soon as the tests pass, I'm hitting the button.

This is a great update @johngruen!

@johngruen
Copy link
Contributor Author

@johngruen johngruen commented Oct 1, 2015

cool!

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Oct 1, 2015

r-

display name evaluates javascript:

image

@shane-tomlinson
Copy link
Member

@shane-tomlinson shane-tomlinson commented Oct 1, 2015

display name evaluates javascript:

oh dear lord. Great catch.

@shane-tomlinson shane-tomlinson force-pushed the issue-3055 branch from c4a4584 to 0d554f3 Oct 1, 2015
* Change `Firefox Account`=>`Firefox Accounts`
* Ensure the displayName is not an XSS vector.
* Remove the display name from the settings-unit-summary
@shane-tomlinson shane-tomlinson force-pushed the issue-3055 branch from 0d554f3 to 20faf0e Oct 1, 2015
vladikoff added a commit that referenced this pull request Oct 2, 2015
fix(styles): make setting header UI better r=vladikoff
@vladikoff vladikoff merged commit ab3147f into master Oct 2, 2015
4 checks passed
4 checks passed
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.002%) to 98.903%
Details
@vladikoff vladikoff deleted the issue-3055 branch Oct 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants