# josh-uudal/tabbit architecture

> Architecture diagram of the GitHub repository josh-uudal/tabbit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josh-uudal/tabbit
- Repository: https://github.com/josh-uudal/tabbit

## Overview

Tabbit is a Chromium extension for saving groups of tabs, closing them to free memory, and reopening them later. The main workflow starts in the popup: the user selects tabs, saves a named group, and Tabbit stores it; the group-detail page supports editing and continuing. The service worker handles reminders, recurring resets, archiving, previews, and opted-in navigation tracking. Major UI capabilities are represented, with storage and domain helpers shown as internal layers. Some connections are based on README statements because the relevant implementation excerpts are incomplete.

Main entry points: [`background/service-worker.js`](https://github.com/josh-uudal/tabbit/blob/main/background/service-worker.js) (Extension service worker), [`lib/storage.js`](https://github.com/josh-uudal/tabbit/blob/main/lib/storage.js) (Groups and settings), [`modal/modal.js`](https://github.com/josh-uudal/tabbit/blob/main/modal/modal.js) (Group detail and board), [`popup/popup.js`](https://github.com/josh-uudal/tabbit/blob/main/popup/popup.js) (Popup manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_surfaces["User surfaces"]
  node_popup["Popup manager<br/>[popup.js]"]
  node_detail["Group detail and board<br/>[modal.js]"]
  node_options["Options and backups<br/>[options.js]"]
end

subgraph group_lifecycle["Group lifecycle"]
  node_tabflow["Tab save and reopen<br/>[popup.js]"]
  node_follow["Follow navigation<br/>[tracking.js]"]
end

subgraph group_services["Background services"]
  node_worker["Extension service worker<br/>[service-worker.js]"]
  node_reminders["Reminder scheduling<br/>[reminders.js]"]
  node_previews[("Preview cache<br/>[previews.js]")]
end

subgraph group_domain["Domain and storage"]
  node_groupstore[("Groups and settings<br/>[storage.js]")]
  node_models["Group and tab models<br/>[models.js]"]
  node_constants["Modes and defaults<br/>[constants.js]"]
  node_format["Display formatting<br/>[format.js]"]
end

node_user(("User"))
node_browser["Chromium APIs"]

node_user -->|"saves tabs"| node_popup
node_user -->|"manages groups"| node_detail
node_popup -->|"reads and writes"| node_groupstore
node_popup -->|"saves or continues"| node_tabflow
node_tabflow -->|"closes and opens tabs"| node_browser
node_tabflow -->|"pins thumbnails"| node_previews
node_tabflow -->|"persists group"| node_groupstore
node_popup -->|"opens tracked tabs"| node_follow
node_detail -->|"reads and edits"| node_groupstore
node_detail -->|"loads thumbnails"| node_previews
node_detail -->|"manages saved tabs"| node_browser
node_detail -->|"requests reminders"| node_worker
node_options -->|"imports and exports"| node_groupstore
node_options -->|"clears cache"| node_previews
node_worker -->|"runs maintenance"| node_groupstore
node_worker -->|"schedules and clears"| node_reminders
node_worker -->|"captures previews"| node_previews
node_worker -->|"tracks navigation"| node_follow
node_worker -->|"uses tab and alarm APIs"| node_browser
node_worker -->|"shows notifications"| node_browser
node_groupstore -->|"persists local data"| node_browser
node_previews -->|"stores in IndexedDB"| node_browser
node_reminders -->|"uses reminder modes"| node_constants
node_groupstore -->|"normalizes groups"| node_models
node_models -->|"uses defaults"| node_constants
node_popup -->|"formats display"| node_format
node_detail -->|"formats display"| node_format

click node_popup "https://github.com/josh-uudal/tabbit/blob/main/popup/popup.js"
click node_detail "https://github.com/josh-uudal/tabbit/blob/main/modal/modal.js"
click node_options "https://github.com/josh-uudal/tabbit/blob/main/options/options.js"
click node_tabflow "https://github.com/josh-uudal/tabbit/blob/main/popup/popup.js"
click node_follow "https://github.com/josh-uudal/tabbit/blob/main/lib/tracking.js"
click node_worker "https://github.com/josh-uudal/tabbit/blob/main/background/service-worker.js"
click node_reminders "https://github.com/josh-uudal/tabbit/blob/main/lib/reminders.js"
click node_previews "https://github.com/josh-uudal/tabbit/blob/main/lib/previews.js"
click node_groupstore "https://github.com/josh-uudal/tabbit/blob/main/lib/storage.js"
click node_models "https://github.com/josh-uudal/tabbit/blob/main/lib/models.js"
click node_constants "https://github.com/josh-uudal/tabbit/blob/main/config/constants.js"
click node_format "https://github.com/josh-uudal/tabbit/blob/main/lib/format.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_popup,node_detail,node_options,node_user toneBlue
class node_tabflow,node_follow toneAmber
class node_worker,node_reminders,node_previews,node_browser toneMint
class node_groupstore,node_models,node_constants,node_format toneRose
```

## Components

### User surfaces

- [Popup manager](https://github.com/josh-uudal/tabbit/blob/main/popup/popup.js): `popup/popup.js`
- [Group detail and board](https://github.com/josh-uudal/tabbit/blob/main/modal/modal.js): `modal/modal.js`
- [Options and backups](https://github.com/josh-uudal/tabbit/blob/main/options/options.js): `options/options.js`

### Group lifecycle

- [Tab save and reopen](https://github.com/josh-uudal/tabbit/blob/main/popup/popup.js): `popup/popup.js`
- [Follow navigation](https://github.com/josh-uudal/tabbit/blob/main/lib/tracking.js): `lib/tracking.js`

### Background services

- [Extension service worker](https://github.com/josh-uudal/tabbit/blob/main/background/service-worker.js): `background/service-worker.js`
- [Reminder scheduling](https://github.com/josh-uudal/tabbit/blob/main/lib/reminders.js): `lib/reminders.js`
- [Preview cache](https://github.com/josh-uudal/tabbit/blob/main/lib/previews.js): `lib/previews.js`

### Domain and storage

- [Groups and settings](https://github.com/josh-uudal/tabbit/blob/main/lib/storage.js): `lib/storage.js`
- [Group and tab models](https://github.com/josh-uudal/tabbit/blob/main/lib/models.js): `lib/models.js`
- [Modes and defaults](https://github.com/josh-uudal/tabbit/blob/main/config/constants.js): `config/constants.js`
- [Display formatting](https://github.com/josh-uudal/tabbit/blob/main/lib/format.js): `lib/format.js`

### Other components

- **User**
- **Chromium APIs**

## Connections

- User → Popup manager: saves tabs (evidence: `README.md`)
- User → Group detail and board: manages groups (evidence: `README.md`)
- Popup manager → Groups and settings: reads and writes (evidence: `popup/popup.js`)
- Popup manager → Tab save and reopen: saves or continues (evidence: `README.md`)
- Tab save and reopen → Chromium APIs: closes and opens tabs (evidence: `README.md`)
- Tab save and reopen → Preview cache: pins thumbnails (evidence: `popup/popup.js`)
- Tab save and reopen → Groups and settings: persists group (evidence: `popup/popup.js`)
- Popup manager → Follow navigation: opens tracked tabs (evidence: `popup/popup.js`)
- Group detail and board → Groups and settings: reads and edits (evidence: `modal/modal.js`)
- Group detail and board → Preview cache: loads thumbnails (evidence: `modal/modal.js`)
- Group detail and board → Chromium APIs: manages saved tabs (evidence: `README.md`)
- Group detail and board → Extension service worker: requests reminders (evidence: `modal/modal.js`)
- Options and backups → Groups and settings: imports and exports (evidence: `options/options.js`)
- Options and backups → Preview cache: clears cache (evidence: `options/options.js`)
- Extension service worker → Groups and settings: runs maintenance (evidence: `background/service-worker.js`)
- Extension service worker → Reminder scheduling: schedules and clears (evidence: `background/service-worker.js`)
- Extension service worker → Preview cache: captures previews (evidence: `README.md`)
- Extension service worker → Follow navigation: tracks navigation (evidence: `background/service-worker.js`)
- Extension service worker → Chromium APIs: uses tab and alarm APIs (evidence: `README.md`)
- Extension service worker → Chromium APIs: shows notifications (evidence: `background/service-worker.js`)
- Groups and settings → Chromium APIs: persists local data (evidence: `README.md`)
- Preview cache → Chromium APIs: stores in IndexedDB (evidence: `README.md`)
- Reminder scheduling → Modes and defaults: uses reminder modes (evidence: `lib/reminders.js`)
- Groups and settings → Group and tab models: normalizes groups (evidence: `lib/storage.js`)
- Group and tab models → Modes and defaults: uses defaults (evidence: `lib/models.js`)
- Popup manager → Display formatting: formats display (evidence: `popup/popup.js`)
- Group detail and board → Display formatting: formats display (evidence: `modal/modal.js`)
