Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Create tabbed interface for GitHub features - #461

Merged
BinaryMuse merged 14 commits into
masterfrom
mkt-ku-add-tabbed-interface
Jan 21, 2017
Merged

BinaryMuse merged 14 commits into
masterfrom
mkt-ku-add-tabbed-interface

Conversation

@BinaryMuse

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread styles/git-panel.less Outdated
.github-PanelResizer {
// ok, yeah, magic number.. err color
background-color: mix(@base-background-color, @tool-panel-background-color);
// background-color: mix(@base-background-color, @tool-panel-background-color);

@BinaryMuse BinaryMuse Jan 20, 2017 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@simurai

I'm having some problems with this. Why is it that when I move this line........

Comment thread styles/tabs.less Outdated
flex: 1;
display: flex;
flex-direction: column;
// background-color: mix(@base-background-color, @tool-panel-background-color);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

.......to here, the color looks wrong?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, the color mix() is kinda custom. So either we could use it also in .github-Tabs-NavigationItem .active. Or use @tab-background-color-active for the .github-Tabs-PanelContainer.

I can play around with it, if you like.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@simurai That'd be great!! I'd also love to understand what I was doing wrong xD

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Basically I was trying to get the background behind the tabs to match the background behind the tree-view/tabs, and the rest of the panel to have your original BG color

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you uncomment here ☝️ .

@BinaryMuse

Copy link
Copy Markdown
Contributor Author

@simurai you'll need to run this to make the tabbed interface show up atom.config.set('github.githubEnabled', true)

@smashwilson smashwilson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking 💯 so far 😁

Comment thread lib/views/tabs.js Outdated
</nav>
<section className="github-Tabs-PanelContainer">
{children.map((child, i) => (
child && React.cloneElement(child, {active: i === this.props.activeIndex})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do these cloned elements need a key?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think toArray takes care of adding them in this case

Comment thread lib/views/tabs.js Outdated
}

Tabs.Panel = TabPanel;
export default Tabs;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason not to export default class Tabs { ... } up above?

For that matter I think you can do:

Tabs.Panel = class TabPanel extends React.Component {
  // ...
}

Just a style thing, but I think elsewhere we've tended to export at declaration site. I tend to prefer that myself because it makes it evident how to import a definition right at the declaration site without needing to hunt for the exports.

</EtchWrapper>
</Tabs.Panel>
{this.props.githubEnabled && (
<Tabs.Panel title="Hub">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hee hee, I still think that's great.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ya, let's leave it for a bit longer. 😂

Comment thread lib/github-package.js
repository={this.getActiveRepository()}
statusBar={this.statusBar}
savedState={this.savedState.gitController}
githubEnabled={this.config.get('github.githubEnabled')}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Feature flags ftw ✨

Comment thread styles/tabs.less Outdated
border: 1px solid @tab-border-color;
border-left: 2px solid @background-color-info;
border-bottom: none;
background: @tab-background-color-active;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

...and change ☝️ to background-color: mix(@base-background-color, @tool-panel-background-color);, then it should match.

@simurai simurai Jan 20, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But maybe panel tabs, shouldn't look like regular editor tabs. So that it doesn't feel like they are part of the tab-bar and would open a pane.

Maybe something more lightweight with just borders? Similar to the tabs here on github.com.

screen shot 2017-01-20 at 1 24 48 pm

@simurai

simurai commented Jan 20, 2017

Copy link
Copy Markdown
Contributor

Currently the tabs look like:

screen shot 2017-01-20 at 5 34 40 pm

But not sure, it feels uncanny. Also, because themes style the editor tabs (instead of the tabs package), it will be off/un-aligned for most themes. And pretty different for some. Here the atom-light-ui 🙈 :

screen shot 2017-01-20 at 5 38 23 pm

Hmm.. either we use the exact same markup + class names as the tabs package or we try to make it look less like tabs. Then it might be ok that they are different.

Here a version with underlines for the selection:

screen shot 2017-01-20 at 5 33 30 pm

Or use a "segmented control":

screen shot 2017-01-20 at 5 50 16 pm

Or use vertical tabs, like the go-plus package:

screen shot 2016-10-15 at 12 55 21 pm


I think I like the vertical tabs best. Also because there would be tons of space for more tabs. Like we wouldn't have to cram everything into just two panels but could have lots more. Downside is that it's limited to icons only. Or maybe with label if they are not too long.

@BinaryMuse

Copy link
Copy Markdown
Contributor Author

Oh good call. I like the last two options. I say we try vertical tabs and see how it feels.

@BinaryMuse

Copy link
Copy Markdown
Contributor Author

Hm the other downside to vertical tabs is you lose horizontal space all the way down the pane, instead of space just at the top...

@smashwilson

Copy link
Copy Markdown
Contributor

I kind of like the segmented control, personally.

I can't think of any other tabs we'd need to leave space for, and we could always change to vertical tabs if and when we need them.

@BinaryMuse

Copy link
Copy Markdown
Contributor Author

I experimented with the vertical tab list but it felt super weird... with only two icons there's a tooon of wasted space. I'm gonna go for the segmented UI for now and we can go from there if we want to change it.

@BinaryMuse

Copy link
Copy Markdown
Contributor Author

@simurai Would you mind taking a quick look at the most recent changes (mostly in 8d7d094) and changing anything as you see fit? In particular, I wasn't sure what .github-Tabs-NavigationItem.active.color should be.

init_coffee_ __github_atom_and_tabs_less ___github_github

@simurai

simurai commented Jan 21, 2017 •

Copy link
Copy Markdown
Contributor

@BinaryMuse We probably could use these "Selected buttons" from the styleguide. Then the selected color will be set by the themes.

screen shot 2017-01-21 at 9 09 29 am

<div class='btn-group'>
  <button class='btn selected'>Git</button>
  <button class='btn'>Hub</button>
</div>

@BinaryMuse

BinaryMuse commented Jan 21, 2017 •

Copy link
Copy Markdown
Contributor Author

@simurai The downside there is we have to change the Tab panel (which I plan on extracting) to use the button groups — but if that's really what makes the most sense here, I could make that work.

@simurai

simurai commented Jan 21, 2017

Copy link
Copy Markdown
Contributor

By "change the Tab panel", you mean change the markup and class names? Yeah, right.

If you wanna keep it custom, we can try using @button-background-color-selected for the selected background.

@simurai

simurai commented Jan 21, 2017

Copy link
Copy Markdown
Contributor

@BinaryMuse Ah, sorry, never mind. You're already using @button-background-color-selected. I guess you meant the (text) color. That's more tricky because it's hard to guess the background color. Less has contrast() function. I'll try to add that.

So it works for light and dark themes
So that the height still looks the same
So it matches other stuff like buttons or inputs. Also I think the
`:not()` selectors aren't really needed.
So it matches themes
In case they overflow, one day.
@BinaryMuse
BinaryMuse merged commit d05d13b into master Jan 21, 2017
@BinaryMuse
BinaryMuse deleted the mkt-ku-add-tabbed-interface branch January 21, 2017 03:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants