feat: merge duplicate notifications (#2056)

Use the `ignoreDuplicates` prop from vue3-notification to ignore duplicate notifications, show a count (×N) instead when notifications are merged.

Superseeds and closes https://github.com/go-vikunja/vikunja/pull/971

---------

Co-authored-by: Dominik Pschenitschni <6173598+dpschen@users.noreply.github.com>
This commit is contained in:
kolaente
2026-01-06 18:36:29 +01:00
committed by GitHub
parent 29b5f7b95e
commit 0ebecb99ba
3 changed files with 54 additions and 8 deletions

View File

@@ -0,0 +1,30 @@
import {test, expect} from '../../support/fixtures'
test.describe('Duplicate Notifications', () => {
test('Merges duplicate notifications and shows count', async ({authenticatedPage: page}) => {
await page.goto('/')
await page.waitForLoadState('networkidle')
// Trigger the same notification twice via the Vue app using $notify directly
await page.evaluate(() => {
const app = document.getElementById('app')
const vueApp = (app as any).__vue_app__
vueApp.config.globalProperties.$notify({
type: 'success',
title: 'Test',
text: 'Duplicate Test',
})
vueApp.config.globalProperties.$notify({
type: 'success',
title: 'Test',
text: 'Duplicate Test',
})
})
// Should only show one notification with a count of ×2
const notification = page.locator('.global-notification .vue-notification.success')
await expect(notification).toHaveCount(1)
await expect(notification.locator('.notification-content')).toContainText('Duplicate Test')
await expect(notification.locator('.notification-content')).toContainText('×2')
})
})