Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

Conversation

@schalkneethling
Copy link

@schalkneethling schalkneethling commented Feb 8, 2018

This is to swap the toolbox and search components in the site header. This also required a number of changes to the header overall.

So far I have tested this in:

  • Chrome
  • Firefox
  • Safari

Using both

  • en-US
  • fa

To-Do

Test in:

  • IE 11
  • Edge
  • IE 10 (as a basic sanity check)

Code is good to review. Thanks!

@jwhitlock
Copy link
Contributor

Thanks @schalkneethling. This looks like a good refactoring of the base template, although I'll need to look closer to see exactly what moved where. Will Feb 13 work for a detailed review, or do you need it sooner?

@schalkneethling
Copy link
Author

@jwhitlock That works for me. Thanks!

var navMainSearchForm = document.getElementById('nav-main-search');
var searchInput = document.getElementById('main-q');
var searchTrigger = navMainSearchForm.querySelector('.search-trigger');
var searchWrap = navMainSearchForm.querySelector('.search-wrap');
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice modern JS.

@import 'structure/main-header';
@import 'structure/submenu';
@import 'structure/page-header/main-header';
@import 'structure/page-header/submenu';
Copy link
Contributor

Choose a reason for hiding this comment

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

Good structural changes :)

Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to preserve the git history for these moved pages you can move them in a separate PR where you don't edit the files. This might be complicated rebase dance so it's not a blocker.

Copy link
Contributor

@stephaniehobson stephaniehobson left a comment

Choose a reason for hiding this comment

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

I like how you split some of the templates up into smaller macros :) But I'm not seeing the translated strings show up in my local dev anymore. @jwhitlock Is this something that will be fixed after the strings are scraped or will they need to be translated again?

The navigation menu names are longer in some locales and I think there are problems at around 1024px in German when logged in. (This is true of what's in production though so maybe not a blocker.)

The entire black square around the search icon needs to be clickable. And you can fix Bug 1384653!

"Skip to search" in the a11y nav menu should trigger the animation and put focus on the search field.

I can't tab to the search field anymore.

I think the above two things used to work because the input field did not have a aria-hidden="true" value on it so it could be focused. If you want to change to require interaction with the search icon to trigger the field you should make that span into a button.

I'm glad to see this change happening! It's a real improvement over what's there now.


> a {
color: #fff;
color: #333;
Copy link
Contributor

Choose a reason for hiding this comment

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

$text-color variable?

}

.login-photo {
border-radius: 50%;
Copy link
Contributor

Choose a reason for hiding this comment

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

Round photo 💯

border-top: 5px solid $grey-light;

.toolbox {
text-align: right;
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs bidi

}

input[type='search'] {
color: #333;
Copy link
Contributor

Choose a reason for hiding this comment

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

$text-color?

));
@include bidi((
(right, auto, auto),
));
Copy link
Contributor

Choose a reason for hiding this comment

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

These declarations should be inside the same mixin:

@include bidi((
    (left, 30%, 30%),
    (right, auto, auto),
));

));
@include bidi((
(text-align, left, right),
));
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be combined:

@include bidi((
   (right, 0, left, 0),
   (text-align, left, right),
));

