View Attached Documents on the Activity Detail Screen
The Document Attach Widget is embedded not only in the activity summary screen during registration but also in the activity detail view for completed activities. It fetches all document metadata for the activity from the Activity Document Repository and displays thumbnails in a horizontal scroll list. Tapping a thumbnail opens the document using a signed URL generated by the Document Storage Service with a 15-minute TTL for secure inline display. Images are displayed from their thumbnail objects to avoid loading full-resolution files in the list view.
User Story
Acceptance Criteria
- Given the user opens an activity detail screen that has attached documents, when the document attach widget loads, then it displays thumbnails of all attached documents in a horizontal scroll list
- Given the user taps a document thumbnail, when the document opens, then it is displayed using a signed URL with a 15-minute TTL generated by the Document Storage Service
- Given the activity has no attached documents, when the document attach widget loads, then an empty state message is shown with an option to add a document
- Given the signed URL for a document has expired (TTL elapsed), when the user attempts to open the document, then a new signed URL is requested and the document opens successfully
- Given the user has a role restricted from accessing a document outside their organization, when they attempt to view it, then access is denied via RLS bucket policies and an appropriate error is shown
Business Value
Coordinators and peer mentors need to verify that evidence is correctly attached before submitting Bufdir reports. Providing secure, on-demand access to attachments directly from the activity detail screen ensures audit trails are complete and reviewable without leaving the app.
Components
- Document Attach Widget ui
- Document Storage Service service
- Activity Document Repository data
- File Storage Backend infrastructure