feat: Add keybind for tabs-search
This PR attempts to add tabs search functionality as a single shortcut, trying to address #807.
My main idea is using gURLBar.search('% ') to open the search bar for tab with Alt+Q.
edit: I have successfully built zen with this patch, but I still need help to address the following issues:
Todos:
- [x] Update relevant translations, i.e.
zen-search-shortcut-tabs = Search Tabs. #155 - [x] Fix inconsistent behavior of tab key: pressing tab after opening the dialog will close it, unless some keyword have been typed. ~~Partially fixed by implementing a hacky workaround to simulate events (keypress arrow down + select text)~~ fixed
- [x] Enable shift+alt+q for iterating selection in reverse direction.
Related issues:
- [x] Preferably sort the tabs by order of recently opened. Edit: seems like the ordering is controlled by firefox's frecency algorithm. Modifying this may have unintended consequences on the accuracy of URL suggestions.
- [x] Fix selecting switch to this tab for unloaded tab will open a new tab instead. Will receive the following error message: Tried to switch to non existant tab ~(FF Bug 1865757 in UrlbarInput.sys.mjs)~.
Workflow:
- Pressing Alt+Q opens the UrlBar with the suggested tabs ordered by recently accessed.
- To switch to the most recently opened tab (top suggestion), the user can directly press Alt+Q followed by Enter.
- To search recent tab, the user can press Alt+Q, type in the keyword, and press Enter to switch to the top suggestion.
- To select the next suggestion, the user can press Alt+Q again, or press Shift+Alt+Q to select the previous suggestion.
I managed to hack around the firefox's database, and tracked the last time the tab is being selected.
Now it's possible to sort the tab suggestion by the last time tab being opened. It should work for unloaded tabs and tabs in another workspace as well.
https://github.com/user-attachments/assets/02c186f5-5957-45d9-bc29-a9e628825de6
Awesome work! Really hope this can be incorporated into the core (either in Zen or in FF itself!)
Ctrl+L and type % to search tabs
Ctrl+L and type % to search tabs
This PR mainly adds keybind for that along with some improvements. https://github.com/zen-browser/desktop/discussions/807#discussioncomment-13177339
Awesome work man! Need this merged asap. The default imprelemtation is driving me crazy.
also @rstanuwijaya, is it possible make it configurable to any key-binding (if not already implemented)?
also @rstanuwijaya, is it possible make it configurable to any key-binding (if not already implemented)?
already implemented, but the translation outside english is not yet complete
@rstanuwijaya first of all thanks for the work. Would you know the reason with it is not integrated already? Looks like it is completed end to end
Hello! Was curious about tab search and ended up finding this PR. Are there any issues with it right now?
Hey, I will try to work on this again some time when I have more time :)
The approach I was doing was quite hacky though, so I'm not sure whether it will fit in the code base or not.
Maybe @mr-cheffy can help to briefly review and advice?
any updates on merging this PR? Have been wanting this feature since the begining