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

Convert tabs bar with Aphrodite #11530

Merged
merged 1 commit into from
Nov 7, 2017
Merged

Convert tabs bar with Aphrodite #11530

merged 1 commit into from
Nov 7, 2017

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Oct 14, 2017

Closes #11272

  • Remove tabs.less
  • Set color properties on theme.js
  • Ser default properties on tabIcon.js
  • BrowserButton component is applied to back/forward button and menu button on the tabs bar

Also:

  • Apply no-drag to the new tab button and tab area
  • Make the default icon large
  • Add will-change:opacity to the animations
  • Remove 'content' from theme.tab on theme.js

Test Plan: CXX=g++-4.8 NODE_ENV=test TEST_DIR=tab-components npm run testsuite

For QA team:

Test Plan:

  1. Test that tabs are pinnable
  2. Test that tabs are unpinnable
  3. Test that tabs are draggable to same tabset
  4. Test that tabs are draggable to alternate tabset
  5. Test that tabs can be teared off into a new window
  6. Test that you are able to reattach a tab that is teared off into a new window
  7. Test that tab pages can be closed
  8. Test that tab pages can be muted

Test Plan:

  1. Test that the area around tab page indicators is draggable
  2. Test that the gap between them is draggable

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.

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

@codecov-io
Copy link

codecov-io commented Oct 14, 2017

Codecov Report

Merging #11530 into master will increase coverage by 0.01%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master   #11530      +/-   ##
==========================================
+ Coverage   52.65%   52.66%   +0.01%     
==========================================
  Files         271      271              
  Lines       25715    25722       +7     
  Branches     4104     4104              
==========================================
+ Hits        13539    13547       +8     
+ Misses      12176    12175       -1
Flag Coverage Δ
#unittest 52.66% <83.33%> (+0.01%) ⬆️
Impacted Files Coverage Δ
app/renderer/components/styles/theme.js 100% <ø> (ø) ⬆️
app/renderer/components/styles/animations.js 100% <100%> (ø) ⬆️
...renderer/components/tabs/content/newSessionIcon.js 36.36% <100%> (ø) ⬆️
...p/renderer/components/tabs/content/audioTabIcon.js 31.64% <100%> (ø) ⬆️
app/renderer/components/styles/commonStyles.js 100% <100%> (ø) ⬆️
app/renderer/components/styles/global.js 100% <100%> (ø) ⬆️
app/renderer/components/tabs/content/tabIcon.js 65.21% <100%> (+6.12%) ⬆️
...p/renderer/components/tabs/content/closeTabIcon.js 35.71% <66.66%> (+0.93%) ⬆️
...pp/renderer/components/tabs/content/privateIcon.js 38.09% <71.42%> (ø) ⬆️
app/renderer/components/tabs/content/favIcon.js 35.52% <83.33%> (+1.74%) ⬆️
... and 3 more

@@ -17,8 +17,7 @@ const frameStateUtil = require('../../../../../js/state/frameStateUtil')

// Styles
const {theme} = require('../../styles/theme')
const {spacing, zindex} = require('../../styles/global')
const {opacityIncreaseKeyframes} = require('../../styles/animations')
const globalStyles = require('../../styles/global')
Copy link
Contributor Author

@luixxiul luixxiul Oct 15, 2017

Choose a reason for hiding this comment

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

Before doing that task, let's open an issue to edit this section on docs/style.md to achieve a common understanding.

opened here -> #11540

boxSizing: 'border-box',
zIndex: zindex.zindexTabsThumbnail,
zIndex: globalStyles.zindex.zindexTabsThumbnail,
Copy link
Contributor Author

@luixxiul luixxiul Oct 15, 2017

Choose a reason for hiding this comment

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

Ditto #11540

@luixxiul luixxiul added this to the 0.22.x (Nightly Channel) milestone Oct 16, 2017
@bbondy bbondy modified the milestones: 0.22.x (Nightly Channel), Backlog Oct 25, 2017
@@ -22,7 +24,7 @@ class TabPages extends React.Component {
}

render () {
return <div className='tabPageWrap'>
return <div className={css(styles.tabPageWrap)}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It'll be renamed into tabPages (Wrap is not required with BEM naming)

border: 'none',

':hover': {
border: `1px solid ${theme.tabPage.active.hover.borderColor}`
Copy link
Contributor

Choose a reason for hiding this comment

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

active tab page should have the same state when hovering (filled orange)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On theme.js, they are set like this:

    tabPage: {
      backgroundColor: '#fff',
      borderColor: '#bbb',

      hover: {
        borderColor: globalStyles.color.braveOrange
      },

      active: {
        backgroundColor: globalStyles.color.braveOrange,

        hover: {
          borderColor: globalStyles.color.braveOrange
        }
      }

So they should be same by default. Is it OK?

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure what is happening but this is what I'm seeing now:

nov-03-2017 23-53-46

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe you should enforce the background color on hover for the active tab page too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wow nice find! I addressed that here: 0582859#diff-b39b5cd9b6e26e313c7387108e17891cR198

Copy link
Contributor

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

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

lgtm

Closes #11272

- Remove tabs.less
- Set color properties on theme.js
- Ser default properties on tabIcon.js
- BrowserButton component is applied to back/forward button and menu button on the tabs bar

Also:
- Apply no-drag to the new tab button and tab area
- Make the default icon large
- Add will-change:opacity to the animations
- Remove 'content' from theme.tab on theme.js

Test Plan:
1. Test that tabs are pinnable
2. Test that tabs are unpinnable
3. Test that tabs are draggable to same tabset
4. Test that tabs are draggable to alternate tabset
5. Test that tabs can be teared off into a new window
6. Test that you are able to reattach a tab that is teared off into a new window
7. Test that tab pages can be closed
8. Test that tab pages can be muted

Test Plan:
1. Test that the area around tab page indicators is draggable
2. Test that the gap between them is draggable
@luixxiul luixxiul removed the request for review from petemill November 7, 2017 05:38
@luixxiul luixxiul merged commit dcd661f into brave:master Nov 7, 2017
@luixxiul
Copy link
Contributor Author

luixxiul commented Nov 7, 2017

@cezaraugusto thanks for the review. I appreciate that very much ❤️ 😄

FYI: https://travis-ci.org/brave/browser-laptop/jobs/298379574 👍

@luixxiul luixxiul removed this from the Triage Backlog milestone Nov 7, 2017
@luixxiul luixxiul added this to the 0.22.x (Nightly Channel) milestone Nov 7, 2017
@luixxiul luixxiul deleted the refactor-tabs branch November 7, 2017 06:02
@petemill
Copy link
Member

petemill commented Nov 7, 2017

@luixxiul apologies for the delayed review. I was scared from all the changes I'll have to make to the PR which deals which new tab styles #11720! But thanks for putting the work in, and I look forward to merging with it.

cezaraugusto pushed a commit that referenced this pull request Nov 24, 2017
Also:
- Remove bookmarksToolbar.less (it is no longer necessary after #11530; See 405b0a4#diff-474538b5e876b82157a7e1b6228743e8)
- Specify the overflow indicator size

Closes #12066

Auditors: @cezaraugusto

Test Plan:
1. Add bookmarks as many as you see the overflow indicator on the bookmarks toolbar
2. Open about:preferences
3. Switch 'Bookmarks Bar' settings
4. Change the browser window's width
5. Make sure you see the overflow indicator on every setting
@bbondy bbondy modified the milestones: 0.22.x (Developer Channel), 0.23.x (Nightly Channel) Feb 25, 2018
@petemill
Copy link
Member

I'll have to move this milestone up to 0.22 (from 0.23) since #12565 is for 0.22 and is completely based on this refactor. Attempting merge to see if this is huge or not...

petemill pushed a commit to petemill/browser-laptop that referenced this pull request Mar 18, 2018
Convert tabs bar with Aphrodite
Conflicts:
 app/renderer/components/styles/animations.js
 app/renderer/components/styles/global.js
 app/renderer/components/styles/theme.js
 app/renderer/components/tabs/tab.js
@petemill petemill modified the milestones: 0.23.x (Developer Channel), 0.22.x (Beta Channel) Mar 19, 2018
@petemill
Copy link
Member

0.22.x 50f033f

petemill pushed a commit that referenced this pull request Apr 10, 2018
Fix styling of bookmarksToolbar.js

Also:
- Remove bookmarksToolbar.less (it is no longer necessary after #11530; See 405b0a4#diff-474538b5e876b82157a7e1b6228743e8)
- Specify the overflow indicator size

Closes #12066

Auditors: @cezaraugusto

Test Plan:
1. Add bookmarks as many as you see the overflow indicator on the bookmarks toolbar
2. Open about:preferences
3. Switch 'Bookmarks Bar' settings
4. Change the browser window's width
5. Make sure you see the overflow indicator on every setting
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.