Skip to content

feat: add window management (merge + labels)#24

Open
GindaChen wants to merge 1 commit into
zarazhangrui:mainfrom
GindaChen:feat/window-management
Open

feat: add window management (merge + labels)#24
GindaChen wants to merge 1 commit into
zarazhangrui:mainfrom
GindaChen:feat/window-management

Conversation

@GindaChen

Copy link
Copy Markdown

Summary

  • Merge windows button consolidates all Chrome windows into the current one with a single click
  • Show/Hide windows toggle labels each tab with its window of origin (Window 1, Window 2, etc.)
  • Window count displayed in the footer stats alongside the existing tab count

Why

Users with tabs spread across multiple Chrome windows have no easy way to see which tab lives where, or to consolidate everything when context-switching. This is especially useful when you've accumulated windows throughout the day and want to clean up without losing tabs.

What's included

  • JS (~75 lines):
    • buildWindowNameMap() assigns sequential names to each unique windowId
    • getWindowCount() returns the number of distinct windows
    • mergeAllWindows() moves all tabs into the current window via chrome.tabs.move()
    • showWindowLabels toggle state and re-render logic
    • Two new event handlers (merge-windows, toggle-window-labels) in the existing delegation listener
  • HTML: one additional <div class="stat"> in the footer for window count
  • CSS (~13 lines): .chip-window-badge style using the existing --accent-slate token

How it works

  1. On render, buildWindowNameMap() maps each windowId → "Window 1", "Window 2", etc.
  2. If 2+ windows exist, two buttons appear in the section header:
    • "Merge N windows" — calls chrome.tabs.move() for every tab not in the current window, then re-renders
    • "Show windows" — toggles showWindowLabels, which adds a small slate-blue badge to each tab chip
  3. After merging, only 1 window remains → both buttons auto-hide on next render
  4. Footer shows the live window count

Test plan

  • With 1 window open: verify no merge button or window toggle appears (clean UI)
  • Open 2+ Chrome windows, reload Tab Out: verify "Merge N windows" and "Show windows" buttons appear
  • Click "Show windows" — verify each tab chip shows a "Window 1" / "Window 2" badge
  • Click "Hide windows" — verify badges disappear
  • Click "Merge N windows" — verify all tabs move to the current window, other windows close
  • After merge, verify buttons disappear and footer shows "1" window
  • Verify footer window count updates correctly as windows open/close

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pintaste added a commit to pintaste/tab-out that referenced this pull request May 16, 2026
Window count in footer stats. Merge-all-windows button consolidates tabs into current window. Show/Hide window labels toggle adds badge to each tab chip showing source window. Adapted from upstream PR zarazhangrui#24 by GindaChen.
pintaste added a commit to pintaste/tab-out that referenced this pull request May 19, 2026
Added groupByWindow toggle with Group by window/domain layout control. Each tab chip now has a move-to-window button that opens a popover listing target windows or creating a new one. Uses buildWindowGroups() for per-window section rendering. Adapted from upstream PR zarazhangrui#25 by GindaChen, built on top of existing window management from zarazhangrui#24.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant