Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Fixes #4848 - Header Without text labels #4940

Merged

Conversation

punamdahiya
Copy link
Contributor

No description provided.

@punamdahiya
Copy link
Contributor Author

Header at width > 719px without text labels

screenshot 2018-09-21 17 40 29

@chenba
Copy link
Collaborator

chenba commented Sep 24, 2018

At narrow widths, the buttons are above the shot title, which is not matching #4848 (comment) Am I confused about what this PR supposed to implement?

@punamdahiya
Copy link
Contributor Author

At narrow widths, the buttons are above the shot title, which is not matching #4848 (comment) Am I confused about what this PR supposed to implement?

@chenba Sorry for confusion, PR is WIP for narrow widths thats why 'Hold' in title. I created the PR to show how header is going to look with buttons without text and gather feedback if it's good to go ahead with this change.

@punamdahiya punamdahiya changed the title Fixes #4848 - Header Without text labels [Hold] Fixes #4848 - Header Without text labels Sep 24, 2018
@punamdahiya
Copy link
Contributor Author

@chenba Sorry for confusion, PR is WIP for narrow widths thats why 'Hold' in title. I created the PR to show how header is going to look with buttons without text and gather feedback if it's good to go ahead with this change.
Oops, I thought I had the commit with 'Hold' in the title, just updated to reflect that :)

@punamdahiya punamdahiya force-pushed the 4848_Header_Responsive branch 3 times, most recently from af93a5f to 8db6018 Compare September 26, 2018 01:25
@punamdahiya punamdahiya force-pushed the 4848_Header_Responsive branch 4 times, most recently from 072ddb7 to cfbd159 Compare September 26, 2018 19:02
@@ -21,7 +21,7 @@ exports.Header = function Header(props) {

exports.Header.propTypes = {
hasLogo: PropTypes.bool,
children: PropTypes.node.isRequired,
children: PropTypes.node,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addresses server warning in logs when Header doesn't have children

@@ -161,7 +157,7 @@ class EditableTitle extends React.Component {
<input ref={(input) => this.textInput = input}
className="shot-title-input"
style={{minWidth: this.state.minWidth}}
type="text" defaultValue={this.props.title} autoFocus="true"
type="text" defaultValue={this.props.title} autoFocus={true}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes warning in logs due to boolean value passed as string

padding-bottom: 8px;
}
@media (min-width: 1260px) {
max-width: 500px;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added explicit check to increase title width when window size is more than 1260. Without this check header layout for title width 500px, wraps around when window size is 1000px

@punamdahiya punamdahiya changed the title [Hold] Fixes #4848 - Header Without text labels Fixes #4848 - Header Without text labels Sep 26, 2018
@punamdahiya
Copy link
Contributor Author

@chenba @6a68 PR is updated with latest UI header spec, please review. Thanks!

@chenba
Copy link
Collaborator

chenba commented Sep 26, 2018

Now that we no longer label the buttons, they should use inline images. In Windows high contrast mode, background images are not displayed. For example:

image

Copy link
Collaborator

@chenba chenba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use inline images instead of background images.

@include respond-to("large") {
font-size: 32px;
line-height: 39px;
max-width: 250px;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youwenliang As per spec, for large widths (~1000px) with 96px x 96px 7 buttons in header, leaves about 250px space for title with 28px padding on the right for edit icon shown on hover.

Title width changes to 500px as window size increase to > 1260px to show longer text title, will that work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me.

line-height: 20px;
padding-bottom: 4px;
@include respond-to("medium") {
max-width: 200px;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are wrapping our header, we can change this to 500px, will update

@youwenliang
Copy link
Contributor

@punamdahiya
The icons seem to have more space on the bottom as shown below (should be aligned center)
image

Also I updated the toolbar icons here, use these instead:
https://github.com/mozilla/testpilot-assets/tree/master/Firefox_Screenshots/00_Assets/Updated_Icons
(the current icons have different stroke weight and look inconsistent)

Not sure if the svg's color should be context-fill though since chenba brought up the high contrast mode issue.

@punamdahiya
Copy link
Contributor Author

punamdahiya commented Sep 27, 2018

Not sure if the svg's color should be context-fill though since chenba brought up the high contrast mode issue.
@youwenliang That will be great if it's possible to tweak svg so that it shows up even somewhat visible in high contrast mode.

@chenba Our background-images not showing in high contast mode is an existing issue, the experience is better than what's in the PR as we are showing a border around the buttons, I will update PR to bring border back. Thanks

@chenba
Copy link
Collaborator

chenba commented Sep 27, 2018

Our background-images not showing in high contast mode is an existing issue

Since we are making changes to the buttons, I think it's a good time to fix it. What's the problem with using inline images?

@punamdahiya
Copy link
Contributor Author

Our background-images not showing in high contast mode is an existing issue

Since we are making changes to the buttons, I think it's a good time to fix it. What's the problem with using inline images?

Not a big fan of listing image file paths in js and would like to keep it in css as much as possible. If there are other options to make it high contrast mode accessible Iike updating svg file I would prefer that

@punamdahiya
Copy link
Contributor Author

punamdahiya commented Sep 28, 2018

@punamdahiya
The icons seem to have more space on the bottom as shown below (should be aligned center)
image

Also I updated the toolbar icons here, use these instead:
(the current icons have different stroke weight and look inconsistent)

@youwenliang Toolbar icons are updated, please find screenshot of latest shot page
screenshot 2018-09-27 17 50 01

@youwenliang
Copy link
Contributor

@punamdahiya
I think we need to do something like this in the css: http://adrianroselli.com/2018/03/svg-filtering-for-windows-high-contrast-mode.html
Will need to find all the icons in our UI and apply the filter to them though.

@punamdahiya
Copy link
Contributor Author

punamdahiya commented Sep 28, 2018

@punamdahiya
I think we need to do something like this in the css: http://adrianroselli.com/2018/03/svg-filtering-for-windows-high-contrast-mode.html
Will need to find all the icons in our UI and apply the filter to them though.

thanks for sharing Mark, sadly these media queries are only supported in IE and edge , for Firefox on WHCM for now fallback seems to to use <img> tag instead of background-image in css

@punamdahiya punamdahiya force-pushed the 4848_Header_Responsive branch 5 times, most recently from 0320a45 to 44dc381 Compare September 28, 2018 18:29
@punamdahiya
Copy link
Contributor Author

Updated PR to use inline images for buttons inside header. @6a68 @ianb Barry is on PTO today, if you have bandwidth it will be great if you can review the PR. Thanks!

@jaredhirsch
Copy link
Member

Sure, I can take a look.

@punamdahiya
Copy link
Contributor Author

Thanks! will resolve conflicts and update.

@punamdahiya
Copy link
Contributor Author

Thanks! will resolve conflicts and update.

Done

Copy link
Member

@jaredhirsch jaredhirsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good overall 👍, couple minor things, see inline comments. Feel free to self-merge once you've addressed them.

UX feedback (this might belong in a separate bug):

The promo card looks a little bit cramped, when compared to the spacious elements in the rest of the shot page.

I don't understand why we're aggressively truncating the title and hiding expiry info below 1260px:

Slightly above 1260px:

screen shot 2018-09-28 at 12 58 26 pm

Slightly below 1260px:

screen shot 2018-09-28 at 12 58 34 pm


The full-width, centered toolbar palette looks sort of empty to me. What if we just leave the buttons right-aligned in the header, but shrink them to this size?

screen shot 2018-09-28 at 1 00 43 pm

@@ -17,20 +17,20 @@ exports.HomePageHeader = class HomePageHeader extends React.Component {
renderFxASignIn() {
return (
this.props.isFirefox && this.props.isOwner ?
<SignInButton isAuthenticated={this.props.hasFxa} initialPage="" /> : null
<SignInButton isAuthenticated={this.props.hasFxa} initialPage=""
staticLink={this.props.staticLink}/> : null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gotten used to seeing attributes vertically aligned if they have to wrap onto a second line, like:

<SignInButton isAuthenticated={this.props.hasFxa} initialPage=""
              staticLink={this.props.staticLink}/>

I like how this approach differentiates indentation for child elements (2 spaces) versus attributes within an element. What do you think? If this sounds good to you, I think it'd be good to apply it to this patch.

Looks like the eslint react plugin has a rule for this: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, updated patch to align attribute with the first prop

</Localized>;
<a className="nav-button icon-shots" title="My Shots" href="/shots"
onClick={ this.onClickMyShots.bind(this) } tabIndex="0">
<img src={this.props.staticLink("/static/img/icon-shots.svg")} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these images have alt text? I'm not sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure either, in share-button we have similar tags where img is embedded inside link and have omitted img alt in favor of title attribute on link. https://github.com/mozilla-services/screenshots/blob/master/server/src/share-buttons.js#L129

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, we can leave it for now, and see if it triggers the a11y linter later

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add alt text to all of our images for a11y.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #4976 to take it up in Q4 with a11y bugs

@@ -107,4 +103,5 @@ exports.DeleteShotButton.propTypes = {
confirmDeleteHandler: PropTypes.func,
cancelDeleteHandler: PropTypes.func,
isIcon: PropTypes.bool,
staticLink: PropTypes.func,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe staticLink should be defined in the base header, instead of being passed around, since it seems to be used in all the headers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly confused by above comment, by base header you mean inside header.js, am I missing something here?

@include respond-to("large") {
display: none;
}
@media (min-width: 1260px) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's stick with the respond-to($size) pattern, instead of using a media query directly. You can call this "extra-large".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

order: 0;
}
background-color: $white;
border-bottom: 1px solid rgba(#000, 0.1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use $black, not #000

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

max-width: 250px;
padding-bottom: 8px;
}
@media (min-width: 1260px) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, respond-to, not @media

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


if (this.props.isOwner) {
const highlight = this.state.highlightEditButton
? <div className="edit-highlight"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should replace this svg highlight with a separate highlighted-pen image (fine to do this in a followup bug)

@punamdahiya
Copy link
Contributor Author

@flodolo for localization changes are removal of strings, please review. Thanks

@punamdahiya
Copy link
Contributor Author

Updated promo card to align below header button bottom border.

It’s hard to accommodate seven 96px sizes button for header width around 1000px, thats why have to hide expire-info for header width between 960px and 1260px which are the breakpoints for large and extra-large widths.

Copy link
Collaborator

@flodolo flodolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(removals are always fine)

@punamdahiya
Copy link
Contributor Author

Thanks @flodolo . @chenba I have updated PR with feedback from @6a68, with slight changes to optimize promo card position. It will be great if you can give a quick look before we land in master. Thanks

Copy link
Collaborator

@chenba chenba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@punamdahiya punamdahiya merged commit 4290950 into mozilla-services:master Oct 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants