feat(ui): headline summary on scan completion - #4
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent overlapping identity ownership, preserve failed and capped scan state, score cards from reconciled identities, pace replay for live demos, and make held cards explicit in the queue. Co-authored-by: Cursor <cursoragent@cursor.com>
Show a compact, data-driven scan finding summary before the approval queue and pace demo replay so the completed result is visible in time to understand it. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Summary by QodoAdd completed-scan finding headline to approval queue
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1. Stale refresh corrupts headline
|
| /> | ||
| <ApprovalQueue | ||
| cards={session.cards} | ||
| systemIds={Object.keys(session.activity.subagents)} |
There was a problem hiding this comment.
1. Stale refresh corrupts headline 🐞 Bug ≡ Correctness
A card refresh started by the previous scan can resolve after a new scan begins and overwrite the cleared queue, while the new headline counts those old cards against the new scan's subagents. Because that stale response can also restore status completed, users can see a completed summary containing mismatched grant and system counts during the new scan.
Agent Prompt
## Issue description
Card fetches from a prior scan can update state after a new scan starts, causing the summary to combine stale cards with the current scan's systems and status.
## Issue Context
`refreshCards` dispatches results without identifying their scan, and the reducer accepts every `cards` action. Track the request's scan ID or a session generation and ignore results that no longer belong to the active scan.
## Fix Focus Areas
- apps/web/src/hooks/useScanSession.ts[32-39]
- apps/web/src/hooks/useScanSession.ts[132-152]
- apps/web/src/hooks/useScanSession.ts[469-509]
- apps/web/src/App.tsx[69-73]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Adds a one-line summary above the Unattributed section stating the finding in
plain language — grant count, systems, unattributed, stale, irreversible. All
figures derived from scan data; zero-value clauses omitted. Header counts
clarified: pending, held, total.