Skip to content

Commit ed49256

Browse files
committed
fix: Small fixes when cancelling new empty split view, b=no-bug, c=common, split-view, workspaces
1 parent 5ac63e3 commit ed49256

File tree

7 files changed

+44
-5
lines changed

7 files changed

+44
-5
lines changed

prefs/zen.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
- name: zen.tabs.show-newtab-vertical
1515
value: true
1616

17+
- name: zen.tabs.close-window-with-empty
18+
value: true
19+
1720
- name: zen.ctrlTab.show-pending-tabs
1821
value: false
1922

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/browser/components/urlbar/UrlbarPrefs.sys.mjs b/browser/components/urlbar/UrlbarPrefs.sys.mjs
2+
index 3c179db3b310c43f8c6c06b1ecbcf5ed59feefe6..693bef15401cd4428c8a0222de57b83b78564194 100644
3+
--- a/browser/components/urlbar/UrlbarPrefs.sys.mjs
4+
+++ b/browser/components/urlbar/UrlbarPrefs.sys.mjs
5+
@@ -719,6 +719,7 @@ function makeResultGroups({ showSearchSuggestionsFirst }) {
6+
*/
7+
let rootGroup = {
8+
children: [
9+
+ { group: lazy.UrlbarUtils.RESULT_GROUP.ZEN_ACTION },
10+
// heuristic
11+
{
12+
maxResultCount: 1,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/browser/components/urlbar/UrlbarUtils.sys.mjs b/browser/components/urlbar/UrlbarUtils.sys.mjs
2+
index 0bc15c02f56dd8f46a21fed02b4e21a741f27f41..b69a4d34f700637bd352620c520b989cf00fa39f 100644
3+
--- a/browser/components/urlbar/UrlbarUtils.sys.mjs
4+
+++ b/browser/components/urlbar/UrlbarUtils.sys.mjs
5+
@@ -75,6 +75,7 @@ export var UrlbarUtils = {
6+
RESTRICT_SEARCH_KEYWORD: "restrictSearchKeyword",
7+
SUGGESTED_INDEX: "suggestedIndex",
8+
TAIL_SUGGESTION: "tailSuggestion",
9+
+ ZEN_ACTION: "zenAction",
10+
}),
11+
12+
// Defines provider types.
13+
@@ -576,6 +577,8 @@ export var UrlbarUtils = {
14+
return this.RESULT_GROUP.INPUT_HISTORY;
15+
case "UrlbarProviderQuickSuggest":
16+
return this.RESULT_GROUP.GENERAL_PARENT;
17+
+ case "ZenUrlbarProviderGlobalActions":
18+
+ return this.RESULT_GROUP.ZEN_ACTION;
19+
default:
20+
break;
21+
}

src/zen/common/ZenUIManager.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,8 @@ var gZenVerticalTabsManager = {
643643
!aItem.isConnected ||
644644
gZenUIManager.testingEnabled ||
645645
!gZenStartup.isReady ||
646-
!gZenPinnedTabManager.hasInitializedPins
646+
!gZenPinnedTabManager.hasInitializedPins ||
647+
aItem.group?.hasAttribute('split-view-group')
647648
) {
648649
return;
649650
}

src/zen/split-view/ZenViewSplitter.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,9 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
889889
removeGroup(groupIndex) {
890890
const group = this._data[groupIndex];
891891
for (const tab of group.tabs.reverse()) {
892-
gBrowser.ungroupTab(tab);
892+
if (tab.group?.hasAttribute('split-view-group')) {
893+
gBrowser.ungroupTab(tab);
894+
}
893895
}
894896
if (this.currentView === groupIndex) {
895897
this.deactivateCurrentSplitView();
@@ -1951,7 +1953,7 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
19511953
const groupIndex = this._data.findIndex((group) => group.tabs.includes(emptyTab));
19521954
const newSelectedTab = gBrowser.selectedTab;
19531955
const cleanup = () => {
1954-
this.removeTabFromGroup(emptyTab, groupIndex, { changeTab: !onSwitch });
1956+
this.removeTabFromGroup(emptyTab, groupIndex, { changeTab: !onSwitch, forUnsplit: true });
19551957
const command = document.getElementById('cmd_zenNewEmptySplit');
19561958
command.removeAttribute('disabled');
19571959
};

src/zen/workspaces/ZenWorkspaces.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3082,7 +3082,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
30823082
}
30833083

30843084
handleTabCloseWindow() {
3085-
if (this.shouldCloseWindow()) {
3085+
if (Services.prefs.getBoolPref('zen.tabs.close-window-with-empty')) {
30863086
document.getElementById('cmd_closeWindow').doCommand();
30873087
}
30883088
}

surfer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"brandShortName": "Zen",
2020
"brandFullName": "Zen Browser",
2121
"release": {
22-
"displayVersion": "1.16b",
22+
"displayVersion": "1.16.1b",
2323
"github": {
2424
"repo": "zen-browser/desktop"
2525
},

0 commit comments

Comments
 (0)