box-shadow: 0 4px 4px rgba(0, 0, 0, .15);
background-color: #fff;
@include bidi((
(right, 0, left, 0),
Copy link
Contributor

Choose a reason for hiding this comment

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

Right needs to be set to auto when left is set.

(right, 0, left, auto),

@include large-inline-nav-item();

> a {
color: #333;
Copy link
Contributor

Choose a reason for hiding this comment

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

$text-color?


&:hover,
&:focus {
color: #333;
Copy link
Contributor

Choose a reason for hiding this comment

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

$text-color?

@stephaniehobson
Copy link
Contributor

This should also be tested with a touch screen, or at least a touch screen emulator :)

@schalkneethling
Copy link
Author

schalkneethling commented Feb 12, 2018

Thank you for the review @stephaniehobson - I still need to update the PR but, I have addressed most of the items here except:

  • The entire black square around the search icon needs to be clickable. And you can fix Bug 1384653!
  • "Skip to search" in the a11y nav menu should trigger the animation and put focus on the search field.
  • I can't tab to the search field anymore.

I will tick these of as I address them, and update the PR.

@codecov-io
Copy link

codecov-io commented Feb 12, 2018

Codecov Report

Merging #4656 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4656      +/-   ##
==========================================
- Coverage   95.27%   95.27%   -0.01%     
==========================================
  Files         261      260       -1     
  Lines       23571    23554      -17     
  Branches     1692     1692              
==========================================
- Hits        22458    22441      -17     
  Misses        902      902              
  Partials      211      211
Impacted Files Coverage Δ
kuma/settings/common.py 92.57% <ø> (ø) ⬆️
kuma/wiki/tests/test_views_document.py 99.27% <0%> (-0.02%) ⬇️
kuma/wiki/jobs.py 97.29% <0%> (ø) ⬆️
kuma/wiki/tests/test_signals.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2871015...1613744. Read the comment docs.

@schalkneethling
Copy link
Author

IE 11 is turning out to be a heck of a thing to test. Seems like VirtualBox does not play nice with High Sierra :-/ From the bit I could test so far, it seems these media queries[1] are not being applied in IE11

[1] https://github.com/mozilla/kuma/pull/4656/files#diff-db0e18eb73f5b50ef87c887f6567253fR137

@schalkneethling
Copy link
Author

Ok, I know what the problem is with IE, will update the PR momentarily.

@jwhitlock
Copy link
Contributor

@stephaniehobson I can't reproduce the issue with locales, they work for me:

screenshot 2018-02-12 10 30 46

Some things to try:

  • Is the locale/ folder present? A git submodule update --init would fix it.
  • Re-compile locales with docker exec -i kuma_web_1 make localecompile

Copy link
Contributor

@jwhitlock jwhitlock left a comment

Choose a reason for hiding this comment

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

I think @stephaniehobson's review is sufficient for the front end changes.

The hashed assets build, so you got the settings right ✅

Here's an interesting interaction (Firefox, Chrome) that might be fixable:

  1. Click in search. It hides the login area and expands
  2. Click below or above the search text input. The search box starts to collapse, then bounces back open. The login area is exposed again.

The functional tests for the search header are broken. They expect that the menus (Technologies, References & Guides, Feedback) will be hidden when the search box is exposed. This could be updated to expect the login area to be hidden. @schalkneethling, do you want to get into Kuma functional testing, or do you want me to add a commit?

report_bug_form_url = 'https://bugzilla.mozilla.org/form.mdn'
# locators
SIGNIN_SELECTOR = '#nav-sec .login-link'
SIGNIN_SELECTOR = '#toolbox .login-link'
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 login link tests work

@schalkneethling
Copy link
Author

@jwhitlock Fixed the problem you identified. I tried my hand at running the tests locally but, I keep running into walls with various Python and virtualenv error. In the interest of time, I would appreciate it if you could commit the fix for the failing test(s) - Thanks!

@jwhitlock
Copy link
Contributor

No problem, happy to do it.

Next time, you might try:

scripts/run_functional_tests.sh tests/functional/test_search.py 

This runs the tests inside Docker, avoiding local setup of Python etc.

@jwhitlock
Copy link
Contributor

@stephaniehobson, this looks good to me now. Do you want to have another look before merging?

@jwhitlock
Copy link
Contributor

Ah, there are some interesting breakpoints in German:

screenshot 2018-02-13 12 10 12

@schalkneethling
Copy link
Author

schalkneethling commented Feb 13, 2018

Ah nuts! How did I forget to test German - Will address this and update the PR. Thanks @jwhitlock

@stephaniehobson
Copy link
Contributor

Mobile Safari is putting the rounded corners on the search field 😖

screen shot 2018-02-13 at 14 16 36

All the interactions work with touch ☝️

@schalkneethling
Copy link
Author

Ok, both of the items raised by @jwhitlock and @stephaniehobson has been resolved. Thanks a lot for the thorough review o/\o

@jwhitlock
Copy link
Contributor

New "middle" layout works for German, Russian, etc.

screenshot 2018-02-14 09 55 58

@jwhitlock jwhitlock merged commit 821fabe into mdn:master Feb 14, 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.

4 participants