fix(04): revise plans based on checker feedback
All checks were successful
CI / build-test (push) Successful in 1m31s

This commit is contained in:
2026-03-24 09:50:11 +01:00
parent 81fc110224
commit 010daa227d
4 changed files with 55 additions and 26 deletions

View File

@@ -26,7 +26,7 @@ must_haves:
truths:
- "User can dismiss all pending updates with a Dismiss All button in the header area"
- "User can dismiss all pending updates within a tag group via a per-section button"
- "Dismiss All requires a two-click confirmation before executing"
- "Dismiss All requires an inline two-click confirmation before executing (matching tag delete UX pattern)"
- "A pending-count badge is always visible in the Header"
- "The browser tab title shows 'DiunDash (N)' when N > 0 and 'DiunDash' when 0"
- "A toast notification appears when new updates arrive during polling"
@@ -36,7 +36,7 @@ must_haves:
provides: "acknowledgeAll, acknowledgeByTag callbacks; newArrivals state; tab title effect"
contains: "acknowledgeAll"
- path: "frontend/src/components/Header.tsx"
provides: "Pending badge, dismiss-all button with confirm"
provides: "Pending badge, dismiss-all button with inline two-click confirm"
contains: "pendingCount"
- path: "frontend/src/components/TagSection.tsx"
provides: "Per-group dismiss button"
@@ -229,7 +229,7 @@ From frontend/src/App.tsx (after Plan 02):
```
</action>
<verify>
<automated>cd /home/jean-luc-makiola/Development/projects/DiunDashboard/frontend && npx tsc --noEmit</automated>
<automated>cd /home/jean-luc-makiola/Development/projects/DiunDashboard/frontend && bunx tsc --noEmit</automated>
</verify>
<acceptance_criteria>
- useUpdates.ts contains `const acknowledgeAll = useCallback`
@@ -240,7 +240,7 @@ From frontend/src/App.tsx (after Plan 02):
- useUpdates.ts contains `const [newArrivals, setNewArrivals] = useState<string[]>`
- useUpdates.ts contains `clearNewArrivals` in the return object
- useUpdates.ts return object includes `acknowledgeAll` and `acknowledgeByTag`
- `npx tsc --noEmit` exits 0
- `bunx tsc --noEmit` exits 0
</acceptance_criteria>
<done>useUpdates hook returns acknowledgeAll, acknowledgeByTag, newArrivals, and clearNewArrivals; toast detection fires on new images during polling</done>
</task>
@@ -288,7 +288,7 @@ From frontend/src/App.tsx (after Plan 02):
}
```
2. **Header.tsx** (per D-03, D-04, D-09): Extend HeaderProps and add pending badge + dismiss-all button.
2. **Header.tsx** (per D-03, D-04, D-09): Extend HeaderProps and add pending badge + dismiss-all button with inline two-click confirm pattern (per D-04, matching existing tag delete UX -- no modal needed).
Update the interface:
```typescript
interface HeaderProps {
@@ -306,7 +306,7 @@ From frontend/src/App.tsx (after Plan 02):
</Badge>
)}
```
Add dismiss-all button with two-click confirm pattern (per D-04, matching existing tag delete pattern in TagSection). Add local state `const [confirmDismissAll, setConfirmDismissAll] = useState(false)`. The button:
Add dismiss-all button with inline two-click confirm pattern (per D-04). Add local state `const [confirmDismissAll, setConfirmDismissAll] = useState(false)`. The button:
```tsx
{pendingCount > 0 && (
<Button
@@ -342,7 +342,7 @@ From frontend/src/App.tsx (after Plan 02):
onAcknowledgeGroup?: (tagId: number) => void
}
```
Add a "Dismiss Group" button in the section header, next to the delete button, only when `tag !== null` and `onAcknowledgeGroup` is provided and at least one row is unacknowledged. Use two-click confirm pattern:
Add a "Dismiss Group" button in the section header, next to the delete button, only when `tag !== null` and `onAcknowledgeGroup` is provided and at least one row is unacknowledged. Use inline two-click confirm pattern (per D-04):
```typescript
const [confirmDismissGroup, setConfirmDismissGroup] = useState(false)
const hasPending = rows.some(r => !r.entry.acknowledged)
@@ -499,7 +499,7 @@ From frontend/src/App.tsx (after Plan 02):
```
</action>
<verify>
<automated>cd /home/jean-luc-makiola/Development/projects/DiunDashboard/frontend && npx tsc --noEmit && bun run build</automated>
<automated>cd /home/jean-luc-makiola/Development/projects/DiunDashboard/frontend && bunx tsc --noEmit && bun run build</automated>
</verify>
<acceptance_criteria>
- Toast.tsx exists and exports `Toast` component
@@ -524,7 +524,7 @@ From frontend/src/App.tsx (after Plan 02):
- TagSection.tsx TagSectionRow interface contains `isNew`
- `bun run build` exits 0
</acceptance_criteria>
<done>Bulk dismiss buttons work (dismiss-all in header with two-click confirm, dismiss-group in each tag section); pending badge shows in header; tab title reflects count; toast appears for new arrivals; new-since-last-visit items have amber left border highlight</done>
<done>Bulk dismiss buttons work (dismiss-all in header with inline two-click confirm, dismiss-group in each tag section with inline two-click confirm); pending badge shows in header; tab title reflects count; toast appears for new arrivals; new-since-last-visit items have amber left border highlight</done>
</task>
</tasks>
@@ -532,7 +532,7 @@ From frontend/src/App.tsx (after Plan 02):
<verification>
```bash
cd /home/jean-luc-makiola/Development/projects/DiunDashboard/frontend
npx tsc --noEmit
bunx tsc --noEmit
bun run build
# Full stack verification:
cd /home/jean-luc-makiola/Development/projects/DiunDashboard
@@ -544,7 +544,7 @@ go build ./...
<success_criteria>
- Dismiss All button in header triggers POST /api/updates/acknowledge-all
- Per-group Dismiss Group button triggers POST /api/updates/acknowledge-by-tag with correct tag_id
- Both dismiss buttons use two-click confirmation
- Both dismiss buttons use inline two-click confirmation (matching tag delete UX pattern)
- Pending count badge visible in header when > 0
- Browser tab title shows "DiunDash (N)" or "DiunDash"
- Toast appears at bottom-right when polling detects new images