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

Increase pinned tabs width #10533

Merged
merged 1 commit into from
Sep 5, 2017
Merged

Increase pinned tabs width #10533

merged 1 commit into from
Sep 5, 2017

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Aug 16, 2017

Closes #10368

screenshot 2017-08-16 18 48 53

Auditors: @cezaraugusto

Test Plan:

  1. Open brave.com in a new tab
  2. Open github.com in another new tab
  3. Pin them
  4. Make sure the width of the pinned tabs is enough

Test Plan 2:

  1. Open example.com
  2. Pin the tab
  3. Make sure the default icon appears at the center of the pinned tab

Test Plan 3:

  1. Open youtube video
  2. Make sure the spacing around the audio icon, favicon and tab's title is equal

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

@luixxiul luixxiul added this to the 0.21.x (Nightly Channel) milestone Aug 16, 2017
@luixxiul luixxiul self-assigned this Aug 16, 2017
@luixxiul luixxiul requested a review from cezaraugusto August 16, 2017 09:38
@@ -68,12 +71,6 @@ const styles = StyleSheet.create({
overflow: 'hidden'
},

// Add extra space for pages that have no icon
// such as about:blank and about:newtab
noFavicon: {
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 is not called anywhere.

paddingLeft: globalStyles.spacing.defaultIconPadding,
paddingRight: globalStyles.spacing.defaultIconPadding
padding: 0,
width: `calc(${globalStyles.spacing.tabsToolbarHeight} * 1.1)`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

26px * 1.1 is nearly equal to the pinned tab width where the padding is increased from 2px to 4px.

Copy link
Contributor

Choose a reason for hiding this comment

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

this seems fragile to me. What if at a given point we decide to update tabs toolbar height?

pinned tabs sizing are also are not used anywhere else so I won't mind having the size explicitly described here.

alignSelf: 'center',
position: 'relative',
textAlign: 'center',
justifyContent: 'center',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need those.

@@ -17,14 +17,13 @@ const globalStyles = require('../../styles/global')
class TabIcon extends ImmutableComponent {
render () {
const styles = StyleSheet.create({
icon: {
tabIcon: {
Copy link
Contributor Author

@luixxiul luixxiul Aug 16, 2017

Choose a reason for hiding this comment

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

Replaced as it is confusing on debugging (we already have icon on styles/tab.js).

},

active: {
background: `rgba(255, 255, 255, 1.0)`,
height: globalStyles.spacing.tabHeight,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

redundant

Closes #10368

- Increase pinned tabs width
- Remove the hard-coded value from icon_audio

Also:
- Move styles.audioIcon to tabStyles.icon_audio
  - Avoid possibility of style inconsistency
- Add padding to icon_audio

Auditors: @cezaraugusto

Test Plan:
1. Open brave.com in a new tab
2. Open github.com in another new tab
3. Pin them
4. Make sure the width of the pinned tabs is as it should be

Test Plan 2:
1. Open example.com
2. Pin the tab
3. Make sure the default icon appears at the center of the pinned tab

Test Plan 3:
1. Open youtube video
2. Make sure the spacing around the audio icon, favicon and tab's title is equal
@codecov-io
Copy link

codecov-io commented Aug 17, 2017

Codecov Report

Merging #10533 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #10533      +/-   ##
==========================================
- Coverage   54.32%   54.31%   -0.01%     
==========================================
  Files         245      245              
  Lines       21159    21156       -3     
  Branches     3260     3260              
==========================================
- Hits        11494    11491       -3     
  Misses       9665     9665
Flag Coverage Δ
#unittest 54.31% <100%> (-0.01%) ⬇️
Impacted Files Coverage Δ
app/renderer/components/tabs/content/tabIcon.js 100% <ø> (ø) ⬆️
app/renderer/components/styles/global.js 100% <ø> (ø) ⬆️
app/renderer/components/styles/tab.js 100% <ø> (ø) ⬆️
...p/renderer/components/tabs/content/audioTabIcon.js 91.3% <100%> (-0.37%) ⬇️

@@ -61,17 +61,11 @@ class AudioTabIcon extends React.Component {

render () {
return <TabIcon
className={css(tabStyles.icon, styles.audioIcon)}
className={css(tabStyles.icon, tabStyles.icon_audio)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Specifying a style in each file will create style inconsistency quite easily.

@luixxiul luixxiul requested a review from cezaraugusto August 17, 2017 01:57
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.

I'm going to merge this given its working fine and the need for other task but please follow up my comment to avoid future regressions.

@cezaraugusto cezaraugusto merged commit 30e13fd into brave:master Sep 5, 2017
@cezaraugusto cezaraugusto deleted the fix-width-pinned-tabs branch September 5, 2017 00:17
@bbondy bbondy removed this from the 0.21.x (Developer Channel) milestone Oct 25, 2017
@luixxiul luixxiul added this to the 0.20.x (Beta Channel) milestone Oct 25, 2017
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.

4 participants