mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-19 11:27:16 +00:00
Merge branch 'dev' of https://github.com/zen-browser/desktop into dev
This commit is contained in:
@@ -72,3 +72,6 @@
|
||||
|
||||
- name: browser.tabs.notes.enabled
|
||||
value: false
|
||||
|
||||
- name: browser.tabs.dragDrop.moveOverThresholdPercent
|
||||
value: 50 # Percentage of tab height to trigger move over on drag-and-drop
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
- name: zen.tabs.close-window-with-empty
|
||||
value: true
|
||||
|
||||
- name: zen.tabs.select-recently-used-on-close
|
||||
value: true
|
||||
|
||||
- name: zen.tabs.use-legacy-drag-and-drop
|
||||
value: false
|
||||
|
||||
|
||||
@@ -31,6 +31,9 @@ dialog::part(dialog-button) {
|
||||
|
||||
&:is([dlgtype="accept"], [dlgtype="cancel"]) {
|
||||
padding-inline-end: 3.7em;
|
||||
@media (-moz-platform: windows) {
|
||||
padding-inline-end: 4em;
|
||||
}
|
||||
|
||||
&::after {
|
||||
border-radius: 4px;
|
||||
@@ -48,7 +51,7 @@ dialog::part(dialog-button) {
|
||||
&[dlgtype="accept"]::after {
|
||||
content: "⏎";
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
outline: 2px solid color-mix(in srgb, currentColor 30%, transparent);
|
||||
outline: 2px solid color-mix(in srgb, currentColor 20%, transparent);
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,11 +16,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
#urlbar {
|
||||
.urlbar {
|
||||
--urlbarView-separator-color: light-dark(hsl(0, 0%, 89%), hsl(0, 0%, 20%));
|
||||
--urlbarView-hover-background: var(--toolbarbutton-hover-background);
|
||||
--urlbarView-highlight-background: var(--toolbarbutton-hover-background);
|
||||
border-radius: calc(var(--toolbarbutton-border-radius) - 2px);
|
||||
height: var(--urlbar-height);
|
||||
--urlbarView-results-padding: 8px !important;
|
||||
--urlbar-container-height: 48px !important;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ support-files = [
|
||||
]
|
||||
|
||||
["browser_tabs_empty_checks.js"]
|
||||
["browser_tabs_close_recently.js"]
|
||||
["browser_tabs_fetch_checks.js"]
|
||||
["browser_tabs_cycle_by_attribute.js"]
|
||||
["browser_drag_drop_vertical.js"]
|
||||
|
||||
@@ -52,7 +52,7 @@ async function dropAfter(itemToDrag, itemToDropAfter, win) {
|
||||
const midline = rect.left + 0.5 * rect.width;
|
||||
// Point where bottom edge of `itemToDrag` overlaps `itemToDropAfter` enough
|
||||
// for `itemToDrag` to come after.
|
||||
const afterPoint = Math.ceil(rect.top + threshold * rect.height);
|
||||
const afterPoint = Math.ceil(rect.top + (threshold + 0.5) * rect.height);
|
||||
const dragTo = afterPoint - sourceRect.height / 2;
|
||||
await drop(itemToDrag, itemToDropAfter, midline, dragTo, win);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ async function dropBefore(itemToDrag, itemToDropBefore, win) {
|
||||
const midline = rect.left + 0.5 * rect.width;
|
||||
// Point where top edge of `itemToDrag` overlaps `itemToDropBefore` enough
|
||||
// for `itemToDrag` to come before.
|
||||
const beforePoint = Math.floor(rect.top + (1 - threshold) * rect.height);
|
||||
const beforePoint = Math.floor(rect.top + (1 - threshold - 0.5) * rect.height);
|
||||
const dragTo = beforePoint + sourceRect.height / 2;
|
||||
await drop(itemToDrag, itemToDropBefore, midline, dragTo, win);
|
||||
}
|
||||
|
||||
80
src/zen/tests/tabs/browser_tabs_close_recently.js
Normal file
80
src/zen/tests/tabs/browser_tabs_close_recently.js
Normal file
@@ -0,0 +1,80 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
https://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const URL1 = "data:text/plain,tab1";
|
||||
const URL2 = "data:text/plain,tab2";
|
||||
const URL3 = "data:text/plain,tab3";
|
||||
|
||||
add_task(async function test_blurToRecentlyClosedTab() {
|
||||
const [tab1, tab2, tab3] = [
|
||||
BrowserTestUtils.addTab(gBrowser, URL1),
|
||||
BrowserTestUtils.addTab(gBrowser, URL2),
|
||||
BrowserTestUtils.addTab(gBrowser, URL3),
|
||||
];
|
||||
|
||||
gBrowser.selectedTab = tab2;
|
||||
gBrowser.selectedTab = tab3;
|
||||
gBrowser.selectedTab = tab1;
|
||||
|
||||
gBrowser.selectedTab = tab2;
|
||||
gBrowser.removeTab(tab2);
|
||||
|
||||
Assert.equal(
|
||||
gBrowser.selectedTab,
|
||||
tab1,
|
||||
"After closing the most recently used tab, the selection moves to the last used tab"
|
||||
);
|
||||
|
||||
gBrowser.selectedTab = tab3;
|
||||
gBrowser.removeTab(tab3);
|
||||
|
||||
Assert.equal(
|
||||
gBrowser.selectedTab,
|
||||
tab1,
|
||||
"After closing the most recently used tab, the selection moves to the last used tab"
|
||||
);
|
||||
|
||||
gBrowser.removeTab(tab1);
|
||||
});
|
||||
|
||||
add_task(async function test_closeToLastTab() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["zen.tabs.select-recently-used-on-close", false],
|
||||
["zen.view.show-newtab-button-top", false],
|
||||
],
|
||||
});
|
||||
|
||||
const [tab1, tab2, tab3] = [
|
||||
BrowserTestUtils.addTab(gBrowser, URL1),
|
||||
BrowserTestUtils.addTab(gBrowser, URL2),
|
||||
BrowserTestUtils.addTab(gBrowser, URL3),
|
||||
];
|
||||
|
||||
gBrowser.selectedTab = tab2;
|
||||
gBrowser.selectedTab = tab3;
|
||||
gBrowser.selectedTab = tab1;
|
||||
|
||||
gBrowser.selectedTab = tab2;
|
||||
gBrowser.removeTab(tab2);
|
||||
|
||||
Assert.equal(
|
||||
gBrowser.selectedTab,
|
||||
tab3,
|
||||
"After closing the current tab, the selection moves to the next tab in order"
|
||||
);
|
||||
|
||||
gBrowser.selectedTab = tab1;
|
||||
gBrowser.removeTab(tab1);
|
||||
|
||||
Assert.equal(
|
||||
gBrowser.selectedTab,
|
||||
tab3,
|
||||
"After closing the current tab, the selection moves to the next tab in order"
|
||||
);
|
||||
|
||||
gBrowser.removeTab(tab3);
|
||||
await SpecialPowers.popPrefEnv();
|
||||
});
|
||||
@@ -2819,9 +2819,8 @@ class nsZenWorkspaces {
|
||||
const tabWorkspaceId = aTab.getAttribute("zen-workspace-id");
|
||||
const containerId = aTab.getAttribute("usercontextid") ?? "0";
|
||||
// Return all tabs that are not on the same workspace
|
||||
return this.allStoredTabs.filter(
|
||||
return gBrowser.tabs.filter(
|
||||
(tab) =>
|
||||
tab.getAttribute("zen-workspace-id") !== tabWorkspaceId &&
|
||||
!this._shouldShowTab(tab, tabWorkspaceId, containerId, this._workspaceCache) &&
|
||||
!tab.hasAttribute("zen-empty-tab")
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user