Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Refactor navigationBar with Aphrodite - first try #9299

Merged
merged 366 commits into from
Jul 3, 2017
Merged

Refactor navigationBar with Aphrodite - first try #9299

merged 366 commits into from
Jul 3, 2017

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Jun 7, 2017

Refactor navigationBar with Aphrodite

Addresses #9283

After first review I will did squash commits semantically, before switching the base branch from navigationBar-aphrodite to master. It will likely to create conflicts, so after fixing them I would like to ask @NejcZdovc for another review to check if it would not regress the recent Redux updates which have landed on master already.

Test Plans

Test Plan (obsolete styles)

  1. Search inputbar-wrapper on your repo
  2. Search navbarMenubarBlockContainer
  3. Search your repo for @siteEVColor
  4. Search your repo for @loadTimeColor
  5. Make sure nothing is found

Test Plan (automated tests):

  1. npm run test -- --grep='enables back button on first nav'
  2. npm run test -- --grep='back forward actions'
  3. npm run test -- --grep='loading same URL as current page with changed input'

Since automated tests cannot find visual regressions, please conduct these tests carefully from perspectives of clickability, draggability, animation, color, etc. Thanks!

Test Plan (top panel):

  1. Open about:preferences#advanced
  2. Enable Always show the URL bar
  3. Make sure the navigation bar is displayed, aligned horizontally
  4. Make sure the URL bar is displayed
  5. Make sure the buttons on the navigation bar are displayed
  6. Input something on the URL bar
  7. Make sure the URL bar is highlighted
  8. Set focus to input area on URL bar
  9. Make sure the blue outline is displayed
  10. Make sure margin-right:3px is applied
  11. Make sure border-radius:0 is applied

Test Plan (add bookmark icon)

  1. Make sure clicking the star icon bookmarks a page
  2. Make sure the bookmark star icon is filled
  3. Remove the bookmark
  4. Make sure bookmark star icon becomes blank

Test Plan (buttons inside the top panel):

  1. Open about:preferences#advanced
  2. Enable Always show the URL bar
  3. Open https://brave.com
  4. Make sure both bookmark button and add publisher button are rendered
  5. Click the bookmark star button container
  6. Make sure the page is bookmarked
  7. Remove the bookmark
  8. Make sure bookmark star icon becomes blank
  9. Make sure the whole container of the publisher button is clickable (click the edge of the button)

Test Plan (Publisher Toggle):

  1. Disable Brave Payments
  2. Open brave.com
  3. Make sure the empty container does not appear on the right of the URL bar

Test Plan (navigation buttons):

  1. Make sure go back and forward button do not have the background and box-shadow when they are disabled
  2. Click the edge of the reload button
  3. Make sure the button is clicked
  4. Click the edge of the load stop button
  5. Make sure the button is clicked
  6. Show the home button
  7. Click the edge of the button
  8. Make sure your home page is loaded

Test Plan (fullscreen mode)

  1. Enable the fullscreen mode
  2. Make sure the navigation buttons (go back/forward) are aligned to left

Test Plan (elements around the URL bar):

  1. Move your mouse pointer out of the top panel
  2. Make sure .urlbarForm does not have a white background
  3. Open about:preferences#advanced
  4. Disable the wide URL bar
  5. Change window width
  6. Make sure there is margin between the URL bar and the lion icon
  7. Make sure the URL bar appears at the center on the navigation bar

Test plan (loadTime)

  1. Open https://brave.com
  2. Click the loading timer
  3. Make sure the loading timer is displayed
  4. Make sure the loading timer cannot be selected

Test Plan (URL bar un/lock icon)

  1. Enter data:text/html,hi in the URL bar (ee79fc7)
  2. Make sure the triangle is red
  3. Open https://brave.com
  4. Make sure the fa-lock icon is green
  5. Open a new dashboard
  6. Make sure the search icon is grey
  7. Disable Always show the URL bar if not
  8. Open http://http.badssl.com/
  9. Make sure the unlock icon is not transparent in the title mode
  10. Make sure the urlbar icon (fa-un/lock or fa-search) is placed at the center of the icon's container
  11. Input :a to the URL bar
  12. Make sure styles.urlbarIcon is applied to the amazon favicon
  13. Move your mouse pointer out of the top panel
  14. Make sure the .urlbarForm does not have a white backgroundf
  15. Open about:preferenes
  16. Make sure the fa-list icon is moved down 1px on URL bar

Test Plan (NoScript):

  1. Block scripts
  2. Make sure NoScript icon on the URL bar is clickable
  3. Make sure the icon is large enough to be clicked easily
  4. Make sure the un/lock icon, bookmark icon, NoScript icon, and publisher button are aligned horizontally
  5. Make sure the padding between the URL bar edge and noScript button is 3px
  6. Allow scripts
  7. Make sure the padding between the URL bar edge and load timer is 10px

Test Plan (bookmark hanger)

  1. Bookmark a page
  2. Make sure arrowUp appears under the bookmark star icon
  3. Enable Home button
  4. Repeat the step 2

Test plan (for Windows)

  1. On Windows, make sure the specified styles are applied
  2. On Windows, make sure .topLevelStartButtons has padding-left:5px

Test Plan 8 (for macOS):

  1. On macOS, make sure .topLevelStartButtons has padding-left:76px
  2. On macOS, make the browser window to fullscreen
  3. Make sure the left buttons on the navigation bar is moved to the left
  4. Make sure the margin-right on navigator is gone

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@luixxiul luixxiul added this to the 0.18.x milestone Jun 7, 2017
@luixxiul luixxiul self-assigned this Jun 7, 2017
@luixxiul luixxiul modified the milestones: 0.19.x, 0.18.x (Frozen, only critical adds from here) Jun 11, 2017
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: globalStyles.navigationBar.urlbarForm.height,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

height, not width, is the basis.

@@ -134,8 +134,6 @@ const globalStyles = {
switchNubTopMargin: '2px',
switchNubLeftMargin: '2px',
switchNubRightMargin: '2px',
buttonHeight: '25px',
buttonWidth: '25px',
Copy link
Contributor Author

@luixxiul luixxiul Jun 11, 2017

Choose a reason for hiding this comment

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

Please search for buttonHeight and buttonWidth in case where they be used on anywhere.

@@ -70,3 +70,5 @@ httpse.leveldb

# sync bundle file should be built and copied from the brave/sync repo for now
app/extensions/brave/content/scripts/sync.js

package-lock.json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: drop the commit to remove this.

@@ -14,6 +14,7 @@ branches:
only:
- master
- /\d+\.\d+\.x/
- navigationBar-aphrodite
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: drop the commit to remove this.

const relativeIcon = this.isAboutPage

const insecure = isPotentialPhishingUrl(this.props.location) || (this.props.isHTTPPage && !this.props.active && (this.props.isSecure === false || this.props.isSecure === 2))
const large = isPotentialPhishingUrl(this.props.location) || (this.props.isHTTPPage && !this.props.active)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These cause a bug on fa-search icon. I'll fix it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed with 4ea852d

@cezaraugusto
Copy link
Contributor

@luixxiul are those TODOs made for a follow-up?

@luixxiul
Copy link
Contributor Author

luixxiul commented Jun 15, 2017

are those TODOs made for a follow-up?

I could work on them on this PR or another one. Still, I think it should be worked on this PR as merging the long names to master branch is not good for contributors (it might look too confusing and complicated for them).

Yet since the refactoring with Aphrodite is on lower priority, I have set navigationBar-aphrodite as a base branch, so I can work on the TODOs with a follow up PR on that branch, if that is better.

@cezaraugusto
Copy link
Contributor

I'm ok either way, up to you ✌(◕‿-)✌

@luixxiul
Copy link
Contributor Author

@cezaraugusto I wouldn't squash the commits until your review is done, so would you start working on review soon? thanks!

luixxiul pushed a commit that referenced this pull request Jul 3, 2017
Create components etc  -- navigator.js, navigationBar.js, urlBar.js etc

Full changelog: 8997c76

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 3, 2017
Full changelog: 25f02d4

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
- Convert 'buttonSeparator'

Full changelog: 25f02d4

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
.navbarMenubarBlockContainer (introduced with f2426f1#diff-303f0b6a297506f2cc18bf7b4cb370c5R789, which no longer exists on the master branch.)

.inputbar-wrapper (introduced with 0e57690#diff-02c4b23ad267fe636760179e32fa29ceR141 with no clear reason. Since .inputbar-wrapper has not been used, it can be removed safely.)

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
- Add styles.navigator
- Add reloadButton testId to .reloadButton
- Convert .navigatorWrapper
- Convert .navbarMenubarFlexContainer
- Convert .urlbarForm
- Convert .urlbarIconContainer
- Convert #titleBar
- Convert bookmarkButton and removeBookmarkButton with Aphrodite
- Convert 'navigationButton stopButton'
- Convert 'navigationButton reloadButton'
- Convert 'navigationButton homeButton'
- Convert .bookmarkButtonContainer
- Convert .topLevelEndButtons
- Convert .endButtons
- Rename .backforward to .topLevelStartButtons (as we have already had 'topLevelEndButtons' on the same level)
- Convert braveMenu

Full changelog: b76f995

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
Setting navigator__buttonContainer_outsideOfURLbar
to apply border to the bookmark button and publisher button only,

normalize size, placement, draggability etc of
- navigator__buttonContainer
- navigator__urlbarForm__buttonContainer_showNoScriptInfo
- navigator__urlbarForm__urlbarIconContainer

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
Full changelog: f81ea52

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
- Increase size of noScriptButton 1px
- Add urlbarForm_noScriptEnabled
- Add title mode animation with navigator_titleMode
- Convert .navigationButtonContainer
- Convert topLevelStartButtons
- Convert backButton and forwardButton
- Confert box-shadow of urlbarForm
- Convert input to urlbarForm__input
- Convert -webkit-app-region of form and input
- Convert urlbarForm_notTitleMode
- Convert urlbarForm.isPublisherButtonEnabled
- Convert input:focus + legend:before
- Convert #navigator .urlbarForm input (for Windows)
- Replace .loadTime with urlbarForm__titleBar__loadTime
- Replace loadtime data-test-id (urlBar.js etc)
- Refactor braveMenuButton
  - Replace height:24px with height:globalStyles.navigationBar.urlbarForm.height, which is 25px

Full changelog: 9b6c22d

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
Create components etc  -- navigator.js, navigationBar.js, urlBar.js etc

Full changelog: 8997c76

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
- Convert 'buttonSeparator'

Full changelog: 25f02d4

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
Full changelog: b76f995

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
Setting navigator__buttonContainer_outsideOfURLbar
to apply border to the bookmark button and publisher button only,

normalize size, placement, draggability etc of
- navigator__buttonContainer
- navigator__urlbarForm__buttonContainer_showNoScriptInfo
- navigator__urlbarForm__urlbarIconContainer

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
Full changelog: f81ea52

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
Full changelog: 9b6c22d

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
Full changelog: 8997c76

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 4, 2017
- Convert 'buttonSeparator'

Full changelog: 25f02d4

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 11, 2017
Full changelog: b76f995

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 11, 2017
Setting navigator__buttonContainer_outsideOfURLbar
to apply border to the bookmark button and publisher button only,

normalize size, placement, draggability etc of
- navigator__buttonContainer
- navigator__urlbarForm__buttonContainer_showNoScriptInfo
- navigator__urlbarForm__urlbarIconContainer

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 11, 2017
Full changelog: f81ea52

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 11, 2017
Full changelog: 9b6c22d

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 11, 2017
Full changelog: 8997c76

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 11, 2017
- Convert 'buttonSeparator'

Full changelog: 25f02d4

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 12, 2017
Full changelog: b76f995

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 12, 2017
Setting navigator__buttonContainer_outsideOfURLbar
to apply border to the bookmark button and publisher button only,

normalize size, placement, draggability etc of
- navigator__buttonContainer
- navigator__urlbarForm__buttonContainer_showNoScriptInfo
- navigator__urlbarForm__urlbarIconContainer

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 12, 2017
Full changelog: f81ea52

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 12, 2017
Full changelog: 9b6c22d

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 12, 2017
Full changelog: 8997c76

Test Plan: available on #9299 (comment)
luixxiul pushed a commit that referenced this pull request Jul 12, 2017
- Convert 'buttonSeparator'

Full changelog: 25f02d4

Test Plan: available on #9299 (comment)
@luixxiul luixxiul deleted the navigationBar-aphrodite branch August 15, 2017 10:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.