Skip to content

feat(module-07): wire live presence and lobby chat into the UI - #13

Open
MohanEhab wants to merge 3 commits into
mainfrom
feature/module-07-realtime-presence-chat
Open

feat(module-07): wire live presence and lobby chat into the UI#13
MohanEhab wants to merge 3 commits into
mainfrom
feature/module-07-realtime-presence-chat

Conversation

@MohanEhab

Copy link
Copy Markdown
Contributor

Summary

  • Wires the Module 7 SignalR presence hub and persistent lobby chat into the frontend.

What changed

  • New RealtimeConnectionProvider (wraps the app inside AuthProvider in layout.tsx) managing the SignalR connection lifecycle and presence state.
  • New src/features/chat (chatApi, types) and src/features/realtime (errors, presence, types) modules.
  • ChatPanel rebuilt for live chat send/receive, history paging, and presence display.
  • Sidebar/Topbar/Dashboard/Landing/Lobby/GameRoom/Settings pages updated to consume live presence.
  • Added @microsoft/signalr dependency (plus incidental toolchain bumps: next, eslint-config-next, vitest, @vitejs/plugin-react — kept bundled with this change since that's the exact dependency set that was built/tested/E2E-verified together).

Tests

  • New component tests (ChatPanel.test.tsx, api-client.test.ts) and a new Playwright E2E spec (module-07-realtime-chat.spec.ts).
  • Updated existing component tests (Dashboard, LobbyPage, SettingsPrivacy, Sidebar) for the new presence-aware behavior.

Security/docs

  • Frontend security review closed: see docs/modules/module-07-realtime-presence-chat/technical-flow.md and the security audit in SimPle.Project (docs/security/audits/module-07-realtime-presence-chat.md).

Risks/deferred

  • releaseEligible remains false pending Module 14 (containerized/staging deployment, hosted CI). This PR only lands locally-verified feature work, same status as modules 4-6 already on main.
  • This branch's history includes the pre-existing fix(module-06-lobby-matchmaking): resolve Active Lobby link from real membership commit, which was not yet on origin/main at branch time and has not been separately PR'd.

… membership

The sidebar's Active Lobby link pointed at a hardcoded lobby code (SP-7F-29).
Resolve the user's active lobby from lobbyApi.getMyActive() and hide the link
when they are not in one. Also clear the stored lobby credential on leave and
add the test:coverage script.
…chat into the UI

Adds the SignalR connection provider, presence dots, and ChatPanel wiring
across LobbyPage, Sidebar, Topbar, DashboardPage, and SettingsPage,
replacing the mock presence/chat placeholder. Includes two incidental
accessibility fixes found during E2E verification (missing LobbyPage
<h1>, low-contrast chat placeholder text).
…e for presence/chat

Covers ChatPanel, the SignalR-mocking api-client tests, and updates
existing DashboardFriends/LobbyPage/SettingsPrivacy/SidebarFriendBadge
tests for the new presence wiring. Adds the live-stack Playwright spec
for presence + chat + disconnect/reconnect convergence.
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.

1 participant