-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add workspaces search #12745
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
SilverEzhik
wants to merge
4
commits into
zen-browser:dev
Choose a base branch
from
SilverEzhik:spaces-search
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add workspaces search #12745
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,21 @@ | ||
| diff --git a/browser/components/urlbar/UrlbarPrefs.sys.mjs b/browser/components/urlbar/UrlbarPrefs.sys.mjs | ||
| index ec7b7eeee7999aba76286e84808ed09ffc6df463..12bfafdc7e34c5d6345579cd0aaf515a19d82b31 100644 | ||
| index ec7b7eeee7999aba76286e84808ed09ffc6df463..65154e4b78e391ceca19c629aa3309d9fc52966e 100644 | ||
| --- a/browser/components/urlbar/UrlbarPrefs.sys.mjs | ||
| +++ b/browser/components/urlbar/UrlbarPrefs.sys.mjs | ||
| @@ -760,6 +760,7 @@ function makeDefaultResultGroups({ showSearchSuggestionsFirst }) { | ||
| @@ -454,6 +457,7 @@ const PREF_URLBAR_DEFAULTS = /** @type {PreferenceDefinition[]} */ ([ | ||
| ["shortcuts.tabs", true], | ||
| ["shortcuts.history", true], | ||
| ["shortcuts.actions", true], | ||
| + ["shortcuts.workspaces", true], | ||
|
|
||
| // Boolean to determine if the providers defined in `exposureResults` | ||
| // should be displayed in search results. This can be set by a | ||
| @@ -791,6 +795,8 @@ function makeDefaultResultGroups({ showSearchSuggestionsFirst }) { | ||
| */ | ||
| let rootGroup = { | ||
| children: [ | ||
| + { children: [{ group: lazy.UrlbarUtils.RESULT_GROUP.ZEN_ACTION }] }, | ||
| + { children: [{ group: lazy.UrlbarUtils.RESULT_GROUP.ZEN_WORKSPACE }] }, | ||
| // heuristic | ||
| { | ||
| maxResultCount: 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/browser/components/urlbar/UrlbarTokenizer-sys-mjs.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| diff --git a/browser/components/urlbar/UrlbarTokenizer.sys.mjs b/browser/components/urlbar/UrlbarTokenizer.sys.mjs | ||
| index d4af0ee5138a69139b94d898fb07e2345172f025..f750aae3f9f0a849ca009784510575b2b7119e6d 100644 | ||
| --- a/browser/components/urlbar/UrlbarTokenizer.sys.mjs | ||
| +++ b/browser/components/urlbar/UrlbarTokenizer.sys.mjs | ||
| @@ -66,6 +66,7 @@ export var UrlbarTokenizer = { | ||
| // `looksLikeOrigin()` returned `LOOKS_LIKE_ORIGIN.OTHER` for this token. It | ||
| // may or may not be an origin. | ||
| POSSIBLE_ORIGIN_BUT_SEARCH_ALLOWED: 12, | ||
| + RESTRICT_WORKSPACE: 13, | ||
| }), | ||
|
|
||
| // The special characters below can be typed into the urlbar to restrict | ||
| @@ -83,6 +84,7 @@ export var UrlbarTokenizer = { | ||
| TITLE: "#", | ||
| URL: "$", | ||
| ACTION: ">", | ||
| + WORKSPACE: "`", | ||
| }), | ||
|
|
||
| // The keys of characters in RESTRICT that will enter search mode. | ||
| @@ -97,6 +99,7 @@ export var UrlbarTokenizer = { | ||
| if (lazy.UrlbarPrefs.get("scotchBonnet.enableOverride")) { | ||
| keys.push(this.RESTRICT.ACTION); | ||
| } | ||
| + keys.push(this.RESTRICT.WORKSPACE); | ||
| return new Set(keys); | ||
| }, | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,50 @@ | ||
| diff --git a/browser/components/urlbar/UrlbarUtils.sys.mjs b/browser/components/urlbar/UrlbarUtils.sys.mjs | ||
| index 9e9f786b6fd3441000d9cdb0b582f817b73ad814..8f86652520a433c94e34fc0e35dc8aad4a86faa2 100644 | ||
| index 9e9f786b6fd3441000d9cdb0b582f817b73ad814..12e8537b1647f6e3759ea9c5ed93d8a620c5644b 100644 | ||
| --- a/browser/components/urlbar/UrlbarUtils.sys.mjs | ||
| +++ b/browser/components/urlbar/UrlbarUtils.sys.mjs | ||
| @@ -84,6 +84,7 @@ export var UrlbarUtils = { | ||
| @@ -84,6 +84,8 @@ export var UrlbarUtils = { | ||
| RESTRICT_SEARCH_KEYWORD: "restrictSearchKeyword", | ||
| SUGGESTED_INDEX: "suggestedIndex", | ||
| TAIL_SUGGESTION: "tailSuggestion", | ||
| + ZEN_ACTION: "zenAction", | ||
| + ZEN_WORKSPACE: "zenWorkspace", | ||
| }), | ||
|
|
||
| // Defines provider types. | ||
| @@ -145,6 +146,7 @@ export var UrlbarUtils = { | ||
| @@ -145,6 +147,8 @@ export var UrlbarUtils = { | ||
| OTHER_NETWORK: 6, | ||
| ADDON: 7, | ||
| ACTIONS: 8, | ||
| + ZEN_ACTIONS: 9, | ||
| + WORKSPACES: 10, | ||
| }), | ||
|
|
||
| // Per-result exposure telemetry. | ||
| @@ -585,6 +587,8 @@ export var UrlbarUtils = { | ||
| @@ -293,6 +297,14 @@ export var UrlbarUtils = { | ||
| telemetryLabel: "actions", | ||
| uiLabel: "urlbar-searchmode-actions", | ||
| }, | ||
| + { | ||
| + source: this.RESULT_SOURCE.WORKSPACES, | ||
| + restrict: lazy.UrlbarTokenizer.RESTRICT.WORKSPACE, | ||
| + icon: "chrome://browser/skin/zen-icons/selectable/layers.svg", | ||
| + pref: "shortcuts.workspaces", | ||
| + telemetryLabel: "workspaces", | ||
| + uiLabel: "urlbar-searchmode-workspaces", | ||
| + }, | ||
| ]); | ||
| }, | ||
|
|
||
| @@ -585,6 +597,12 @@ export var UrlbarUtils = { | ||
| return this.RESULT_GROUP.HEURISTIC_FALLBACK; | ||
| case "UrlbarProviderHistoryUrlHeuristic": | ||
| return this.RESULT_GROUP.HEURISTIC_HISTORY_URL; | ||
| + case "ZenUrlbarProviderGlobalActions": | ||
| + return this.RESULT_GROUP.ZEN_ACTION; | ||
| + if (result.source == this.RESULT_SOURCE.WORKSPACES) { | ||
| + return this.RESULT_GROUP.ZEN_WORKSPACE; | ||
| + } else { | ||
| + return this.RESULT_GROUP.ZEN_ACTION; | ||
| + } | ||
| case "UrlbarProviderOmnibox": | ||
| return this.RESULT_GROUP.HEURISTIC_OMNIBOX; | ||
| case "UrlbarProviderRestrictKeywordsAutofill": | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pref should probably be added into zen-urlbar.yml, no?