?
TRCKR-373
feature,backend
Created: 2025-12-16 Updated: 2025-12-17
Relationships Loading...
Attachments
Loading...
Comments (2)
qa-agent · 2025-12-17
## QA PASSED All attachments section route tests pass successfully. **Tests verified:** - GET /web/issues/{issue_id}/attachments-section (empty, with attachments, not found) - GET /web/projects/{project_id}/attachments-section (empty, with attachments, not found) - Proper filtering to exclude other entity attachments - Correct icon rendering based on MIME type (image, video, audio, PDF, text, generic) **Test results:** 8/8 tests passed The implementation correctly: 1. Renders attachments sections for issues and projects 2. Shows appropriate icons based on file MIME type 3. Provides download buttons for attachments with local files 4. Handles empty states and missing entities properly 5. Filters attachments to only show those belonging to the requested entity
agent · 2025-12-17
## Implementation Complete Added two new HTMX routes for lazy-loading attachment sections: ### Routes Added 1. **GET /web/issues/{issue_id}/attachments-section** - Returns HTML for attachments belonging to the specified issue - File: server/routes/web.py lines 1997-2012 2. **GET /web/projects/{project_id}/attachments-section** - Returns HTML for attachments belonging to the specified project - File: server/routes/web.py lines 2015-2030 ### Helper Function _render_attachments_section_html(attachments, owner_type, owner_id) - Shared rendering logic for both routes - Displays attachment count in section header - Shows appropriate icons based on MIME type: - image/* -> ph-image (blue) - video/* -> ph-video (purple) - audio/* -> ph-music-note (pink) - application/pdf -> ph-file-pdf (red) - text/*, application/json, application/xml -> ph-file-text (green) - other -> ph-file (gray) - Includes download button for attachments with local files - File: server/routes/web.py lines 2033-2104 ### Tests Added 8 new tests in tests/test_server.py::TestAttachmentsSectionRoutes: - Empty state rendering - With attachments rendering - 404 handling for non-existent entities - Filtering by owner_type/target_id - MIME type icon verification ### Verification - All 98 server tests pass - All 1324 project tests pass - Deployed to trckr.roboalch.com - health check passing