atom-material / atom-material-ui

A dynamic UI theme for Atom that follows Google's Material Design Guidelines
MIT License
817 stars 204 forks source link

Atom tabs switch-list does not appear #359

Closed jonyeezs closed 7 years ago

jonyeezs commented 7 years ago

Using Atom's tab package for tab-switching, had the tab switch disabled.

The class on that element is select-list tabs-mru-switcher

Reproduction Steps:

Settings for atom-material-ui:

Settings for tabs:

Using ctrl-tab to switch tabs keybindings

'body':
  'ctrl-tab': 'pane:show-next-recently-used-item'

'body':
  'ctrl-tab ^ctrl': 'pane:move-active-item-to-top-of-stack'

Expected behavior:

Observed behavior:

Atom version: v1.14.3 OS and version: Windows 10

Installed packages:

https://atom.io/packages/tabs

tumido commented 7 years ago

Let's wait what @silvestreh will show us when the sneaky 2.0 branch is merged and released. ;) I was wondering, when I was reading the 1.14 Atom release notes, why this list is not showing up for me, so I found your ticket and investigated the issue. This is a workaround, I've been able to come up with:

  1. Open the lib/tabs-settings.js file (located in this package sources in .atom/packages/atom-material-ui/ folder)
  2. Remove lines 41 to 47 containing:

    atom.workspace.onDidChangeActivePaneItem(() => {
    var activeTab = document.querySelector('.tab-bar .tab.active');
    
    if (activeTab && activeTab.click) {
        activeTab.click();
    }
    });
  3. Reload your Atom window via window:reload (or restart Atom)

The issue is, the code mentioned above is clicking on the newly selected tab (see activeTab.click();). That effectively hides the tabs list, because before it can be rendered, a new tab is "fully activated" and the list is not necessary anymore.

I've tried to figure out if removing the code has any impact on the package, but it behaves just fine for me and no other problems are introduced.

In addition, I would like to say that this should not be used as a fix as is. I pretty much enjoy the behavior when tab list is not shown. It feels a bit quicker to me. So I would be glad, if this can be introduced just as an option, via some toggle in settings. I actually like this bug, lol.

silvestreh commented 7 years ago

It's on the 2.0 branch, but requires Atom 1.17 (unfortunately, not even in the Beta channel)

captura de pantalla 2017-04-07 a las 22 45 56

I'll leave this issue open!

Also, thanks for pointing the error up, @tumido. That snippet is there because of another issue about the ripple effect not being present when switching tabs with the keyboard…

silvestreh commented 7 years ago

This is fixed in 2.0 which is available for Atom 1.17-beta users – at the cost of the ripple effect. I might reintroduce it later, but it'll start the effect in the center of the tab instead of the event's location.