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

Private tab/Session tab icon needs right padding before text #6031

Merged
merged 1 commit into from
Dec 9, 2016

Conversation

jkup
Copy link
Contributor

@jkup jkup commented Dec 5, 2016

  • 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).

Fix #5936

Auditors @bradleyrichter @bsclifton

Test Plan:

  1. Open Brave
  2. Open a private tab
  3. Open a new session
  4. Open a tab that plays audio
  5. Make sure there is space after the private-eye, session-person and audio icon like in the screenshot below.

screen shot 2016-12-05 at 5 03 31 pm

@jkup jkup added design A design change, especially one which needs input from the design team. feature/tabsbar QA/test-plan-specified labels Dec 5, 2016
@jkup jkup added this to the 0.13.0 milestone Dec 5, 2016
@jkup jkup force-pushed the private-session-padding branch from d6ac1c8 to 3a7cf28 Compare December 6, 2016 01:06
@jkup
Copy link
Contributor Author

jkup commented Dec 6, 2016

@bsclifton updated!

@bsclifton bsclifton force-pushed the private-session-padding branch from 3a7cf28 to b2c270b Compare December 6, 2016 08:01
@bsclifton
Copy link
Member

bsclifton commented Dec 6, 2016

I pulled this up and tried a few configurations and got it to break

screen shot 2016-12-06 at 1 06 29 am

In the above pic, notice how the audio icon has no margin-left ☹️ Here's my thoughts:

  • we can consider making each icon that can go into a tab the same element type and give each a common classname. Right now, private/session are divs and the audio is a span
  • we can then use nth selectors to optionally add the left margin 😄

(if it's easy enough, this might be a great chance to try it out as an Aphrodite component; it could be a new tabIcon component or similar)

@bsclifton bsclifton mentioned this pull request Dec 6, 2016
3 tasks
@jkup jkup force-pushed the private-session-padding branch from b2c270b to fa5e5af Compare December 7, 2016 06:13
@jkup jkup changed the title Private tab/Session tab icon needs right padding before text [WiP] Private tab/Session tab icon needs right padding before text Dec 7, 2016
@bsclifton
Copy link
Member

@jkup I saw this is using the Aphrodite components! Let me know when it's ready for review 😄 (PS- I saw the audio icon was accidentally checked in as pink)

@jkup jkup force-pushed the private-session-padding branch 3 times, most recently from 1762ce1 to 8c42092 Compare December 8, 2016 00:26

class AudioTabIcon extends ImmutableComponent {
render () {
return <TabIcon withBlueIcon {...this.props} />
Copy link
Member

@bsclifton bsclifton Dec 8, 2016

Choose a reason for hiding this comment

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

😻 (love all the things that happen with this one line)

Copy link
Member

@bsclifton bsclifton Dec 8, 2016

Choose a reason for hiding this comment

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

I wonder if there's a clean way to eliminate the mapping, since it's almost redundant;
ex: this returns withBlueIcon, which then maps itself to styles.blueIcon...

Can we have an array of styles? and then expand using a spread (in the parent)
<TabIcon customStyles={[styles.blueIcon]} {...this.props} />

===>

class TabIcon extends ImmutableComponent {

  //...

  render() {
    const styles = [].concat(this.props.customStyles || [])
    className = css(...styles)

    //...

statsLightGray: '#999999',
defaultIconBackground: '#F7F7F7'
}

Copy link
Member

Choose a reason for hiding this comment

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

I mentioned over Slack, but these may (or may not) be better if they were partitioned into logical groups, like color, zindex, breakpoint, etc. Pros of this:

  • could be split into another file easily
  • if (in the future) there were no references in the code to that file, standard.js would raise a lint error / webpack should exclude it

Curious what others think? @cezaraugusto @bbondy @luixxiul

For me personally, I'm good with this as-is: the list is fairly short though and I think it may make more sense to update this in iterations 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated it with my understanding of what would be good! Would love to hear comments!

@@ -0,0 +1,47 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
Copy link
Member

Choose a reason for hiding this comment

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

Just noticed this now- the new preferred location for components would be in:
app/renderer/components 😄

This lets us easily break up the rendering portion (client side JavaScript) and the browser portion (which has access to node / makes use of muon (electron))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved!

this.props.tab.get('audioMuted')
})}
if (this.props.tab.get('audioPlaybackActive') && !this.props.tab.get('audioMuted')) {
iconClass = 'fa fa-volume-up'
Copy link
Member

@bsclifton bsclifton Dec 8, 2016

Choose a reason for hiding this comment

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

These class names (along with the other FontAwesome class names) might be a natural fit into the global styles?

For example:

const globalStyles = {
  //..
  classAudioPlayingIcon: 'fa fa-volume-up',
  classAudioMutedIcon: 'fa fa-volume-off',
  //...
}

@@ -18,6 +18,8 @@ const dnd = require('../dnd')
const windowStore = require('../stores/windowStore')
Copy link
Member

Choose a reason for hiding this comment

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

If you move the new tabIcon component to the new location (app/renderer/components), you may consider moving this too 😄 If moved, you'll have to update the paths for the requires here and then also anywhere that includes this (ex: tabs, pinnedtabs)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it's all good with you, I might try moving tab.js later. I tried moving it now but it has a lot of deps to move around.

Copy link
Member

Choose a reason for hiding this comment

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

sounds good! 😄

@bsclifton
Copy link
Member

Comments left... great job! 😄 Using Aphrodite will be a huge step forward with regard to stabilizing and encapsulating our styles (which gives us more confidence about making future changes)

@jkup jkup force-pushed the private-session-padding branch from 8c42092 to d8f5292 Compare December 8, 2016 04:24
@bsclifton
Copy link
Member

bsclifton commented Dec 8, 2016

@cezaraugusto did you want to check this out too? I know you're working in the same code right now 😄

(otherwise, LGTM!)

@bradleyrichter
Copy link
Contributor

I made some design changes that should help clean up some of our issues too.

When should we roll it in?

image

@bsclifton
Copy link
Member

@bradleyrichter @cezaraugusto is working on that issue; I'll share your image there 😄

@bsclifton bsclifton changed the title [WiP] Private tab/Session tab icon needs right padding before text Private tab/Session tab icon needs right padding before text Dec 9, 2016
@bsclifton bsclifton merged commit 4651b19 into master Dec 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design A design change, especially one which needs input from the design team. feature/tabsbar
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants