From f0b21e226e3cb41cac592738d797fcdef1fd0ea9 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 20 Apr 2026 18:08:17 +0200 Subject: [PATCH] refactor(chronik): remove unused form actions and broken pagination UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two items flagged as blockers in PR #288 review: - Markus + Sara: "Mehr laden" calls GET /api/dashboard/activity?offset=N but the backend's DashboardController only accepts `limit` — `offset` was silently ignored, and every click re-fetched the same top-40 rows. Rather than add backend offset/cursor support in this PR (scope creep), remove the Load-more UI and defer pagination to a follow-up issue. 40 items covers the default case; the feature can come back with proper backend support and its own tests. - Markus + Sara: ?/dismiss and ?/mark-all form actions were dead code — the UI calls `onMarkRead` / `onMarkAllRead` callbacks (→ singleton → raw PATCH) and never submits either form. Delete both actions and their tests. Using the form-action path would require deprecating the NotificationBell's raw-PATCH as well — that's tracked separately as #286. The Dismiss markup split from the previous commit stands on its own. Part of #285, address PR #288 review. Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/src/routes/chronik/+page.server.ts | 27 --------- frontend/src/routes/chronik/+page.svelte | 58 +------------------ .../src/routes/chronik/page.server.spec.ts | 40 +------------ 3 files changed, 4 insertions(+), 121 deletions(-) diff --git a/frontend/src/routes/chronik/+page.server.ts b/frontend/src/routes/chronik/+page.server.ts index 83bff5d4..71a03f00 100644 --- a/frontend/src/routes/chronik/+page.server.ts +++ b/frontend/src/routes/chronik/+page.server.ts @@ -1,4 +1,3 @@ -import { fail } from '@sveltejs/kit'; import { createApiClient } from '$lib/api.server'; import type { components } from '$lib/generated/api'; @@ -53,29 +52,3 @@ export async function load({ fetch, url }) { loadError }; } - -export const actions = { - dismiss: async ({ request, fetch }) => { - const api = createApiClient(fetch); - const formData = await request.formData(); - const id = formData.get('id'); - if (typeof id !== 'string' || id.length === 0) { - return fail(400, { error: 'missing id' }); - } - const result = await api.PATCH('/api/notifications/{id}/read', { - params: { path: { id } } - }); - if (!result.response.ok) { - return fail(result.response.status, { error: 'failed' }); - } - return { success: true }; - }, - 'mark-all': async ({ fetch }) => { - const api = createApiClient(fetch); - const result = await api.POST('/api/notifications/read-all'); - if (!result.response.ok) { - return fail(result.response.status, { error: 'failed' }); - } - return { success: true }; - } -}; diff --git a/frontend/src/routes/chronik/+page.svelte b/frontend/src/routes/chronik/+page.svelte index 24bbc394..54b64d63 100644 --- a/frontend/src/routes/chronik/+page.svelte +++ b/frontend/src/routes/chronik/+page.svelte @@ -1,5 +1,5 @@