Preview Attached Documents on a Registered Activity
After an activity has been submitted, the peer mentor needs to confirm which documents are attached — both for their own record-keeping and to respond to coordinator follow-up questions. The activity detail screen should display a thumbnail grid of all attachments. Tapping any thumbnail opens a full-screen preview modal that supports pinch-to-zoom for images and scrollable rendering for PDFs. The modal must have an accessible close button and announce the document name to screen readers. Signed URLs from Supabase Storage are fetched on demand to prevent unauthorized access to sensitive documents.
User Story
Acceptance Criteria
- Given I open an activity that has attached documents, when the screen renders, then a thumbnail grid shows one thumbnail per attachment with a file-type indicator badge
- Given the thumbnail grid is visible, when I tap a thumbnail, then a full-screen preview modal opens with the document rendered at full resolution
- Given the preview modal is open, when I tap the close button or swipe down, then I return to the activity detail screen with focus restored to the thumbnail I tapped
- Given the preview modal is open with a screen reader active, then the document filename and type are announced when the modal opens
- Given the attachment has a signed URL that has expired, when I open the preview, then a fresh signed URL is fetched transparently without an error being shown to me
- Given an activity has no attachments, when I view the activity detail, then no attachment section is shown (the section is hidden, not empty)
Business Value
Providing in-app document preview eliminates the need to download files to a device gallery or email them for review. This reduces the risk of sensitive documents (e.g., participant consent forms) being stored in insecure locations outside the app, while also making it faster for peer mentors to respond to coordinator queries about a specific activity's evidence trail.
Components
- Attachment Thumbnail Grid ui
- Attachment Preview Modal ui
- Signed URL Service service
- Activity Attachment Repository data
- Supabase Storage Adapter infrastructure
- Accessible Modal Sheet Widget ui
- Modal Close Button ui