Skip to content

[FE-17] Build /documents/upload page — drag-and-drop zone with file validation and progress bar #829

Description

@mftee

Overview

The core user action is uploading a land document for analysis. The upload page must provide clear feedback on file acceptance, validation errors, and upload progress. A good upload experience is critical for user adoption.

Background

File to create: frontend/app/(protected)/documents/upload/page.tsx

Features:

  • Drag-and-drop zone (or click to browse) — visual feedback on drag-over state
  • Supported file types: PDF, PNG, JPG, JPEG, TIFF (display allowed types to the user)
  • Maximum file size: 10MB (display limit to the user)
  • File validation before upload: correct extension and size
  • Title input field (optional custom name)
  • Organization selector (optional — dropdown of orgs the user belongs to)
  • Upload progress bar (use axios onUploadProgress callback)

After upload:

  • Success: redirect to the new document's detail page (/documents/:id)
  • Error: show error message inline without losing the selected file

Acceptance Criteria

  • Drag-and-drop works in modern browsers (Chrome, Firefox, Edge)
  • Invalid file types are rejected before upload with a clear error message
  • Files exceeding 10MB are rejected before upload
  • Upload progress bar shows 0–100% based on real upload progress
  • Form cannot be submitted twice (button disabled while upload is in progress)

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions