-
Notifications
You must be signed in to change notification settings - Fork 672
Fix bug 1434558, swap search and toolbox components #4656
Fix bug 1434558, swap search and toolbox components #4656
Conversation
|
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? |
|
@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'); |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good structural changes :)
There was a problem hiding this comment.
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.
stephaniehobson
left a comment
There was a problem hiding this 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; |
There was a problem hiding this comment.
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%; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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), | ||
| )); |
There was a problem hiding this comment.
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), | ||
| )); |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$text-color?
|
This should also be tested with a touch screen, or at least a touch screen emulator :) |
|
Thank you for the review @stephaniehobson - I still need to update the PR but, I have addressed most of the items here except:
I will tick these of as I address them, and update the PR. |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
|
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 |
|
Ok, I know what the problem is with IE, will update the PR momentarily. |
|
@stephaniehobson I can't reproduce the issue with locales, they work for me: Some things to try:
|
jwhitlock
left a comment
There was a problem hiding this 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:
- Click in search. It hides the login area and expands
- 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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 login link tests work
|
@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! |
|
No problem, happy to do it. Next time, you might try: This runs the tests inside Docker, avoiding local setup of Python etc. |
|
@stephaniehobson, this looks good to me now. Do you want to have another look before merging? |
|
Ah nuts! How did I forget to test German - Will address this and update the PR. Thanks @jwhitlock |
|
Ok, both of the items raised by @jwhitlock and @stephaniehobson has been resolved. Thanks a lot for the thorough review o/\o |




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:
Using both
To-Do
Test in:
Code is good to review. Thanks!