refactor(chronik): replace callback props with form actions in ChronikFuerDichBox
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m20s
CI / OCR Service Tests (pull_request) Successful in 21s
CI / Backend Unit Tests (pull_request) Successful in 3m22s
CI / fail2ban Regex (pull_request) Successful in 46s
CI / Semgrep Security Scan (pull_request) Successful in 19s
CI / Compose Bucket Idempotency (pull_request) Successful in 58s
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m20s
CI / OCR Service Tests (pull_request) Successful in 21s
CI / Backend Unit Tests (pull_request) Successful in 3m22s
CI / fail2ban Regex (pull_request) Successful in 46s
CI / Semgrep Security Scan (pull_request) Successful in 19s
CI / Compose Bucket Idempotency (pull_request) Successful in 58s
Dismiss (X) button and mark-all-read button now submit forms to /aktivitaeten?/dismiss-notification and /aktivitaeten?/mark-all-read respectively. Props renamed onMarkRead/onMarkAllRead → optimisticMarkRead/optimisticMarkAllRead. aktivitaeten/+page.svelte drops the now-deleted onMarkRead/onMarkAllRead wrapper functions and passes notificationStore.optimisticMarkRead/optimisticMarkAllRead directly to the box. Tests: $app/forms enhance mock added to both spec files so dismiss and mark-all assertions work synchronously against form-submit events. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -76,14 +76,6 @@ async function onFilterChange(v: FilterValue) {
|
||||
});
|
||||
}
|
||||
|
||||
async function onMarkRead(n: NotificationItem) {
|
||||
await notificationStore.markRead(n);
|
||||
}
|
||||
|
||||
async function onMarkAllRead() {
|
||||
await notificationStore.markAllRead();
|
||||
}
|
||||
|
||||
const displayFeed = $derived(applyClientFilter(data.activityFeed, data.filter));
|
||||
|
||||
const isEmpty = $derived(displayFeed.length === 0);
|
||||
@@ -108,7 +100,11 @@ function retry() {
|
||||
{#if data.loadError === 'activity'}
|
||||
<ChronikErrorCard onRetry={retry} />
|
||||
{:else}
|
||||
<ChronikFuerDichBox unread={unread} onMarkRead={onMarkRead} onMarkAllRead={onMarkAllRead} />
|
||||
<ChronikFuerDichBox
|
||||
unread={unread}
|
||||
optimisticMarkRead={notificationStore.optimisticMarkRead}
|
||||
optimisticMarkAllRead={notificationStore.optimisticMarkAllRead}
|
||||
/>
|
||||
|
||||
<div class="mt-6">
|
||||
<ChronikFilterPills value={data.filter} onChange={onFilterChange} />
|
||||
|
||||
Reference in New Issue
Block a user