Skip to content

Add snooze feature to mute chats until a wake time#1

Open
nanorepublica wants to merge 1 commit into
mainfrom
claude/blip-tracker-snooze-ob65ys
Open

Add snooze feature to mute chats until a wake time#1
nanorepublica wants to merge 1 commit into
mainfrom
claude/blip-tracker-snooze-ob65ys

Conversation

@nanorepublica

Copy link
Copy Markdown
Member

Adds a snooze feature that lets users temporarily mute chats from the popup, removing them from the queue and badge until a specified wake time.

Summary

Users can now snooze individual chats from the popup with preset times (1 hour, tomorrow 9am, 3 days, 1 week) or a custom datetime. Snoozed chats are stored in chrome.storage.local, decorated with a 💤🔴 title prefix (synced to mobile), and automatically wake via a one-shot alarm even between sweeps. A collapsed "Snoozed" section in the popup shows muted chats with their wake times.

Key Changes

New snooze library (lib/snooze.js):

  • Pure helper functions for snooze bookkeeping: presetWakeTime(), isSnoozed(), partitionBySnooze(), pruneSnoozes(), formatWake()
  • Comprehensive unit tests covering all preset logic and edge cases
  • Human-readable wake time formatting ("in 45 min", "today 17:30", "tomorrow 09:00", etc.)

Popup UI (popup.js, popup.html):

  • Snooze button (💤) on each waiting chat that opens an inline panel
  • Preset buttons + custom datetime input with validation
  • Collapsed "Snoozed" section showing muted chats sorted by wake time
  • Panel repositions under the clicked row and closes on action

Background worker (background.js):

  • setSnooze() / clearSnooze() handlers store/remove snooze times
  • resetWakeAlarm() creates a one-shot 'snooze-wake' alarm at the earliest wake time
  • Sweep now detects stale 💤 prefixes (expired snoozes on quiet chats) and re-applies titles
  • listWaiting() self-heals expired snoozes and partitions items into waiting/snoozed lists
  • Badge counts only unsnoozed waiting chats

Title transform (lib/titleTransform.js):

  • Extended to handle 💤🔴 compound prefix (longest-first stripping for idempotency)
  • titleTransform() now accepts a snoozed boolean to apply the sleep emoji when active

Documentation:

  • Updated README with snooze feature overview
  • Updated ROADMAP to mark snooze as complete
  • Version bumped to 0.2.0

Implementation Details

  • Snoozes are stored as { [uuid]: wakeEpochMs } in local storage, the source of truth for wake times
  • The 💤 prefix is derived display only — the sweep keeps it while active and removes it on expiry
  • Snooze expiry is deterministic (no timers in the short-lived popup); the alarm triggers a sweep that prunes expired entries and restores titles
  • All snooze math is deterministic and unit-testable (functions accept now parameter)
  • Snoozes are pruned when chats leave the list window or flip to ✅, preventing unbounded storage growth

https://claude.ai/code/session_01R6p4zmfuELLCTeHnuDxxFr

Snoozing a 🔴 chat from the popup removes it from the queue and badge
until a chosen wake time (presets: 1 hour / tomorrow 9am / 3 days /
1 week, or a custom date-time). While snoozed the title becomes 💤🔴 —
still red, synced to mobile like any label — and the chat sits in a
collapsed "Snoozed" section with its wake time and a wake-now button.

The wake schedule lives in chrome.storage.local ({ uuid: wakeEpochMs },
same pattern as `seen`); the 💤 title is derived from it, so the
idempotent sweep keeps rather than reverts it. A chained one-shot
'snooze-wake' alarm fires a sweep at the earliest wake time, which
strips the stale 💤 (bypassing the `seen` shortcut for titles that
disagree with the schedule), fixes the badge, prunes expired/resolved
entries, and re-arms for the next wake. New replies never cancel a
snooze; resolving (✅) does.

Adds the repo's first unit tests (node --test extension/lib/*.test.js)
covering the snooze date math and titleTransform idempotency across the
new 💤🔴 prefix. Bumps the extension to 0.2.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R6p4zmfuELLCTeHnuDxxFr
@netlify

netlify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy Preview for bliptracker ready!

Name Link
🔨 Latest commit 4f884df
🔍 Latest deploy log https://app.netlify.com/projects/bliptracker/deploys/6a5777ab48d6dc0008e7bbbe
😎 Deploy Preview https://deploy-preview-1--bliptracker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

2 participants