diff --git a/extension/app.js b/extension/app.js
index b2ecb78c..b679d8e3 100644
--- a/extension/app.js
+++ b/extension/app.js
@@ -707,6 +707,52 @@ const ICONS = {
IN-MEMORY STORE FOR OPEN-TAB GROUPS
---------------------------------------------------------------- */
let domainGroups = [];
+let showWindowLabels = false;
+let windowNameMap = {};
+
+
+/* ----------------------------------------------------------------
+ WINDOW MANAGEMENT
+ ---------------------------------------------------------------- */
+
+/**
+ * buildWindowNameMap()
+ *
+ * Assigns sequential names (Window 1, Window 2, ...) to each unique
+ * windowId so we can label tabs with their window of origin.
+ */
+function buildWindowNameMap() {
+ const windowIds = [...new Set(openTabs.map(t => t.windowId))];
+ windowNameMap = {};
+ windowIds.forEach((id, i) => {
+ windowNameMap[id] = `Window ${i + 1}`;
+ });
+}
+
+/**
+ * getWindowCount()
+ *
+ * Returns the number of distinct Chrome windows that have open tabs.
+ */
+function getWindowCount() {
+ return new Set(openTabs.map(t => t.windowId)).size;
+}
+
+/**
+ * mergeAllWindows()
+ *
+ * Moves all tabs from every other window into the current window.
+ * After merging, re-fetches the tab list.
+ */
+async function mergeAllWindows() {
+ const currentWindow = await chrome.windows.getCurrent();
+ const allTabs = await chrome.tabs.query({});
+ const tabsToMove = allTabs.filter(t => t.windowId !== currentWindow.id);
+ for (const tab of tabsToMove) {
+ await chrome.tabs.move(tab.id, { windowId: currentWindow.id, index: -1 });
+ }
+ await fetchOpenTabs();
+}
/* ----------------------------------------------------------------
@@ -849,9 +895,11 @@ function renderDomainCard(group) {
let domain = '';
try { domain = new URL(tab.url).hostname; } catch {}
const faviconUrl = domain ? `https://www.google.com/s2/favicons?domain=${domain}&sz=16` : '';
+ const winLabel = showWindowLabels && windowNameMap[tab.windowId]
+ ? `${windowNameMap[tab.windowId]}` : '';
return `
${faviconUrl ? `

` : ''}
-
${label}${dupeTag}
+
${label}${dupeTag}${winLabel}
+
Tab Out by Zara
diff --git a/extension/style.css b/extension/style.css
index c7bc0b5d..3f101d14 100644
--- a/extension/style.css
+++ b/extension/style.css
@@ -1156,3 +1156,17 @@ footer { animation: fadeUp 0.5s ease 0.65s both; }
opacity: 0.6;
flex-shrink: 0;
}
+
+/* ---- Window badge on tab chips ---- */
+.chip-window-badge {
+ font-size: 9px;
+ font-weight: 600;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ color: var(--accent-slate);
+ background: rgba(90, 107, 122, 0.1);
+ padding: 1px 6px;
+ border-radius: 3px;
+ flex-shrink: 0;
+ white-space: nowrap;
+}