Skip to content

Skip auto-closing tabs in excluded tab groups#2

Open
pajcho wants to merge 2 commits intolevelsio:mainfrom
pajcho:feat/exclude-tab-groups-from-cleanup
Open

Skip auto-closing tabs in excluded tab groups#2
pajcho wants to merge 2 commits intolevelsio:mainfrom
pajcho:feat/exclude-tab-groups-from-cleanup

Conversation

@pajcho
Copy link
Copy Markdown

@pajcho pajcho commented Apr 27, 2026

Summary

Adds a way to exclude Chrome tab groups from the Tab Cleaner's auto-close, alongside the existing host-based exclusions. Two layered controls:

  • Per-group toggles — each currently visible tab group shows up under Excluded Tab Groups with a switch. Flipping it on stores the group's title in the exclusion list. Excluded groups whose tabs are no longer open stay listed (as orphans) so you can remove them later.
  • Global toggleExclude all tab groups protects every grouped tab regardless of the per-group state. The per-group list dims while it's on, but the per-group state is preserved for when you turn it back off.

The popup also refreshes live: when a group is created, renamed, recolored, or removed (e.g. its last tab closed), the list updates without reopening the popup.

How it works

  • New tabGroups permission in manifest.json.
  • background.js resolves group titles for any tabs in groups during cleanup (only when at least one group exclusion is configured) and skips excluded ones at the same point as the host check.
  • New settings (excludeAllGroups, excludedGroupTitles) live in chrome.storage.local and are seeded with defaults on install.
  • Popup listens to chrome.tabGroups.onCreated/onUpdated/onRemoved while open and re-renders the list on each event.

Group exclusions are stored by title since group IDs reset on browser restart. As a side effect, untitled groups can't be excluded individually — the Exclude all toggle is the way to protect them, and the popup's empty-state message says so.

Demo

Screen.Recording.2026-04-28.at.10.03.41.mov

Test plan

  • Reload the extension at chrome://extensions — it should prompt to accept the new tabGroups permission.
  • Create a couple of named tab groups in your browser.
  • Open the popup → Tabs → toggle one group's switch on; confirm its title appears in the per-group list.
  • Set the auto-close timeout to 1 min, leave a tab in the excluded group inactive past the timeout, confirm it isn't closed.
  • Toggle Exclude all tab groups on; confirm the per-group list dims and grouped tabs aren't closed even with all per-group toggles off.
  • Close the last tab in a visible group; confirm the row disappears from the popup live.

Adds a per-group exclusion list and a global "Exclude all tab groups"
toggle to the Tab Cleaner page. Resolves group titles only when needed
during cleanup, and refreshes the popup list live when groups are
created, renamed, or removed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pajcho pajcho force-pushed the feat/exclude-tab-groups-from-cleanup branch from b63349c to f0c2278 Compare April 27, 2026 12:08
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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