Add desktop notification bridge for DS Chat Desktop (#49)

Offline members now also get a desktop_notification WS envelope
alongside the existing Web Push send, since Electron has no push
delivery service configured. The client only acts on it when
window.dsDesktop is present and the user's local preference allows it,
so the server needs no awareness of which clients are Electron.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-18 10:27:20 -06:00
co-authored by Claude Sonnet 5
parent 2a84a9c9bd
commit e0f85cec79
8 changed files with 399 additions and 14 deletions
+7 -1
View File
@@ -2,6 +2,7 @@ import { Navigate, Route, Routes } from 'react-router-dom'
import { AuthProvider, useAuth } from './context/AuthContext'
import { ChatSocketProvider } from './context/ChatSocketContext'
import { AdminRoute } from './components/AdminRoute'
import { DesktopNotificationBridge } from './components/DesktopNotificationBridge'
import { ProtectedRoute } from './components/ProtectedRoute'
import { UpdateBanner } from './components/UpdateBanner'
import { LoginPage } from './pages/LoginPage'
@@ -55,7 +56,12 @@ function AppRoutes() {
// is currently open.
const { user } = useAuth()
if (!user) return routes
return <ChatSocketProvider key={user.id}>{routes}</ChatSocketProvider>
return (
<ChatSocketProvider key={user.id}>
<DesktopNotificationBridge />
{routes}
</ChatSocketProvider>
)
}
function App() {