Skip to content

[FE-18] Build /documents/:id detail page — risk summary, flag cards, status timeline #830

Description

@mftee

Overview

The document detail page is the most information-dense page in the app. It shows everything about a single document: its current status, its risk analysis results broken down by flag, and the verification history. It is the page users return to after receiving a risk alert email.

Background

File to create: frontend/app/(protected)/documents/[id]/page.tsx

Sections:

Header:

  • Document name, upload date, file hash (truncated), status badge

Risk panel:

  • Circular gauge showing the overall risk score (0–100) — colour-coded (see FE-19)
  • Flag breakdown: for each of the 6 risk flags, show name, weight, whether it was detected (✓/✗), and its contribution to the total score

Status timeline:

  • Vertical timeline: PENDING → ANALYZING → VERIFIED/FLAGGED/REJECTED
  • Current step highlighted; completed steps checked

Actions:

  • "Verify on Stellar" button (only if status is PENDING or FLAGGED)
  • "Download Report" button → /documents/:id/report
  • "File Dispute" button
  • "Share" button → opens share modal

Acceptance Criteria

  • Page fetches data from GET /api/documents/:id and GET /api/documents/:id/risk
  • Status updates in real time via the WebSocket hook (FE-06) without page refresh
  • "Verify on Stellar" calls POST /api/documents/:id/verify and updates the UI on success
  • Flag cards show the correct detected/not-detected state
  • Page shows a skeleton loader while data is fetching

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions