Hide unnecessary tab over treeview in Version 1.17?


#1

1.17 appears to have introduced a tab over the treeview - while there was none in 1.16. Does anyone know what purpose this tab serves? It seems to take up unnecessary screen real estate. Can it be hidden?


#2

Yes. This, and the little panel/dock tab that slides in/out on focus of treeview.


#3

Both of these additions are features of the new docks system that was introduced in 1.17.0.


#4

Can it be turned off or removed? It has a number of annoying side effects:

  • The tree view pane now takes focus. For example, I have a tool bar button bound to “build-tools” and I link it to my ant build.xml file. I used to be able to run a build task from anywhere, but if I have clicked on the tree view it retains focus which is out of scope of the build tool, so no menu of tasks shows up. I have to click in an edit window and try again.

  • It takes up unnecessary space on the screen. This is not a big deal but is not what I’m used to seeing, Also, it always says “Project”, so it seems kind of pointless.

  • Because it takes focus the word “Project” gets displayed on the application title bar (on Windows anyway). If you have a couple of Atom instances open this makes it hard to determine which one you were just editing (especially as Windows has a habit of rearranging the order of things in the task bar).


#5

How are you defining this button, for the tool bar package?

It takes up unnecessary space on the screen. This is not a big deal but is not what I’m used to seeing, Also, it always says “Project”, so it seems kind of pointless.

It does seem pointless, but I suspect that the future will contain more dock items and more informative tabs. In the mean time, you can nix that element by putting the following in your styles.less:

atom-dock .tab-bar {
  display: none;
}

Because it takes focus the word “Project” gets displayed on the application title bar (on Windows anyway). If you have a couple of Atom instances open this makes it hard to determine which one you were just editing (especially as Windows has a habit of rearranging the order of things in the task bar).

This is a more serious issue that I bet the devs didn’t notice. It seems like it should be a simple matter of telling Atom to treat dock tab titles differently from pane tab titles.


#6

I’m using the flex-tool-bar package and the button is configured to use the callback “build-tools:commands”.

And thanks for the style tip - that does the job nicely!


#7

Okay, try this. In init.coffee, add the following:

atom.commands.add 'atom-workspace', 'custom:build-tools-wrapper', ->
  atom.commands.dispatch document.querySelector('atom-text-editor'), 'build-tools:commands'

Then change the command in flex-tool-bar to custom:build-tools-wrapper and let me know if it works for you.


#8

Ah! A cunning plan, but it didn’t work - I get the same behaviour as before (i.e. if the tree view has focus then the build tools commands do not display).


#9

Bizarre. In that case, it’s beyond my ability to troubleshoot or outwit and the only solution is to manually click on the text editor before using that command, until/unless the devs tweak the docks so that they don’t take focus in that way.


#10

Well I can live with that! I know that docks are a new thing so I’m sure they’re due for a bit of a shake down. Thanks for your help!


#11

If that tab that shows up when you hover over the tree view annoys you as much as it does for me, you can add this to your stylesheet as well:

.atom-dock-toggle-button-visible {
  display: none;
}

#12

Here’s the only thing that I could figure out:

In your “init.coffee” file (user folder > .atom > init.coffee)

# Your init script
# ... etc ...

projElem = document.querySelector('[data-type="TreeView"]')
projElem.parentNode.style.display = "none"

Project Title in Tree View Tab (help wanted)
#13

You might find it more convenient to use my CSS-based answer above.


#14

The CSS method hides all tabs – including your open pages.

The init.coffee method targets just the project panel. While I would prefer a pure CSS solution, CSS doesn’t allow selecting a parent from a child selector (we’re lucky to have the [data-type"TreeView"] that noly exists in the project panel).

If there’s anyone on the Atom team, it would be nice to have more handles (like data-type’s) so we can CSS selector them.


#15

No, it only hides tabs in docks. You can further refine it to only hide tabs in the left dock with

atom-dock.left .tab-bar {
  display: none;
}

The init.coffee method targets just the project panel.

Since the introduction of docks in 1.17, the tree view has lived in a dock item, not a panel. That’s why it has a tab now (it was a panel previously).


#16

Nice. Sheesh, I spent a good 2 hours looking for unique handles to the “projects” pane. I was looking too far down the node tree…

I finally gave up and went the coffee script way after banging my head against the wall. (This thread’s original CSS code(s) applied to all tabs.)

Nice work with the “.left” – maybe I should change my name to boob1.


#17

@DamnedScholar : Thank you for volunteering Bob some of your time.

@bob1: (smile) Instead of name calling, let’s take another approach…
Bob - Good to meet you. Welcome!

Feel free to … return with more questions;
or to pay it forward with answering someone’s question,
or even to give @DamnedScholar a well deserving LIKE.


#18

I changed it to

atom-dock.left .tab-bar .tab:only-child {
	display: none;
}

That way it will only hide the tab if the tree-view is the only dock item.

screenshot