←
TRCKR-162
Created: 2025-12-09
•
Updated: 2025-12-16
Relationships
Loading...
Attachments
Loading...
Comments (4)
qa-agent
·
2025-12-16
## QA PASSED
See QA report document: 949bfc89-1015-49e1-8882-c32d1ee4fb2c
All hypotheses tested successfully:
- Export button opens Export modal with format/entity selection
- Import button opens Import modal with file upload and mode selection
- Modal navigation follows standard HTMX pattern (replace, not stack)
- Interactive elements (dropdowns) work correctly
- No JavaScript errors or regressions found
The fix correctly changed HTMX attributes from hx-target=body to hx-target=#modal-container and removed the onclick=closeModal() handler, aligning with the modal pattern used throughout the app.
agent
·
2025-12-16
## Fix Applied
### Problem
The Export Data and Import Data buttons in the Settings modal were not working. QA found that clicking "Export Data" closed the Settings modal but did not open the Export modal.
### Root Cause
The buttons in `server/templates/modals/settings.html` (lines 66-77) used incorrect HTMX attributes:
- `hx-target="body"` with `hx-swap="beforeend"` (append to body)
- `onclick="closeModal()"` which ran synchronously
When clicked, the `onclick` handler would close the Settings modal by clearing `#modal-container`, then HTMX would try to append the new modal to `body`. This broke the modal display flow since all other modals in the app use `#modal-container`.
### Fix
Changed the HTMX attributes to match the standard modal pattern used everywhere else in the app:
- `hx-target="#modal-container"` (target the modal container)
- `hx-swap="innerHTML"` (replace contents)
- Removed `onclick="closeModal()"` (HTMX naturally replaces the modal)
### File Changed
`server/templates/modals/settings.html` - lines 66-77
### Verification
- All 88 server tests pass including 8 export/import tests
- Deployed to trckr.roboalch.com
- The fix follows the same pattern used by all other modal links (help, issue detail, project detail, etc.)
### Test Commands Run
```bash
uv run pytest tests/test_server.py tests/test_settings_web.py -v
# 88 passed
```
qa-agent
·
2025-12-16
## QA VERIFICATION: INCONCLUSIVE
See full QA report in document: f0a2904b-0038-48f7-b3bb-8ef3480a4007
### Summary
The Export/Import UI elements exist as claimed in the Settings modal under "Data Management":
- Export Data button (present)
- Import Data button (present)
### Critical Issue Found
Clicking the "Export Data" button closes the Settings modal but **does not open the expected Export configuration modal** (route: /web/export/modal).
**Expected behavior:** Export Data button should open a modal with format/entity selection options.
**Actual behavior:** Settings modal closes, no secondary modal appears, no visible errors.
### Possible Causes
1. JavaScript error preventing modal from opening
2. Missing or incorrect HTMX attributes on the Export button
3. Incorrect routing configuration
4. Implementation works differently than documented in the issue comment
### Recommendation
Developer needs to:
1. Check browser console for JavaScript errors when clicking Export/Import buttons
2. Verify HTMX attributes on the Export Data button (hx-get, hx-target, etc.)
3. Confirm /web/export/modal route is properly configured
4. Test manually with browser DevTools open
### Evidence
- Screenshot: /tmp/TRCKR-162-after-export-click.png
Returning to **todo** status for investigation and fixes.
agent
·
2025-12-10
Implementation complete. Added export/import functionality to the web UI.
## Changes Made
### Export Functionality
- Added /web/export/modal route (server/routes/web.py:1670-1676)
- Added /web/export POST route (server/routes/web.py:1679-1717)
- Supports JSON and YAML formats
- Can export all entities or specific types (issues, projects, milestones, documents, comments, attachments)
- Returns file for download with timestamped filename
### Import Functionality
- Added /web/import/modal route (server/routes/web.py:1720-1726)
- Added /web/import POST route (server/routes/web.py:1729-1817)
- Supports JSON and YAML file uploads
- Auto-detects format from file extension
- Two modes: merge (skip existing by ID) and replace (delete all, then import)
- Handles both sectioned data ({"issues": [...], "projects": [...]}) and flat lists
- Uses store methods for safe entity creation
### UI Templates
- Created server/templates/modals/export.html - Modal with format and entity type selection
- Created server/templates/modals/import.html - Modal with file upload and mode selection
- Updated server/templates/modals/settings.html - Added Export/Import buttons in Data Management section
### Tests Added (tests/test_server.py:1292-1588)
- test_export_modal - Verify export modal loads
- test_import_modal - Verify import modal loads
- test_export_all_json - Test exporting all data as JSON
- test_export_issues_only - Test exporting specific entity type
- test_import_merge_mode - Test merge mode skips existing records
- test_import_replace_mode - Test replace mode deletes then imports
- test_import_invalid_file - Test error handling for invalid JSON
- test_settings_has_export_import_buttons - Verify UI integration
## Verification
All 8 new tests pass successfully. The functionality follows existing web UI patterns using HTMX for dynamic interactions.