diff --git a/toolkit/content/widgets/tabbox.js b/toolkit/content/widgets/tabbox.js
index 9334120e818b609c6cb6792fd509e90c9b362551..2dde0c8698eb75bac0d0eb4d800d11b577e10a46 100644
--- a/toolkit/content/widgets/tabbox.js
+++ b/toolkit/content/widgets/tabbox.js
@@ -11,6 +11,23 @@
     "resource://gre/modules/AppConstants.sys.mjs"
   );
 
+  const { XPCOMUtils } = ChromeUtils.importESModule(
+    "resource://gre/modules/XPCOMUtils.sys.mjs"
+  );
+  const lazyZenPrefs = {};
+  XPCOMUtils.defineLazyPreferenceGetter(
+    lazyZenPrefs,
+    "cycleByAttribute",
+    "zen.tabs.ctrl-tab.ignore-essential-tabs",
+    false
+  );
+  XPCOMUtils.defineLazyPreferenceGetter(
+    lazyZenPrefs,
+    "ignorePendingTabs",
+    "zen.tabs.ctrl-tab.ignore-pending-tabs",
+    false
+  );
+
   let imports = {};
   ChromeUtils.defineESModuleGetters(imports, {
     DeferredTask: "resource://gre/modules/DeferredTask.sys.mjs",
@@ -225,7 +242,7 @@
     ) {
       this._inAsyncOperation = false;
       if (oldPanel != this._selectedPanel) {
-        oldPanel?.classList.remove("deck-selected");
+        if (!(window.gZenGlanceManager && gZenGlanceManager.shouldShowDeckSelected(this._selectedPanel, oldPanel))) oldPanel?.classList.remove("deck-selected");
         this._selectedPanel?.classList.add("deck-selected");
       }
       this.setAttribute("selectedIndex", val);
@@ -924,7 +941,7 @@
       if (!tab) {
         return;
       }
-      for (let otherTab of this.allTabs) {
+      for (let otherTab of window.gZenWorkspaces?.allStoredTabs ?? this.allTabs) {
         if (otherTab != tab && otherTab.selected) {
           otherTab._selected = false;
         }
@@ -960,6 +977,7 @@
      * @param {MozTab|null} [val]
      */
     set selectedItem(val) {
+      val = window.gZenGlanceManager?.getTabOrGlanceChild(val) || val;
       if (val && !val.selected) {
         // The selectedIndex setter ignores invalid values
         // such as -1 if |val| isn't one of our child nodes.
@@ -1137,7 +1155,7 @@
         if (tab == startTab) {
           return null;
         }
-        if (filter(tab)) {
+        if (filter(tab) && !tab.hasAttribute("zen-glance-tab") && !tab.hasAttribute("zen-empty-tab")) {
           return tab;
         }
       }
@@ -1199,13 +1217,30 @@
      * @param {boolean} [aWrap]
      */
     advanceSelectedTab(aDir, aWrap) {
+      if (window?.gZenGlanceManager?._animating) return;
       let { ariaFocusedItem } = this;
       let startTab = ariaFocusedItem;
       if (!ariaFocusedItem || !this.allTabs.includes(ariaFocusedItem)) {
-        startTab = this.selectedItem;
+        startTab = gZenGlanceManager.getFocusedTab(aDir) || this.selectedItem;
       }
       let newTab = null;
 
+      const tabFilter = tab => {
+        if (!tab.visible) {
+          return false
+        }
+        if (lazyZenPrefs.ignorePendingTabs && tab.hasAttribute("pending")) {
+          return false
+        }
+        if (!lazyZenPrefs.cycleByAttribute) {
+          return true
+        }
+        if (startTab.hasAttribute("zen-essential")) {
+          return tab.hasAttribute("zen-essential")
+        }
+        return !tab.hasAttribute("zen-essential")
+      }
+
       // Handle keyboard navigation for a hidden tab that can be selected, like the Firefox View tab,
       // which has a random placement in this.allTabs.
       if (startTab.hidden) {
@@ -1218,7 +1253,7 @@
         newTab = this.findNextTab(startTab, {
           direction: aDir,
           wrap: aWrap,
-          filter: tab => tab.visible,
+          filter: tabFilter,
         });
       }
 
