Bug 1953155 - Enable expand on hover option and remove expand on hover coming soon message r=sidebar-reviewers,nsharpley
Differential Revision: https://phabricator.services.mozilla.com/D241293
This commit is contained in:
@@ -2107,7 +2107,7 @@ pref("sidebar.visibility", "always-show");
|
|||||||
// as a backup to restore the sidebar UI state when a user has PPB mode on
|
// as a backup to restore the sidebar UI state when a user has PPB mode on
|
||||||
// or has history cleared on browser close.
|
// or has history cleared on browser close.
|
||||||
pref("sidebar.backupState", "{}");
|
pref("sidebar.backupState", "{}");
|
||||||
pref("sidebar.expandOnHover", false);
|
pref("sidebar.expandOnHover", true);
|
||||||
pref("sidebar.old-sidebar.has-used", false);
|
pref("sidebar.old-sidebar.has-used", false);
|
||||||
pref("sidebar.new-sidebar.has-used", false);
|
pref("sidebar.new-sidebar.has-used", false);
|
||||||
|
|
||||||
|
|||||||
@@ -14,14 +14,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-message {
|
|
||||||
/* Pull the message-bar over the input box's border */
|
|
||||||
margin-block-end: calc(-1 * var(--sidebar-box-border-width));
|
|
||||||
margin-inline: calc(-1 * var(--space-medium) - var(--sidebar-box-border-width));
|
|
||||||
/* Remove the top radius, match the bottom radius to the input box's radius */
|
|
||||||
--message-bar-border-radius: 0 0 var(--border-radius-medium) var(--border-radius-medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
.medium-top-margin {
|
.medium-top-margin {
|
||||||
margin-block-start: var(--space-medium);
|
margin-block-start: var(--space-medium);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ const VISIBILITY_SETTING_PREF = "sidebar.visibility";
|
|||||||
const EXPAND_ON_HOVER_PREF = "sidebar.expandOnHover";
|
const EXPAND_ON_HOVER_PREF = "sidebar.expandOnHover";
|
||||||
const POSITION_SETTING_PREF = "sidebar.position_start";
|
const POSITION_SETTING_PREF = "sidebar.position_start";
|
||||||
const TAB_DIRECTION_SETTING_PREF = "sidebar.verticalTabs";
|
const TAB_DIRECTION_SETTING_PREF = "sidebar.verticalTabs";
|
||||||
const EXPAND_ON_HOVER_MESSAGE_DISMISSED_PREF =
|
|
||||||
"sidebar.expandOnHoverMessage.dismissed";
|
|
||||||
|
|
||||||
export class SidebarCustomize extends SidebarPage {
|
export class SidebarCustomize extends SidebarPage {
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -251,26 +249,6 @@ export class SidebarCustomize extends SidebarPage {
|
|||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
expandOnHoverMessageTemplate() {
|
|
||||||
if (
|
|
||||||
!Services.prefs.getBoolPref(EXPAND_ON_HOVER_MESSAGE_DISMISSED_PREF, false)
|
|
||||||
) {
|
|
||||||
return html`
|
|
||||||
<moz-message-bar
|
|
||||||
class="setting-message expand-on-hover-message"
|
|
||||||
data-l10n-id="expand-on-hover-message"
|
|
||||||
@message-bar:user-dismissed=${this.onExpandOnHoverMessageDismissed}
|
|
||||||
dismissable
|
|
||||||
></moz-message-bar>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
onExpandOnHoverMessageDismissed() {
|
|
||||||
Services.prefs.setBoolPref(EXPAND_ON_HOVER_MESSAGE_DISMISSED_PREF, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let extensions = this.getWindow().SidebarController.getExtensions();
|
let extensions = this.getWindow().SidebarController.getExtensions();
|
||||||
return html`
|
return html`
|
||||||
@@ -322,7 +300,6 @@ export class SidebarCustomize extends SidebarPage {
|
|||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</moz-checkbox>
|
</moz-checkbox>
|
||||||
${this.expandOnHoverMessageTemplate()}
|
|
||||||
</moz-fieldset>
|
</moz-fieldset>
|
||||||
<moz-fieldset class="customize-group medium-top-margin no-label">
|
<moz-fieldset class="customize-group medium-top-margin no-label">
|
||||||
<moz-checkbox
|
<moz-checkbox
|
||||||
|
|||||||
@@ -362,42 +362,3 @@ add_task(async function test_settings_synchronized_across_windows() {
|
|||||||
SidebarController.hide();
|
SidebarController.hide();
|
||||||
await BrowserTestUtils.closeWindow(newWindow);
|
await BrowserTestUtils.closeWindow(newWindow);
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_expand_on_hover_message() {
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [["sidebar.expandOnHoverMessage.dismissed", false]],
|
|
||||||
});
|
|
||||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
|
||||||
let panel = await showCustomizePanel(win);
|
|
||||||
let expandOnHoverMessage = panel.shadowRoot.querySelector(
|
|
||||||
".expand-on-hover-message"
|
|
||||||
);
|
|
||||||
|
|
||||||
ok(expandOnHoverMessage, "Found the expand on hover message");
|
|
||||||
ok(expandOnHoverMessage.isConnected, "Message bar is connected");
|
|
||||||
|
|
||||||
let messageBarRemoved = BrowserTestUtils.waitForEvent(
|
|
||||||
expandOnHoverMessage,
|
|
||||||
"message-bar:close"
|
|
||||||
);
|
|
||||||
ok(expandOnHoverMessage.closeButton, "close button exists");
|
|
||||||
EventUtils.synthesizeMouseAtCenter(
|
|
||||||
expandOnHoverMessage.closeButton,
|
|
||||||
{},
|
|
||||||
win.SidebarController.browser.contentWindow
|
|
||||||
);
|
|
||||||
await messageBarRemoved;
|
|
||||||
ok(!expandOnHoverMessage.isConnected, "Message bar was removed");
|
|
||||||
|
|
||||||
// Close the window, make a new one to check that the message is not shown
|
|
||||||
await BrowserTestUtils.closeWindow(win);
|
|
||||||
win = await BrowserTestUtils.openNewBrowserWindow();
|
|
||||||
panel = await showCustomizePanel(win);
|
|
||||||
expandOnHoverMessage = panel.shadowRoot.querySelector(
|
|
||||||
".expand-on-hover-message"
|
|
||||||
);
|
|
||||||
|
|
||||||
ok(!expandOnHoverMessage, "Expand on hover message is not shown");
|
|
||||||
|
|
||||||
await BrowserTestUtils.closeWindow(win);
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -65,9 +65,6 @@ sidebar-show-on-the-left =
|
|||||||
# hovers over it.
|
# hovers over it.
|
||||||
expand-sidebar-on-hover =
|
expand-sidebar-on-hover =
|
||||||
.label = Expand sidebar on hover
|
.label = Expand sidebar on hover
|
||||||
expand-on-hover-message =
|
|
||||||
.heading = Expand on hover coming soon
|
|
||||||
.message = In a future update, you’ll be able to expand the sidebar on hover.
|
|
||||||
|
|
||||||
## Labels for sidebar context menu items
|
## Labels for sidebar context menu items
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user