diff --git a/toolkit/content/widgets/tabbox.js b/toolkit/content/widgets/tabbox.js
index 38c1199d91c7a8d8155ab7f48e731675a3b6a3ec..ce1dd5caa85e416cff5a05ae127ad17fa013c4e4 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",
@@ -214,7 +231,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);
@@ -901,7 +918,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;
         }
@@ -937,6 +954,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.
@@ -1114,7 +1132,7 @@
         if (tab == startTab) {
           return null;
         }
-        if (filter(tab)) {
+        if (filter(tab) && !tab.hasAttribute("zen-glance-tab") && !tab.hasAttribute("zen-empty-tab")) {
           return tab;
         }
       }
@@ -1176,13 +1194,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) {
@@ -1195,7 +1230,7 @@
         newTab = this.findNextTab(startTab, {
           direction: aDir,
           wrap: aWrap,
-          filter: tab => tab.visible,
+          filter: tabFilter,
         });
       }
 
