Work Queue: Snooze Actions & Sidebar Badge Counts
Work Queue: Snooze Actions & Sidebar Badge Counts
Status: Known inconsistency identified in v0.1.160 — fix in progress.
Overview
The Work Queue allows landlords, agents, and tenants to manage outstanding tasks — disputes, compliance items, and other actions — from a single dashboard view. Items in the queue can be snoozed to temporarily hide them and revisit them later.
How Snooze State Currently Works
Snooze and actioned states are stored in the browser's localStorage under the following keys:
| Key | Purpose |
|---|---|
wq_snooze_v1 | General work queue snoozed items |
wq_compliance_snooze_v1 | Compliance-related snoozed items |
This means:
- Snooze state is per-browser and per-device. If a user logs in on a different device or clears their browser storage, snoozed items will reappear.
- The server has no knowledge of which items a given user has snoozed.
Known Issue: Sidebar Badges Show Unsnoozed Counts
Sidebar badge counts (e.g. "3 disputes") are sourced from the server-side trpc.dashboard.workQueue query. Because the server does not have access to localStorage snooze state, badge counts do not decrease when items are snoozed.
This creates a visible disconnect:
- The Work Queue view correctly hides snoozed items.
- The sidebar badge continues to count those snoozed items, showing a number higher than the visible, actionable queue.
Affected file: src/app/dashboard/work-queue.tsx
Planned Resolution
The following approaches are being evaluated, in order of implementation complexity:
Short-Term: Shared Snooze Context (Client-Side)
Introduce a shared React context that reads from the existing localStorage snooze stores and subtracts snoozed counts from badge totals before they are rendered in the sidebar. No server changes required.
Medium-Term: API-Aware Snooze Counts
Update the trpc.dashboard.workQueue query to accept and subtract snoozed item counts, either passed from the client or stored server-side.
Long-Term: Server-Side Snooze State
Migrate snooze state from localStorage to a dedicated snoozed_work_items database table. Benefits include:
- Accurate badge counts returned directly from the API.
- Consistent snooze state across devices and sessions.
- Ability to surface snooze expiry and reminders server-side.
Current Workaround
There is no user-facing workaround at this time. Snoozed items are correctly hidden in the queue view. Sidebar badge numbers may be higher than the count of currently visible, actionable items — this is a display inconsistency only and does not affect underlying data or task state.