Skip to content

feat: Add keybind for tabs-search #8272

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

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from

Conversation

rstanuwijaya
Copy link

@rstanuwijaya rstanuwijaya commented May 13, 2025

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:

  • Update relevant translations, i.e. zen-search-shortcut-tabs = Search Tabs . #155
  • 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
  • Enable shift+alt+q for iterating selection in reverse direction.

Related issues:

  • 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.
  • 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.

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. Feature labels May 13, 2025
@rstanuwijaya rstanuwijaya changed the title Attempt to add keybind for tabs-search feat: Attempt to add keybind for tabs-search May 14, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels May 15, 2025
@rstanuwijaya
Copy link
Author

rstanuwijaya commented May 15, 2025

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.

Screencast.From.2025-05-16.00-56-49.mp4

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels May 15, 2025
@rstanuwijaya rstanuwijaya changed the title feat: Attempt to add keybind for tabs-search feat: Add keybind for tabs-search May 15, 2025
@vraravam
Copy link
Contributor

Awesome work! Really hope this can be incorporated into the core (either in Zen or in FF itself!)

@yokoffing
Copy link

Ctrl+L and type % to search tabs

@rstanuwijaya
Copy link
Author

Ctrl+L and type % to search tabs

This PR mainly adds keybind for that along with some improvements.
#807 (reply in thread)

@fahidsarker
Copy link

Awesome work man! Need this merged asap. The default imprelemtation is driving me crazy.

@fahidsarker
Copy link

also @rstanuwijaya, is it possible make it configurable to any key-binding (if not already implemented)?

@rstanuwijaya
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants