blenderskool/untab

Highlight the currently active tab

tanishqvyas opened this issue · 4 comments

The unTab window shows results for all the currently open tabs in the browser windows. It would be great if it could show the currently active tab in a certain way.

I would propose the following two ways, although the developer must feel free to incorporate the feature as per his own liking.

  1. Use a different color to highlight the currently active tab
  2. Use an asterisk before the tab icon to represent the tab is currently active.

Good idea, it'll be an easy addition I think.

I'd prefer option 2 but with a better UI indicator. Choosing different color would create confusion between what's selected and what's active.

Good idea, it'll be an easy addition I think.

I'd prefer option 2 but with a better UI indicator. Choosing different color would create confusion between what's selected and what's active.

I tried implementing this using browser.tabs.query({ active: true, currentWindow: true }) in tabs.js

Due to the behaviour in chrome (CTRL+SHIFT+SPACE opens a new UnTab tab), the newly opened tab is matched with query, as opposed to the actual current tab (where the shortcut was pressed on), rendering the query quite useless in tabs.js.

Any ideas for an alternative implementation? Perhaps the query needs to be ran outside tabs.js and then the query output imported to tabs.js?

I also though it would be an easy addition :/

@brendan-c Interesting case. There was an active discussion going on in #70 to remove the active tab from results as it didn't make sense to show it(as user wouldn't want to switch to current tab itself). I'm still not sure if it improves the experience or makes it worse 😅(What do you say @tanishqvyas?)

So if the above changes go through, this issue will become irrelevant.
If we don't go ahead with the changes, then I think querying for current tab is still OK. UnTab only opens in a new tab when it can't open in the current tab which happens in only certain tabs in normal use(not always at least from my experience). The result in this case will obviously not make sense as active tab changed. I'm not sure how we can prevent this and also not increase complexity, maybe open UnTab in a browser popup instead of new tab? (I don't know if this is considered as a tab also). Stuff to think about!

The active tab is no longer shown in tabs-switching results. Hence, this issue is no longer relevant