Skip to content

Commit c8f314a

Browse files
committed
Merge branch 'dev' of https://github.com/zen-browser/desktop into dev
2 parents 56c5f2f + ceb5405 commit c8f314a

8 files changed

Lines changed: 96 additions & 6 deletions

File tree

prefs/firefox/browser.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@
7272

7373
- name: browser.tabs.notes.enabled
7474
value: false
75+
76+
- name: browser.tabs.dragDrop.moveOverThresholdPercent
77+
value: 50 # Percentage of tab height to trigger move over on drag-and-drop

prefs/zen/zen.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
- name: zen.tabs.close-window-with-empty
2121
value: true
2222

23+
- name: zen.tabs.select-recently-used-on-close
24+
value: true
25+
2326
- name: zen.tabs.use-legacy-drag-and-drop
2427
value: false
2528

src/zen/common/styles/zen-buttons.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ dialog::part(dialog-button) {
3131

3232
&:is([dlgtype="accept"], [dlgtype="cancel"]) {
3333
padding-inline-end: 3.7em;
34+
@media (-moz-platform: windows) {
35+
padding-inline-end: 4em;
36+
}
3437

3538
&::after {
3639
border-radius: 4px;
@@ -48,7 +51,7 @@ dialog::part(dialog-button) {
4851
&[dlgtype="accept"]::after {
4952
content: "⏎";
5053
background: rgba(255, 255, 255, 0.1);
51-
outline: 2px solid color-mix(in srgb, currentColor 30%, transparent);
54+
outline: 2px solid color-mix(in srgb, currentColor 20%, transparent);
5255
outline-offset: -2px;
5356
}
5457

src/zen/common/styles/zen-omnibox.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
}
1717
}
1818

19-
#urlbar {
19+
.urlbar {
2020
--urlbarView-separator-color: light-dark(hsl(0, 0%, 89%), hsl(0, 0%, 20%));
2121
--urlbarView-hover-background: var(--toolbarbutton-hover-background);
2222
--urlbarView-highlight-background: var(--toolbarbutton-hover-background);
2323
border-radius: calc(var(--toolbarbutton-border-radius) - 2px);
24+
height: var(--urlbar-height);
2425
--urlbarView-results-padding: 8px !important;
2526
--urlbar-container-height: 48px !important;
2627

src/zen/tests/tabs/browser.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ support-files = [
88
]
99

1010
["browser_tabs_empty_checks.js"]
11+
["browser_tabs_close_recently.js"]
1112
["browser_tabs_fetch_checks.js"]
1213
["browser_tabs_cycle_by_attribute.js"]
1314
["browser_drag_drop_vertical.js"]

src/zen/tests/tabs/browser_drag_drop_vertical.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async function dropAfter(itemToDrag, itemToDropAfter, win) {
5252
const midline = rect.left + 0.5 * rect.width;
5353
// Point where bottom edge of `itemToDrag` overlaps `itemToDropAfter` enough
5454
// for `itemToDrag` to come after.
55-
const afterPoint = Math.ceil(rect.top + threshold * rect.height);
55+
const afterPoint = Math.ceil(rect.top + (threshold + 0.5) * rect.height);
5656
const dragTo = afterPoint - sourceRect.height / 2;
5757
await drop(itemToDrag, itemToDropAfter, midline, dragTo, win);
5858
}
@@ -71,7 +71,7 @@ async function dropBefore(itemToDrag, itemToDropBefore, win) {
7171
const midline = rect.left + 0.5 * rect.width;
7272
// Point where top edge of `itemToDrag` overlaps `itemToDropBefore` enough
7373
// for `itemToDrag` to come before.
74-
const beforePoint = Math.floor(rect.top + (1 - threshold) * rect.height);
74+
const beforePoint = Math.floor(rect.top + (1 - threshold - 0.5) * rect.height);
7575
const dragTo = beforePoint + sourceRect.height / 2;
7676
await drop(itemToDrag, itemToDropBefore, midline, dragTo, win);
7777
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/* Any copyright is dedicated to the Public Domain.
2+
https://creativecommons.org/publicdomain/zero/1.0/ */
3+
4+
"use strict";
5+
6+
const URL1 = "data:text/plain,tab1";
7+
const URL2 = "data:text/plain,tab2";
8+
const URL3 = "data:text/plain,tab3";
9+
10+
add_task(async function test_blurToRecentlyClosedTab() {
11+
const [tab1, tab2, tab3] = [
12+
BrowserTestUtils.addTab(gBrowser, URL1),
13+
BrowserTestUtils.addTab(gBrowser, URL2),
14+
BrowserTestUtils.addTab(gBrowser, URL3),
15+
];
16+
17+
gBrowser.selectedTab = tab2;
18+
gBrowser.selectedTab = tab3;
19+
gBrowser.selectedTab = tab1;
20+
21+
gBrowser.selectedTab = tab2;
22+
gBrowser.removeTab(tab2);
23+
24+
Assert.equal(
25+
gBrowser.selectedTab,
26+
tab1,
27+
"After closing the most recently used tab, the selection moves to the last used tab"
28+
);
29+
30+
gBrowser.selectedTab = tab3;
31+
gBrowser.removeTab(tab3);
32+
33+
Assert.equal(
34+
gBrowser.selectedTab,
35+
tab1,
36+
"After closing the most recently used tab, the selection moves to the last used tab"
37+
);
38+
39+
gBrowser.removeTab(tab1);
40+
});
41+
42+
add_task(async function test_closeToLastTab() {
43+
await SpecialPowers.pushPrefEnv({
44+
set: [
45+
["zen.tabs.select-recently-used-on-close", false],
46+
["zen.view.show-newtab-button-top", false],
47+
],
48+
});
49+
50+
const [tab1, tab2, tab3] = [
51+
BrowserTestUtils.addTab(gBrowser, URL1),
52+
BrowserTestUtils.addTab(gBrowser, URL2),
53+
BrowserTestUtils.addTab(gBrowser, URL3),
54+
];
55+
56+
gBrowser.selectedTab = tab2;
57+
gBrowser.selectedTab = tab3;
58+
gBrowser.selectedTab = tab1;
59+
60+
gBrowser.selectedTab = tab2;
61+
gBrowser.removeTab(tab2);
62+
63+
Assert.equal(
64+
gBrowser.selectedTab,
65+
tab3,
66+
"After closing the current tab, the selection moves to the next tab in order"
67+
);
68+
69+
gBrowser.selectedTab = tab1;
70+
gBrowser.removeTab(tab1);
71+
72+
Assert.equal(
73+
gBrowser.selectedTab,
74+
tab3,
75+
"After closing the current tab, the selection moves to the next tab in order"
76+
);
77+
78+
gBrowser.removeTab(tab3);
79+
await SpecialPowers.popPrefEnv();
80+
});

src/zen/workspaces/ZenWorkspaces.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,9 +2819,8 @@ class nsZenWorkspaces {
28192819
const tabWorkspaceId = aTab.getAttribute("zen-workspace-id");
28202820
const containerId = aTab.getAttribute("usercontextid") ?? "0";
28212821
// Return all tabs that are not on the same workspace
2822-
return this.allStoredTabs.filter(
2822+
return gBrowser.tabs.filter(
28232823
(tab) =>
2824-
tab.getAttribute("zen-workspace-id") !== tabWorkspaceId &&
28252824
!this._shouldShowTab(tab, tabWorkspaceId, containerId, this._workspaceCache) &&
28262825
!tab.hasAttribute("zen-empty-tab")
28272826
);

0 commit comments

Comments
 (0)