Auto-collapse
Automatically collapse other tab groups when you expand one — keep your workspace focused without manual tidying.
Overview #
Auto-collapse watches for tab group expansions and collapses competing groups automatically. The feature ships in two tiers: a same-window mode available to all users and a cross-window mode for Premium subscribers.
Both settings are off by default. You must opt in via Settings → TAB GROUPS. Each toggle starts disabled; you must turn it on manually.
The settings are global toggles — they apply across all profiles and all windows. There is no profile-specific auto-collapse override.
How it works #
When auto-collapse is enabled, Takt listens for tabGroups.onUpdated events.
Whenever a group transitions to expanded (collapsed: false) and it is the only expanded
group in its window, Takt collapses all other groups in the same window. The predicate is
stateless — no suppression flag is stored. This means:
- Manual re-expand still works. Using the Alt + Shift + E expand-all shortcut (or the Expand All button) re-expands all groups normally. Auto-collapse does not suppress the expand-all command.
- No feedback loop. Collapsing groups does not itself trigger further collapse events.
Cross-window auto-collapse is triggered by tabs.onActivated events instead.
When you switch to a tab in window A, Takt collapses all tab groups in every other open
window after a debounce of 300 ms
(DEBOUNCE_MS = 300 in src/shared/constants.js). The debounce
prevents thrashing when switching tabs in quick succession.
Free vs Premium #
Premium Auto-collapse has two independent toggles, each controlling a different scope.
| Tier | Same-window collapse | Cross-window collapse |
|---|---|---|
| Free | ✓ (opt-in) | ✗ |
| Premium | ✓ (opt-in) | ✓ (opt-in) |
Enable same-window auto-collapse in Settings → TAB GROUPS → "Auto-collapse other groups when one expands".
Enable cross-window auto-collapse in Settings → TAB GROUPS → "Also collapse groups in other windows" (this toggle is disabled and labelled Premium for free users).
The two settings are independent. A Premium subscriber with only same-window enabled gets same-window behavior only — enabling the Premium toggle is a separate opt-in.
Edge cases and gotchas #
-
Both toggles default to off. Neither
autoCollapseEnablednorcrossWindowAutoCollapseEnabledstarts on. You must enable each in Settings before auto-collapse does anything. - 300 ms debounce on cross-window. Brief tab-switches (under 300 ms) do not trigger cross-window collapse. This prevents a quick tab-select from collapsing all your groups in other windows before you settle on a tab.
- Manual expand still works. After auto-collapse closes your other groups, you can re-expand them individually or use the expand-all shortcut (Alt + Shift + E). The stateless predicate means there is no suppression — expand-all runs unconditionally.
- Global setting, not profile-specific. The auto-collapse toggles apply globally across all profiles. Switching to a different Takt profile does not change whether auto-collapse is active.
- Stateless predicate. Takt does not store a suppression flag to prevent a group from being re-collapsed. If you expand a group and another group is already open, auto-collapse fires every time.