Skip to content

Commit c2951d0

Browse files
committed
fix: Add debug info when an invalid folder is trying to restore, b=no-bug, c=common, folders
1 parent 9f42abf commit c2951d0

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

prefs/view.yaml

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

5252
- name: zen.view.context-menu.refresh
5353
value: false
54+
55+
- name: zen.view.borderless-fullscreen
56+
value: true

src/zen/common/zenThemeModifier.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ var ZenThemeModifier = {
9696
if (
9797
window.fullScreen &&
9898
window.gZenCompactModeManager?.preference &&
99-
!document.getElementById('tabbrowser-tabbox')?.hasAttribute('zen-split-view')
99+
!document.getElementById('tabbrowser-tabbox')?.hasAttribute('zen-split-view') &&
100+
Services.prefs.getBoolPref('zen.view.borderless-fullscreen', true)
100101
) {
101102
separation = 0;
102103
}

src/zen/folders/ZenFolders.mjs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,18 +1615,25 @@
16151615
const parentWorkingData = tabFolderWorkingData.get(stateData.parentId);
16161616
if (parentWorkingData && parentWorkingData.node) {
16171617
switch (stateData?.prevSiblingInfo?.type) {
1618-
case 'group': {
1619-
const folder = document.getElementById(stateData.prevSiblingInfo.id);
1620-
folder.after(node);
1621-
break;
1622-
}
16231618
case 'tab': {
16241619
const tab = parentWorkingData.node.querySelector(
16251620
`[zen-pin-id="${stateData.prevSiblingInfo.id}"]`
16261621
);
16271622
tab.after(node);
16281623
break;
16291624
}
1625+
case 'group': {
1626+
const folder = document.getElementById(stateData.prevSiblingInfo.id);
1627+
if (folder) {
1628+
folder.after(node);
1629+
break;
1630+
}
1631+
// If we didn't find the group, we should debug it and continue to default case.
1632+
console.warn(
1633+
`Zen Folders: Could not find previous sibling group with id ${stateData.prevSiblingInfo.id} while restoring session.`
1634+
);
1635+
// @eslint-disable-next-line no-fallthrough
1636+
}
16301637
default: {
16311638
// Should insert after zen-empty-tab
16321639
const start =

0 commit comments

Comments
 (0)