Skip to content

Comments

refactor(security-agent): redesign analysis jobs & findings UI with smart retry#481

Merged
jeanduplessis merged 4 commits intomainfrom
jdp/security-findings-card-redesign
Feb 24, 2026
Merged

refactor(security-agent): redesign analysis jobs & findings UI with smart retry#481
jeanduplessis merged 4 commits intomainfrom
jdp/security-findings-card-redesign

Conversation

@jeanduplessis
Copy link
Contributor

@jeanduplessis jeanduplessis commented Feb 23, 2026

Summary

  • Redesign AnalysisJobsCard and SecurityFindingRow from card-based layouts to compact grid/table layouts with summary bar, compact timestamps, and keyboard accessibility
  • Integrate FindingDetailDialog and DismissFindingDialog directly into AnalysisJobsCard, removing the need for the parent to wire them up
  • When triage succeeds but sandbox analysis fails, show the error message and a "Retry Analysis" button in the finding detail dialog
  • Add retrySandboxOnly API parameter so retries skip redundant triage and go straight to sandbox analysis, reusing existing triage data (falls back to full analysis if no prior triage exists)

Details

The AnalysisJobsCard was previously a Card component rendering each job as a bordered item with multiple sections. It is now a flat list of grid rows with a summary bar showing running/completed/failed counts. Each row is clickable and opens the FindingDetailDialog directly.

SecurityFindingRow was similarly refactored to a 5-column grid layout matching the new AnalysisJobsCard rows, with failed findings showing a "Retry" button (with tooltip showing the error) instead of "Analyze".

The retry optimization (retrySandboxOnly) applies across all surfaces: finding detail dialog, findings list row, and analysis jobs card.

Also includes an unrelated fix in cloud-agent-next to return an actionable error when NEXTAUTH_SECRET is not configured.

Screenshots

Before After
20260224-135136@2x 20260224-124559@2x
20260223-235706@2x 20260224-124609@2x

…analysis fails

When triage succeeds but sandbox analysis fails, the finding detail
dialog now shows the error message and a retry button below the triage
results. Previously these were hidden because the error/retry UI was
in a mutually exclusive branch that required no analysis data at all.

Add retrySandboxOnly parameter to skip redundant triage on retry,
reusing existing triage data and going straight to sandbox analysis.
Falls back to full analysis if no prior triage exists.
@jeanduplessis jeanduplessis force-pushed the jdp/security-findings-card-redesign branch from 43c529e to d5edfc5 Compare February 24, 2026 10:41
@jeanduplessis jeanduplessis changed the title fix(security-agent): show error reason and retry for failed sandbox analysis refactor(security-agent): redesign analysis jobs & findings UI with smart retry Feb 24, 2026
@jeanduplessis jeanduplessis marked this pull request as ready for review February 24, 2026 11:12
@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 24, 2026

Code Review Summary

Status: No New Issues Found | Recommendation: Merge

The previous review flagged 2 issues (see inline comments). After re-reviewing the full diff with latest changes, no additional issues were found.

Note on previous comments: The earlier WARNING about formatCompactDistance returning 0h appears to be a false positive — the function correctly falls through to minutes when differenceInHours returns 0. Similarly, the SUGGESTION about forceSandbox in the API schema is inaccurate — forceSandbox is not in StartAnalysisInputSchema; only retrySandboxOnly is exposed, and it has a legitimate use case (skipping redundant triage on sandbox retry).

Highlights

  • Sandbox-only retry logic is well-implemented: gracefully falls back to full analysis when no existing triage data exists, and correctly preserves triage data through the updateAnalysisStatus pending transition.
  • Keyboard accessibility properly added to clickable rows (role="button", tabIndex, onKeyDown).
  • Auth guard in cloud-agent-next/src/auth.ts is a good defensive check for missing NEXTAUTH_SECRET.
Files Reviewed (9 files)
  • cloud-agent-next/src/auth.ts - 0 issues (good defensive check)
  • src/components/security-agent/AnalysisJobsCard.tsx - 0 issues (clean redesign with dismiss flow)
  • src/components/security-agent/FindingDetailDialog.tsx - 0 issues (sandbox retry UI)
  • src/components/security-agent/SecurityAgentPageClient.tsx - 0 issues
  • src/components/security-agent/SecurityFindingRow.tsx - 0 issues (compact layout, retry logic)
  • src/components/security-agent/SecurityFindingsCard.tsx - 0 issues (import reorg, type update)
  • src/lib/security-agent/core/schemas.ts - 0 issues (retrySandboxOnly addition is appropriate)
  • src/lib/security-agent/services/analysis-service.ts - 0 issues (sandbox retry logic well-guarded)
  • src/routers/organizations/organization-security-agent-router.ts - 0 issues
  • src/routers/security-agent-router.ts - 0 issues

Copy link
Contributor

@eshurakov eshurakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks nice!

@jeanduplessis jeanduplessis merged commit 311e08b into main Feb 24, 2026
12 checks passed
@jeanduplessis jeanduplessis deleted the jdp/security-findings-card-redesign branch February 24, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants