# Task 8: Add Hierarchy Visualization **Task ID**: TASK-008 | **Story**: [STORY-002](sprint_1_story_2.md) | **Sprint**: [Sprint 1](sprint_1.md) **Estimated Hours**: 4h | **Assignee**: Frontend Developer 2 | **Priority**: P0 | **Status**: Not Started ## Task Description Build tree view component to visualize Epic → Story → Task hierarchy with expand/collapse and breadcrumb navigation. ## Implementation ### Component: HierarchyTree.tsx ```typescript import React, { useState } from 'react'; import { Epic, Story, Task } from '../api/types'; interface HierarchyTreeProps { epics: Epic[]; stories: Story[]; tasks: Task[]; } export const HierarchyTree: React.FC = ({ epics, stories, tasks }) => { const [expandedEpics, setExpandedEpics] = useState>(new Set()); const [expandedStories, setExpandedStories] = useState>(new Set()); const toggleEpic = (epicId: string) => { setExpandedEpics(prev => { const next = new Set(prev); if (next.has(epicId)) next.delete(epicId); else next.add(epicId); return next; }); }; const getStoriesForEpic = (epicId: string) => { return stories.filter(s => s.parentEpicId === epicId); }; const getTasksForStory = (storyId: string) => { return tasks.filter(t => t.parentStoryId === storyId); }; return (
{epics.map(epic => (
toggleEpic(epic.id)}> 📊 {epic.title} ({getStoriesForEpic(epic.id).length} stories)
{expandedEpics.has(epic.id) && (
{getStoriesForEpic(epic.id).map(story => (
📝 {story.title} ({getTasksForStory(story.id).length} tasks)
{getTasksForStory(story.id).map(task => (
{task.title} {task.status}
))}
))}
)}
))}
); }; ``` ## Acceptance Criteria - [ ] Tree view displays Epic → Story → Task structure - [ ] Expand/collapse Epic nodes - [ ] Show child count for each node - [ ] Icons differentiate Epic/Story/Task - [ ] Click to navigate to detail page - [ ] Breadcrumb navigation component ## Deliverables 1. HierarchyTree.tsx component 2. Breadcrumb.tsx component 3. CSS styles for tree layout 4. Unit tests (8+ tests) **Status**: Not Started | **Created**: 2025-11-04