Description
Add a history icon button to every day row in WorkSheet.tsx and mount WorkEntryAuditSidebar. Blocked by #5 (TS contracts and hook) and #6 (WorkEntryAuditSidebar component must exist first).
Changes in src/uck26-frontend/src/features/work/WorkSheet.tsx:
- Add imports:
import { History } from 'lucide-react';
import { WorkEntryAuditSidebar } from './WorkEntryAuditSidebar';
- Add state:
const [auditDate, setAuditDate] = useState<string | null>(null)
- Add extra
<TableHead /> as last column header (no label)
- In each day
<TableRow>, add last <TableCell>:
<TableCell>
<IconButton
variant="ghost"
size="mini"
aria-label={`Show history for ${day.label}`}
data-test-id={`work-history-${day.date}`}
onClick={() => setAuditDate(prev => prev === day.date ? null : day.date)}
>
<History className={auditDate === day.date ? 'text-blue-500' : undefined} />
</IconButton>
</TableCell>
- Add extra
<TableCell /> to the summary row to keep column count aligned
- Mount sidebar at bottom of return (outside table):
<WorkEntryAuditSidebar
open={auditDate !== null}
date={auditDate}
dateLabel={days.find(d => d.date === auditDate)?.label ?? ''}
userId={worksheetUserId}
year={year}
month={month}
onClose={() => setAuditDate(null)}
/>
Acceptance Criteria
Description
Add a history icon button to every day row in
WorkSheet.tsxand mountWorkEntryAuditSidebar. Blocked by #5 (TS contracts and hook) and #6 (WorkEntryAuditSidebarcomponent must exist first).Changes in
src/uck26-frontend/src/features/work/WorkSheet.tsx:const [auditDate, setAuditDate] = useState<string | null>(null)<TableHead />as last column header (no label)<TableRow>, add last<TableCell>:<TableCell />to the summary row to keep column count alignedAcceptance 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}"for day A, then click for day B → assert sidebar header shows day B's labeldata-test-id="work-history-{date}"button again → assertdata-test-id="work-history-sidebar"is no longer visibledata-test-identries forwork-history-{date}button andwork-history-sidebarto the Testing conventions section (or a new data-test-id reference table if one exists).data-test-id={work-history-{date}}attribute present on each buttonnpm run lint)