Auto-refresh UI when inbox changes (live updates) #2

Closed
opened 2026-03-01 11:08:48 +00:00 by Zeus · 1 comment
Owner

Currently the FileDrop UI requires manual page refresh to see new messages.

Desired behavior: The UI should automatically update when new messages arrive or are processed. Options:

  1. Polling: Frontend polls the API every N seconds for changes (simplest)
  2. WebSocket: Server pushes updates via WebSocket when inbox files change
  3. inotify + SSE: Use inotifywait on inbox dirs, push Server-Sent Events to frontend

Option 1 (polling every 5-10s) is probably fine for our scale. The API already returns message lists — just need a JS interval that re-fetches and diffs.

Acceptance criteria:

  • New messages appear in UI within 10 seconds without manual refresh
  • Processed/moved messages disappear from inbox view automatically
  • No excessive load (max 1 request per 5 seconds)
Currently the FileDrop UI requires manual page refresh to see new messages. **Desired behavior:** The UI should automatically update when new messages arrive or are processed. Options: 1. **Polling:** Frontend polls the API every N seconds for changes (simplest) 2. **WebSocket:** Server pushes updates via WebSocket when inbox files change 3. **inotify + SSE:** Use inotifywait on inbox dirs, push Server-Sent Events to frontend Option 1 (polling every 5-10s) is probably fine for our scale. The API already returns message lists — just need a JS interval that re-fetches and diffs. **Acceptance criteria:** - New messages appear in UI within 10 seconds without manual refresh - Processed/moved messages disappear from inbox view automatically - No excessive load (max 1 request per 5 seconds)
Zeus closed this issue 2026-03-01 11:13:16 +00:00
Author
Owner

Implemented polling-based auto-refresh in commit f2e4772.

Changes:

  • Added 7-second polling that diffs message state via hash — only updates DOM when something changed
  • Sidebar agent counts refresh automatically
  • Processed/moved messages disappear without manual reload
  • Subtle " Updated" indicator appears briefly when new data arrives
  • Pause/Resume toggle button in sidebar footer
  • Extracted shared renderMessages() function used by both initial load and polling
  • No excessive load: single fetch per poll cycle, no-op if hash unchanged
Implemented polling-based auto-refresh in commit f2e4772. Changes: - Added 7-second polling that diffs message state via hash — only updates DOM when something changed - Sidebar agent counts refresh automatically - Processed/moved messages disappear without manual reload - Subtle "✨ Updated" indicator appears briefly when new data arrives - Pause/Resume toggle button in sidebar footer - Extracted shared `renderMessages()` function used by both initial load and polling - No excessive load: single fetch per poll cycle, no-op if hash unchanged
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Zeus/filedrop-ui#2
No description provided.