[claude] Add offline message queue for Workshop panel (#913) #1205

Merged
Rockachopa merged 1 commits from claude/issue-913 into main 2026-03-23 22:16:28 +00:00
Collaborator

Fixes #913

What changed

static/world/queue.js (new)

  • localStorage-backed message queue with QUEUED / DELIVERED / FAILED status tracking
  • 24-hour auto-expiry for failed items; prune() cleans on load
  • Minimal API: enqueue(), markDelivered(), markFailed(), getPending(), pendingCount()

static/world/state.js

  • 30-second health-check loop polling /api/matrix/health with a 5-second timeout
  • onConnectionChange(fn) listener — fires only on actual transitions (offline → online and vice versa)
  • WebSocket auto-reconnect after 5 seconds on close
  • isOnline getter
  • Immediate ping on connect() so status is known before first interval

static/world/index.html

  • Form submission now uses AbortSignal.timeout(8000) so network hangs fail fast
  • On fetch error: enqueue to localStorage, show amber "Job Queued" modal state with job count
  • stateReader.onConnectionChange handler replays all pending queue items in order when server comes back; marks each delivered or failed
  • Amber pulsing badge in overlay corner shows pending count across page loads

static/world/style.css

  • Queued state panel with clock icon
  • .queue-count-display and .queue-badge with amber palette and pulse animation
Fixes #913 ## What changed **`static/world/queue.js`** (new) - `localStorage`-backed message queue with `QUEUED` / `DELIVERED` / `FAILED` status tracking - 24-hour auto-expiry for failed items; `prune()` cleans on load - Minimal API: `enqueue()`, `markDelivered()`, `markFailed()`, `getPending()`, `pendingCount()` **`static/world/state.js`** - 30-second health-check loop polling `/api/matrix/health` with a 5-second timeout - `onConnectionChange(fn)` listener — fires only on actual transitions (offline → online and vice versa) - WebSocket auto-reconnect after 5 seconds on close - `isOnline` getter - Immediate ping on `connect()` so status is known before first interval **`static/world/index.html`** - Form submission now uses `AbortSignal.timeout(8000)` so network hangs fail fast - On fetch error: enqueue to localStorage, show amber "Job Queued" modal state with job count - `stateReader.onConnectionChange` handler replays all pending queue items in order when server comes back; marks each delivered or failed - Amber pulsing badge in overlay corner shows pending count across page loads **`static/world/style.css`** - Queued state panel with clock icon - `.queue-count-display` and `.queue-badge` with amber palette and pulse animation
claude added 1 commit 2026-03-23 22:10:10 +00:00
feat: add offline message queue for Workshop panel (#913)
Some checks failed
Tests / lint (pull_request) Failing after 14s
Tests / test (pull_request) Has been skipped
68bbb437b3
- New queue.js: localStorage-backed message queue with QUEUED/DELIVERED/FAILED status and 24h auto-expiry
- state.js: add 30-second health-check polling via /api/matrix/health, WebSocket auto-reconnect, onConnectionChange listeners, and isOnline getter
- index.html: queue job submissions on network failure instead of silently faking success; replay pending queue on reconnection; amber "queued" modal state with job count
- style.css: queued state panel, clock icon, queue count display, and pulsing overlay badge showing pending count

Fixes #913

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rockachopa merged commit a5b95356dd into main 2026-03-23 22:16:28 +00:00
Rockachopa deleted branch claude/issue-913 2026-03-23 22:16:28 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1205