Skip to content

Commit

Permalink
Bug 1858141 - Adapt clipboard suggestions to the spec. r=mak,fluent-r…
Browse files Browse the repository at this point in the history
…eviewers,desktop-theme-reviewers,dao

Differential Revision: https://phabricator.services.mozilla.com/D190846
  • Loading branch information
klubana-m committed Oct 13, 2023
1 parent 55fdc3b commit 2c5623e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion browser/components/urlbar/UrlbarProviderClipboard.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ProviderClipboard extends UrlbarProvider {
{
url: this.#previousClipboard.value,
title: this.#previousClipboard.value,
icon: "chrome://global/skin/icons/edit-copy.svg",
icon: "chrome://global/skin/icons/clipboard.svg",
}
);

Expand Down
4 changes: 2 additions & 2 deletions browser/components/urlbar/UrlbarView.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1834,7 +1834,7 @@ export class UrlbarView {
result.payload.displayUrl = "";
actionSetter = () => {
this.#setElementL10n(action, {
id: "urlbar-result-action-visit-from-your-clipboard",
id: "urlbar-result-action-visit-from-clipboard",
});
};
title.toggleAttribute("is-url", true);
Expand Down Expand Up @@ -2835,7 +2835,7 @@ export class UrlbarView {
{ id: "urlbar-result-action-search-tabs" },
{ id: "urlbar-result-action-switch-tab" },
{ id: "urlbar-result-action-visit" },
{ id: "urlbar-result-action-visit-from-your-clipboard" },
{ id: "urlbar-result-action-visit-from-clipboard" },
];

if (lazy.UrlbarPrefs.get("groupLabels.enabled")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ add_task(async function testUserEngagementWithClipboardSuggestion() {
);
Assert.equal(
result.icon,
"chrome://global/skin/icons/edit-copy.svg",
"chrome://global/skin/icons/clipboard.svg",
"Clipboard suggestion icon"
);
await checkClipboardSuggestionAbsent(1);
Expand Down
2 changes: 1 addition & 1 deletion browser/locales/en-US/browser/browser.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ urlbar-result-action-sponsored = Sponsored
urlbar-result-action-switch-tab = Switch to Tab
urlbar-result-action-visit = Visit
# Allows the user to visit a URL that was previously copied to the clipboard.
urlbar-result-action-visit-from-your-clipboard = Visit from your clipboard
urlbar-result-action-visit-from-clipboard = Visit from clipboard
# Directs a user to press the Tab key to perform a search with the specified
# engine.
# Variables
Expand Down
7 changes: 4 additions & 3 deletions browser/themes/shared/urlbarView.css
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@
}
}

/* Switch-to-tab action text is styled as a chiclet. */
.urlbarView-row:is([type=switchtab], [type=remotetab]) {
/* Switch-to-tab and Clipboard action text is styled as a chiclet. */
.urlbarView-row:is([type=switchtab], [type=remotetab], [type=clipboard]) {
> .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-action {
color: var(--urlbar-box-text-color);
background-color: var(--urlbar-box-focus-bgcolor);
Expand All @@ -663,8 +663,9 @@
}
}

.urlbarView:not([action-override]) .urlbarView-row[type=switchtab],
.urlbarView-row[type=remotetab]:not([selected], :hover),
.urlbarView:not([action-override]) .urlbarView-row[type=switchtab] {
.urlbarView-row[type=clipboard] {
> .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-title-separator::before {
/* We make the title separator transparent so it stays in the accessibility
tree. We want screen readers to pause between the result title and the
Expand Down
1 change: 1 addition & 0 deletions toolkit/themes/shared/desktop-jar.inc.mn
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
skin/classic/global/icons/check-filled.svg (../../shared/icons/check-filled.svg)
skin/classic/global/icons/check-partial.svg (../../shared/icons/check-partial.svg)
skin/classic/global/icons/chevron.svg (../../shared/icons/chevron.svg)
skin/classic/global/icons/clipboard.svg (../../shared/icons/clipboard.svg)
skin/classic/global/icons/close.svg (../../shared/icons/close.svg)
skin/classic/global/icons/close-12.svg (../../shared/icons/close-12.svg)
skin/classic/global/icons/close-fill.svg (../../shared/icons/close-fill.svg)
Expand Down
7 changes: 7 additions & 0 deletions toolkit/themes/shared/icons/clipboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2c5623e

Please sign in to comment.