feat: implement Story 2.4 — Dashboard Activity Feed with review fixes

Add role-scoped activity feed to the dashboard showing the 20 most recent
workspace events. Owners/Managers see all activity (declarations, clients,
team changes); Workers see only their assigned declarations. Includes
French descriptions, relative timestamps, responsive layout (desktop
sidebar, tablet inline, mobile collapsible), and 7 passing Pest tests.

Review fixes applied: batch-load declarations/clients/users to eliminate
N+1 queries, consistent soft-delete handling in URL resolution, French
grammar singular/plural fix, missing icon map entry, and corrected tablet
breakpoint per spec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 21:21:07 +01:00
parent 3baf456640
commit a02b5f12d8
13 changed files with 1326 additions and 195 deletions

View File

@@ -36,11 +36,23 @@ export type DashboardAlert = {
showUrl: string;
};
export type ActivityEvent = {
id: number;
actorName: string;
actorInitials: string;
description: string;
targetUrl: string | null;
targetLabel: string | null;
timestamp: string;
eventType: string;
};
export type DashboardProps = {
stats: DashboardStats | null;
statCards: StatCardLink[];
declarations: DashboardDeclaration[];
alerts: DashboardAlert[];
activities: ActivityEvent[];
workspaceName: string | null;
roleLabel: string | null;
isWorker: boolean;