Skip to content

bug: newly opened tabs not reflected in grouping view #2

Description

@ojfbot

Problem

When new browser tabs are opened while GroupThink is active, they don't appear in the treemap view. The app loads from chrome.storage.local cache on mount and the background regroup mechanism doesn't reliably propagate updates to the UI.

Current behavior

  1. App loads → reads cached grouping from storage → displays it
  2. Background scheduleRegroup() fires 10s after tab create/remove/URL change
  3. Background saves updated grouping to storage
  4. App has a chrome.storage.onChanged listener + silent doGrouping() on initial load
  5. But new tabs still don't appear — the update path isn't working end-to-end

Expected behavior

New tabs should appear in the grouping within ~10-15 seconds of being opened, without requiring a manual Refresh click.

Investigation areas

  • Is the background scheduleRegroup actually firing? (check service worker console logs)
  • Is chrome.storage.onChanged listener receiving events in the app page context?
  • Does the silent doGrouping complete but the result get ignored due to state guards (loadingPhase !== "idle" check)?
  • Race condition: silent regroup kicks off on mount, completes, but loadingPhase is still not "idle" at that point?
  • The chrome.storage.onChanged listener checks loadingPhase !== "idle" || chatLoading — during silent regroup loadingPhase stays at "idle", so this guard should be fine. But verify.

Relevant code

  • src/app/index.tsx — initial load effect (line ~138), storage listener (line ~162), silent doGrouping
  • src/background/index.tsscheduleRegroup() (line ~120), handleMessage("group-tabs")
  • src/lib/storage.tsStorage.setGrouping()

Workaround

Click the "Refresh" button in the header to trigger a full regroup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions