# Task UI Issues Analysis ## Problem Statement Tasks displayed in the WHOOSH UI show "undefined" fields and placeholder text like "Help Promises: (Not implemented)" and "Retry Budgets: (Not implemented)". ## Root Cause Analysis ### 1. UI Displaying Non-Existent Fields **Location**: `ui/script.js` lines ~290-310 (loadTaskDetail function) **Current Code**: ```javascript async function loadTaskDetail(taskId) { const task = await apiFetch(`/v1/tasks/${taskId}`); taskContent.innerHTML = `
Status: ${task.status}
Priority: ${task.priority}
Help Promises: (Not implemented)
Retry Budgets: (Not implemented)
Description:
${task.description}
Estimated Hours: ${task.estimated_hours}
// Renders as: "Estimated Hours: undefined" ``` ## Impact Assessment ### Current State 1. ✅ Task model in database has all necessary fields 2. ✅ Task service can query and return complete task data 3. ❌ UI only displays: title, status, priority, description 4. ❌ UI shows placeholder text for non-existent fields 5. ❌ Many useful task fields are not displayed 6. ❓ `/v1/tasks` API endpoint returns 404 (needs verification) ### User Impact - **Low Information Density**: Users can't see repository, labels, tech stack, requirements - **No Assignment Visibility**: Can't see which team/agent claimed the task - **No Time Tracking**: Can't see when task was claimed/started/completed - **Confusing Placeholders**: "(Not implemented)" text suggests incomplete features - **No External Links**: Can't click through to GITEA issue ## Recommended Fixes ### Phase 1: Fix UI Display (HIGH PRIORITY) **1.1 Remove Placeholder Text** ```javascript // REMOVE these lines from loadTaskDetail():Help Promises: (Not implemented)
Retry Budgets: (Not implemented)
``` **1.2 Add Missing Fields** ```javascript async function loadTaskDetail(taskId) { const task = await apiFetch(`/v1/tasks/${taskId}`); taskContent.innerHTML = `Status: ${task.status}
Priority: ${task.priority}
Source: ${task.source_type}
Repository: ${task.repository || 'N/A'}
Project ID: ${task.project_id || 'N/A'}
${task.external_url ? `Issue: View on GITEA
` : ''}Estimated Hours: ${task.estimated_hours}
` : ''} ${task.complexity_score ? `Complexity Score: ${task.complexity_score.toFixed(2)}
` : ''}Labels:
Tech Stack:
Requirements:
Description:
Assignment:
Team: ${task.assigned_team_id}
` : ''} ${task.assigned_agent_id ? `Agent: ${task.assigned_agent_id}
` : ''}${task.description.substring(0, 150)}...
` : ''}Error loading tasks: ${error.message}
`; } } ``` ## Implementation Plan ### Step 1: Quick Win - Remove Placeholders (5 minutes) 1. Open `ui/script.js` 2. Find `loadTaskDetail` function 3. Remove lines with "Help Promises" and "Retry Budgets" 4. Commit and deploy ### Step 2: Add Essential Fields (30 minutes) 1. Add repository, project_id, external_url to task detail view 2. Add labels and tech_stack display 3. Add timestamps display 4. Test locally ### Step 3: Add Styling (15 minutes) 1. Add badge styles for status/priority 2. Add tag styles for labels/tech stack 3. Add description formatting 4. Test visual appearance ### Step 4: Deploy (10 minutes) 1. Build new WHOOSH image with UI changes 2. Tag as `anthonyrawlins/whoosh:task-ui-fix` 3. Deploy to swarm 4. Verify in browser ### Step 5: API Verification (Optional) 1. Test if `/v1/tasks` endpoint works after deploy 2. If not, rebuild WHOOSH binary with latest code 3. Or update UI to use project-scoped endpoints ## Testing Checklist - [ ] Task detail page loads without "undefined" values - [ ] No placeholder "(Not implemented)" text visible - [ ] Repository name displays correctly - [ ] Labels render as styled tags - [ ] Tech stack renders as styled tags - [ ] External URL link works and opens GITEA issue - [ ] Timestamps format correctly - [ ] Status badge has correct color - [ ] Priority badge has correct color - [ ] Description text wraps properly - [ ] Null/empty fields don't break layout ## Future Enhancements 1. **Interactive Task Management** - Claim task button - Update status dropdown - Add comment/note functionality 2. **Task Filtering** - Filter by status, priority, repository - Search by title/description - Filter by tech stack 3. **Task Analytics** - Time to completion metrics - Complexity vs actual hours - Agent performance by task type 4. **Visualization** - Kanban board view - Timeline view - Dependency graph ## References - Task Model: `internal/tasks/models.go` - Task Service: `internal/tasks/service.go` - UI JavaScript: `ui/script.js` - UI Styles: `ui/styles.css` - API Routes: `internal/server/server.go`