-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hotkey for navigating to last tab before current one #14
Comments
We thought about using double tap on the hold key to activate going to the previously open tab, but realized that this would not work well because the hold key may perform an action (once #13 is fixed) if there is no given hotkey before its key release. We don't want people to accidentally escape out of things (if their hold key is the escape key). Therefore, we decided that the hotkey for this action should be the hold key + space bar. |
We should also make sure that the extension knows what the previous tab was even if we didn't use a hotkey to get to the current tab. Basically, we should probably have an event handler for the event of switching tabs that maintains what the previous tab was. |
I'm not sure how possible that is. How would we do that? Switching tabs is a browser-, not document-level event. Also, not sure that we necessarily want to do that; I'm thinking KeepTabs functionality should feel fairly encapsulated and separate from stuff you do with the normal browser shortcuts in case the user wants to do stuff "outside" of KeepTabs and let KeepTabs maintain its state (i.e. the last tab switched to with KeepTabs). Admittedly this is an obscure use case, so my objection stands more on the grounds of not knowing how to implement this. |
Note that I implemented this in the manner described in my previous comment; KeepTabs keeps track of the last tab navigated to via hotkeys, and not in general. If the user uses the mouse or built-in browser shortcuts to switch tabs, KeepTabs won't know about it for the sake of the quick-switching feature. I don't think this should cause much of a problem (and I also don't know a good way to implement it the more general way). |
I was wrong. Chrome API is more powerful than I considered: we can use https://developer.chrome.com/extensions/tabs#event-onActivated to keep track of the actual previous tab, navigated to with KeepTabs or not. @Sophtware, do you think we should switch to this behavior? |
Use hold key + space to switch to the last tab navigated to with KeepTabs. Like alt+tab OS window switching, but with only a history of 1. Doesn't work for navigation via tab search, and this will take a bit more work to fix, so will do in a separate future commit.
Something like alt+tab switching functionality, but I don't see a strong use case for extending the history of how many tabs you can "go back" beyond 1. Primary use case would be rapidly switching back and forth between 2 tabs (e.g. a tab with a messaging application, and a tab with an article you're discussing).
The text was updated successfully, but these errors were encountered: