From 9d41cdddd2a58ad2db02a6f42908e06399753bd7 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 20 Feb 2026 16:03:09 +0000 Subject: [PATCH] Add story 53: WebSocket push notifications for panel auto-refresh Co-Authored-By: Claude Opus 4.6 --- .../53_websocket_push_notifications_for_ui.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .story_kit/stories/upcoming/53_websocket_push_notifications_for_ui.md diff --git a/.story_kit/stories/upcoming/53_websocket_push_notifications_for_ui.md b/.story_kit/stories/upcoming/53_websocket_push_notifications_for_ui.md new file mode 100644 index 0000000..f70e5e7 --- /dev/null +++ b/.story_kit/stories/upcoming/53_websocket_push_notifications_for_ui.md @@ -0,0 +1,39 @@ +--- +name: WebSocket Push Notifications for Panel Auto-Refresh +test_plan: pending +--- + +# Story 53: WebSocket Push Notifications for Panel Auto-Refresh + +## User Story + +As a user, I want the UI panels to update automatically when server-side state changes, so that I don't have to manually click Refresh to see current data. + +## Context + +The WebSocket at `/ws` already exists for chat streaming. Server-side deterministic commands (create_story, create_bug, close_bug, record_tests, ensure_acceptance, start_agent, etc.) mutate state that the panels display. Currently, panels only update on mount or manual refresh. + +By pushing lightweight notification events over the existing WebSocket when mutations occur, the frontend can auto-refresh the affected panel without polling. + +## Acceptance Criteria + +- [ ] The server broadcasts a notification event over the WebSocket when any of these mutations occur: + - Story created, moved, or archived + - Bug created or closed + - Tests recorded or acceptance checked + - Coverage collected + - Agent started, completed, or failed +- [ ] Notification events are simple typed messages (e.g. `{"type": "notification", "topic": "stories"}`) — not full data payloads +- [ ] The frontend listens for notification events and auto-refreshes the relevant panel: + - `stories` → UpcomingPanel, ReviewPanel + - `bugs` → (future BugPanel, no-op for now) + - `tests` / `acceptance` → GatePanel, TodoPanel + - `agents` → AgentPanel +- [ ] Manual refresh buttons continue to work as before +- [ ] Panels do not flicker or lose scroll position on auto-refresh + +## Out of Scope + +- File-system watching (inotify/fsevents) for changes made outside the server +- Replacing the existing AgentPanel SSE with WebSocket (it works fine as-is) +- Debouncing rapid successive notifications (can be a follow-up)