Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ zen-key-select-tab-7 = Select tab #7
zen-key-select-tab-8 = Select tab #8
zen-key-select-tab-last = Select last tab
zen-key-show-all-tabs = Show all tabs
zen-search-tabs-shortcut = Search Tabs
zen-key-goto-history = Go to history
zen-key-go-home = Go Home
zen-bookmark-show-sidebar-shortcut = Show Bookmarks Sidebar
Expand Down
2 changes: 2 additions & 0 deletions src/browser/base/content/zen-commands.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@

<command id="cmd_zenDuplicateTab" />

<command id="cmd_zenSearchTabs" />

<command id="cmd_zenToggleLibrary" />
</commandset>
19 changes: 19 additions & 0 deletions src/browser/components/urlbar/content/UrlbarView-mjs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@ index 5a562d6385855264fc3bfdc3df02365f91543534..ef0faea64fe0a0ed029e5a73b376225e

// Search mode is active. Without results the view has nothing to show but
// the one-offs, so open it only when they will show.
@@ -1046,6 +1042,18 @@ export class UrlbarView {
// them, resembling tab-to-search. In that case, the input value is
// still associated with the first result.
this.input.setResultForCurrentValue(firstResult);
+ } else if (
+ this.input.searchMode?.source == UrlbarShared.RESULT_SOURCE.TABS
+ ) {
+ // In the tabs search mode results are never heuristic, so select the
+ // first one to let the user pick it right away. Keep the typed value
+ // intact in the input, otherwise further typing would edit it.
+ let firstSelectable = this.getFirstSelectableElement();
+ if (firstSelectable) {
+ this.#selectElement(firstSelectable, {
+ updateInput: false,
+ });
+ }
}
}

@@ -3302,6 +3298,8 @@ export class UrlbarView {
if (row?.hasAttribute("row-selectable")) {
row?.toggleAttribute("selected", true);
Expand Down
1 change: 1 addition & 0 deletions src/zen/common/zen-sets.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
cmd_zenCopyCurrentURL: () => gZenCommonActions.copyCurrentURLToClipboard(),
cmd_zenCopyCurrentURLMarkdown: () =>
gZenCommonActions.copyCurrentURLAsMarkdownToClipboard(),
cmd_zenSearchTabs: () => gURLBar.search("%"),

// Folders
cmd_zenOpenFolderCreation: () =>
Expand Down
13 changes: 13 additions & 0 deletions src/zen/kbs/ZenKeyboardShortcuts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,19 @@ class nsZenKeyboardShortcutsVersioner {

if (version < 21) {
// Migrate from version 20 to 21.
// Add a shortcut to focus the address bar in the "Tabs" search mode,
// letting the user search across all open tabs.
data.push(
new KeyShortcut(
"zen-search-tabs",
"E",
"",
"searchAndFind",
nsKeyShortcutModifiers.fromObject({ accel: true, shift: true }),
"cmd_zenSearchTabs",
"zen-search-tabs-shortcut"
)
);
// Add shortcut to toggle the library
data.push(
new KeyShortcut(
Expand Down