Unbox
Unbox copied to clipboard
add newtab override
Changes the manifest.json so that the extension changes the new tab page. The user can use a drop down in the settings to go back to the default new tab page. Addresses #93
Thanks for sending this in! I was playing around with it some and one thing I noticed is that, when switching to an open tab, the "new-tab" (i.e. Tab Stash) tab still sticks around.
Another thing that seems to be different is that once a new tab is opened and becomes the active tab, the Tab Stash tab gets closed. (I assume this is because Tab Stash itself is the new-tab page, so the "close an unneeded new-tab page" logic kicks in.) This seems to happen even if the Tab Stash tab is pinned.
So I think there's a little more we need to do here to make the UX smooth:
- Don't close "new-tab" tabs if they're pinned
- DO close "new-tab" tabs if they're active (and unpinned) when switching to an existing open tab
And we may want to distinguish between "Tab Stash as a new-tab page" (where it closes itself when a user restores something) and "Tab Stash as a UI page" (where it keeps the existing behavior). Though I'm on the fence about this--I could see it working well both ways.
What are your thoughts?
Thanks a lot for the feedback! I agree that it makes sense to differentiate between the two: I don't think one expects explicitly opened stash-list-tabs to be closed like new tabs.
I've added a new-tab.html that is the same as the stash-list.html. This allows the extension to differentiate between the "Tab Stash as a new-tab page" and "Tab Stash as a UI page" by their URL. It might be nice to let the user know as well, I've tested a bit and it's easily doable with a v-if element that checks if the current tab has the new tab URL. Do you think this is useful, and if so, what kind of element should be inserted if it's a new tab? Just a little title or something?
This also means that "Tab Stash as a UI page" now behaves like they did before (not getting closed automatically), and the "Tab Stash as a new-tab page" behaves like the default new tab from Firefox (so it also gets closed even if pinned, should this be changed?). I don't know if I understand the second bullet point: As far as I can tell, the default new tab also stay open in this situation.
I've added a new-tab.html that is the same as the stash-list.html. This allows the extension to differentiate between the "Tab Stash as a new-tab page" and "Tab Stash as a UI page" by their URL.
I think you could do this even more simply by adding a query parameter to stash-list.html, something like stash-list.html?new-tab=true would probably do the trick. Then if you want to make behavioral changes, you could add another Vue property here and in stash-list/index.vue:
https://github.com/josh-berry/tab-stash/blob/master/src/stash-list/index.ts#L9
...and populate the Vue property from the URL in a manner similar to how we detect if we're in the sidebar or not: https://github.com/josh-berry/tab-stash/blob/master/src/launch-vue.ts#L24
It might be nice to let the user know as well, I've tested a bit and it's easily doable with a
v-ifelement that checks if the current tab has the new tab URL. Do you think this is useful, and if so, what kind of element should be inserted if it's a new tab? Just a little title or something?
I think it should be clear from context; IIRC Firefox will still title the page "New Tab" regardless, so there should be some clues there already.
This also means that "Tab Stash as a UI page" now behaves like they did before (not getting closed automatically), and the "Tab Stash as a new-tab page" behaves like the default new tab from Firefox (so it also gets closed even if pinned, should this be changed?). I don't know if I understand the second bullet point: As far as I can tell, the default new tab also stay open in this situation.
I think the key question is: "when/how does the Tab Stash UI close itself?", considering variables like "is this a new-tab UI vs. regular UI?" and "is the UI a pinned or unpinned tab?". And I think the behavior that makes the most sense (to me, anyway) is:
- If the UI tab is pinned:
- Keep the UI open even when the user restores something (regardless of whether it's a "new-tab" UI tab or a regular UI tab)
- Else:
- If the UI tab is a "new-tab" tab:
- Close the UI when the user restores something in the foreground
- Else:
- Keep the UI open
- If the UI tab is a "new-tab" tab:
Did that help or did I just confuse things further? 😆