Description
Create a new React component WorkEntryAuditSidebar that renders an overlay audit history sidebar with an accordion timeline. Blocked by #5 (TS contracts and query hook must exist first).
New file: src/uck26-frontend/src/features/work/WorkEntryAuditSidebar.tsx
Props:
interface WorkEntryAuditSidebarProps {
open: boolean;
date: string | null; // "2026-05-06"
dateLabel: string; // "Tue 06/05"
userId?: number;
year: number;
month: number;
onClose: () => void;
}
Behaviour:
- Overlay
<Drawer> from Itixo component library
- Header: history icon (
lucide-react), date label, close button
- Calls
useWorkEntryAudit(year, month, date, userId)
- Loading state: 3 skeleton divs with
animate-pulse
- Empty state: "No history for this day." centered message
- Timeline: events ordered descending by
performedAt (already sorted from API)
- Colored dot: green = Create, blue = Update, red = Delete
- Entry type badge per event:
work / holiday / doctor (from entryType field; omit badge when null)
- Performer name + formatted timestamp
- Collapsible accordion: index 0 open by default, only one open at a time
- Create body: list initial field values (field → value)
- Update body: list changed fields (old → new)
- Delete body: "Entry removed" tombstone message
data-test-id="work-history-sidebar" on root element
data-test-id="work-audit-event-{index}" on each timeline card
Reference: documents/work-entry-audit-log/work-entry-audit-log.handover.md § Sidebar component
Acceptance Criteria
Description
Create a new React component
WorkEntryAuditSidebarthat renders an overlay audit history sidebar with an accordion timeline. Blocked by #5 (TS contracts and query hook must exist first).New file:
src/uck26-frontend/src/features/work/WorkEntryAuditSidebar.tsxProps:
Behaviour:
<Drawer>from Itixo component librarylucide-react), date label, close buttonuseWorkEntryAudit(year, month, date, userId)animate-pulseperformedAt(already sorted from API)work/holiday/doctor(fromentryTypefield; omit badge whennull)data-test-id="work-history-sidebar"on root elementdata-test-id="work-audit-event-{index}"on each timeline cardReference:
documents/work-entry-audit-log/work-entry-audit-log.handover.md§ Sidebar componentAcceptance Criteria
src/UCK26.Ui.Tests/WorkPageTests.cs. Auth viaPOST /api/auth/login+ JWT injected intolocalStorage. Locate all elements viadata-test-idonly. Required cases:data-test-id="work-history-{date}"→ assertdata-test-id="work-history-sidebar"becomes visibledata-test-id="work-audit-event-0"is visiblefeatures/work/, addWorkEntryAuditSidebar.tsxwith a short comment.openprop changework/holiday/doctor) rendered per event whenentryTypeis non-nulldata-test-id="work-history-sidebar"on root,data-test-id="work-audit-event-{index}"on each event cardnpm run lint)