Port modular app notifications, pargar date display, and closed-store product UX.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-25 16:29:33 +02:00
co-authored by Cursor
parent 4fd12277e7
commit e6dea15752
33 changed files with 1253 additions and 47 deletions
+26
View File
@@ -375,6 +375,24 @@ function handleAssetsPayload(payload: unknown) {
void applyAssetsFromStream(payload)
}
function handleAppNotificationPayload(payload: unknown) {
if (!payload || typeof payload !== 'object') {
return
}
touchStreamActivity()
void applyAppNotificationFromStream(payload as Record<string, unknown>)
}
async function applyAppNotificationFromStream(payload: Record<string, unknown>) {
try {
const { bumpUnreadFromStream } = await import('@/composables/useAppNotificationBadge')
bumpUnreadFromStream(payload)
} catch (error) {
console.warn('App notification SSE apply failed', error)
}
}
function bindStreamEvents(source: EventSource) {
source.addEventListener('last', (event) => {
try {
@@ -400,6 +418,14 @@ function bindStreamEvents(source: EventSource) {
}
})
source.addEventListener('app_notification', (event) => {
try {
handleAppNotificationPayload(JSON.parse(event.data))
} catch (error) {
console.warn('App notification SSE parse failed', error)
}
})
source.addEventListener('ping', () => {
touchStreamActivity()
})