?
TRCKR-199
web crud
Created: 2025-12-09 Updated: 2025-12-16
Relationships Loading...
Attachments
Loading...
Comments (1)
agent · 2025-12-09
Successfully implemented delete functionality for issues, projects, and milestones in the web interface. ## Changes Made ### Backend (server/routes/web.py) Added three new DELETE endpoints following the same pattern as the existing comment deletion: 1. **DELETE /web/issues/{issue_id}** (lines 756-775) - Validates issue exists (404 if not found) - Calls store.delete_issue(issue_id) - Broadcasts "issue.deleted" event via WebSocket - Returns script to close modal and refresh issues table 2. **DELETE /web/projects/{project_id}** (lines 778-797) - Validates project exists (404 if not found) - Calls store.delete_project(project_id) - Broadcasts "project.deleted" event via WebSocket - Returns script to close modal and refresh projects table 3. **DELETE /web/milestones/{milestone_id}** (lines 800-819) - Validates milestone exists (404 if not found) - Calls store.delete_milestone(milestone_id) - Broadcasts "milestone.deleted" event via WebSocket - Returns script to close modal and refresh milestones table ### Frontend Templates Added delete buttons to all three detail modal templates: 1. **server/templates/modals/issue_detail.html** (lines 129-133) - Red button styled with #da3633 (GitHub danger color) - hx-delete="/web/issues/{{ issue.id }}" - hx-confirm with warning message - Positioned at bottom-right of modal 2. **server/templates/modals/project_detail.html** (lines 125-129) - Same styling and positioning - hx-delete="/web/projects/{{ project.id }}" 3. **server/templates/modals/milestone_detail.html** (lines 87-91) - Same styling and positioning - hx-delete="/web/milestones/{{ milestone.id }}" ## Testing - All existing tests pass (56 server tests) - Delete functionality follows TUI pattern from tui/screens/detail.py - Uses HTMX's built-in hx-confirm for user confirmation - After deletion, modal closes and table refreshes automatically ## How to Verify 1. Start the server: trckr-server 2. Open web interface: http://localhost:8000/web 3. Click on any issue/project/milestone to open detail modal 4. Click the red "Delete" button at the bottom-right 5. Confirm the deletion in the browser dialog 6. Modal should close and entity should be removed from the list