fix: Add debug info when an invalid folder is trying to restore, b=no-bug, c=common, folders

This commit is contained in:
Mr. M
2025-10-07 01:21:52 +02:00
parent 9f42abf789
commit c2951d0a0f
3 changed files with 17 additions and 6 deletions

View File

@@ -51,3 +51,6 @@
- name: zen.view.context-menu.refresh
value: false
- name: zen.view.borderless-fullscreen
value: true

View File

@@ -96,7 +96,8 @@ var ZenThemeModifier = {
if (
window.fullScreen &&
window.gZenCompactModeManager?.preference &&
!document.getElementById('tabbrowser-tabbox')?.hasAttribute('zen-split-view')
!document.getElementById('tabbrowser-tabbox')?.hasAttribute('zen-split-view') &&
Services.prefs.getBoolPref('zen.view.borderless-fullscreen', true)
) {
separation = 0;
}

View File

@@ -1615,11 +1615,6 @@
const parentWorkingData = tabFolderWorkingData.get(stateData.parentId);
if (parentWorkingData && parentWorkingData.node) {
switch (stateData?.prevSiblingInfo?.type) {
case 'group': {
const folder = document.getElementById(stateData.prevSiblingInfo.id);
folder.after(node);
break;
}
case 'tab': {
const tab = parentWorkingData.node.querySelector(
`[zen-pin-id="${stateData.prevSiblingInfo.id}"]`
@@ -1627,6 +1622,18 @@
tab.after(node);
break;
}
case 'group': {
const folder = document.getElementById(stateData.prevSiblingInfo.id);
if (folder) {
folder.after(node);
break;
}
// If we didn't find the group, we should debug it and continue to default case.
console.warn(
`Zen Folders: Could not find previous sibling group with id ${stateData.prevSiblingInfo.id} while restoring session.`
);
// @eslint-disable-next-line no-fallthrough
}
default: {
// Should insert after zen-empty-tab
const start =