Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 20 additions & 35 deletions src/zen/glance/ZenGlanceManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,6 @@ class nsZenGlanceManager extends nsZenDOMOperatedFeature {
gZenWorkspaces.updateTabsContainers();
this.overlay.classList.remove("zen-glance-overlay");
this.#clearContainerStyles(this.browserWrapper);
this.animatingFullOpen = false;
const glanceID = this.#currentGlanceID;
this.closeGlance({ noAnimation: true, skipPermitUnload: true });
this.#deleteGlance(glanceID);
Expand All @@ -1616,16 +1615,15 @@ class nsZenGlanceManager extends nsZenDOMOperatedFeature {
* @param {boolean} options.forSplit - Whether this is for split view
*/
async fullyOpenGlance({ forSplit = false } = {}) {
if (!this.#currentGlanceID || !this.#currentTab) {
const currentTab = this.#currentTab;
const currentParentTab = this.#currentParentTab;

if (!this.#currentGlanceID || !currentTab) {
return;
}

this.animatingFullOpen = true;
this.#currentTab.setAttribute("zen-dont-split-glance", true);

this.#handleZenFolderPinning();
gBrowser.moveTabAfter(this.#currentTab, this.#currentParentTab);

currentTab.setAttribute("zen-dont-split-glance", true);
this.#prepareTabForFullOpen();

const sidebarButtons = this.browserWrapper.querySelector(
Expand All @@ -1635,31 +1633,34 @@ class nsZenGlanceManager extends nsZenDOMOperatedFeature {
sidebarButtons.remove();
}

if (forSplit) {
this.finishOpeningGlance();
return;
}

if (gReduceMotion) {
if (!forSplit && gReduceMotion) {
gZenViewSplitter.deactivateCurrentSplitView();
this.finishOpeningGlance();
return;
}

await this.#animateFullOpen();
this.finishOpeningGlance();
this.#handleZenFolderPinning(currentTab, currentParentTab);
gBrowser.moveTabAfter(currentTab, currentParentTab);

if (!forSplit && !gReduceMotion) {
Comment on lines 1640 to +1644

@ashvwinn ashvwinn Jul 5, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mr-boost-guy-disgust-new-new-new

await this.#animateFullOpen();
}

this.animatingFullOpen = false;
}

/**
* Handle Zen folder pinning if applicable
*
* @param {Tab} currentTab - The current tab
* @param {Tab} currentParentTab - The current parent tab
*/
#handleZenFolderPinning() {
const isZenFolder = this.#currentParentTab?.group?.isZenFolder;
#handleZenFolderPinning(currentTab, currentParentTab) {
const isZenFolder = currentParentTab?.group?.isZenFolder;
if (
Services.prefs.getBoolPref("zen.folders.owned-tabs-in-folder") &&
isZenFolder
Comment thread
ashvwinn marked this conversation as resolved.
) {
gBrowser.pinTab(this.#currentTab);
gBrowser.pinTab(currentTab);
}
}

Expand Down Expand Up @@ -1793,7 +1794,6 @@ class nsZenGlanceManager extends nsZenDOMOperatedFeature {
const currentTab = this.#currentTab;
const currentParentTab = this.#currentParentTab;

this.#handleZenFolderPinningForSplit(currentParentTab);
await this.fullyOpenGlance({ forSplit: true });

const isRightSidebar = gZenVerticalTabsManager._prefsRightSide;
Expand All @@ -1813,21 +1813,6 @@ class nsZenGlanceManager extends nsZenDOMOperatedFeature {
}
}

/**
* Handle Zen folder pinning for split view
*
* @param {Tab} parentTab - The parent tab
*/
#handleZenFolderPinningForSplit(parentTab) {
const isZenFolder = parentTab?.group?.isZenFolder;
if (
Services.prefs.getBoolPref("zen.folders.owned-tabs-in-folder") &&
isZenFolder
) {
gBrowser.pinTab(this.#currentTab);
}
}

/**
* Get the tab or its glance parent
*
Expand Down