Overview
At Zepto, efficient delivery operations are crucial. Operations managers need a clear, visual representation of delivery agents' schedules to quickly identify task assignments, potential overlaps, and optimize routes. This problem challenges you to build a simplified, read-only Gantt chart view for delivery tasks, allowing managers to visualize agent workloads over a fixed time window.
What you need to do / Task
Your primary goal is to render a functional Gantt chart based on provided mock data. Specifically, you must:
- Render a Timeline Header: Display a time axis at the top of the chart, showing time intervals (e.g., every 30 minutes) for the defined chart duration.
- Display Agent Rows: For each delivery agent in the
mockAgents data, create a dedicated row that clearly labels the agent's name.
- Render Task Bars: Within each agent's row, visualize their assigned tasks as horizontal bars. The position and width of each task bar must accurately reflect its
startTime and endTime relative to the overall chart timeline.
- Implement Task Details on Hover: When a user hovers over a task bar, display a small tooltip or inline text showing the task's
name and its full startTime to endTime range.
UI/UX expectations
- Layout: The chart should have a clear header for the timeline and distinct rows for each agent. Tasks should be rendered as distinct rectangular bars within their respective agent rows.
- Readability: Ensure the time labels are legible and task bars are visually distinct (e.g., different background colors or borders).
- Interactivity: The hover effect for task details should be smooth and clearly present the required information.
- Responsiveness: While a fully responsive layout is not required, the chart should render reasonably well within the provided sandpack viewport without horizontal scrolling (assume a fixed width for the overall chart container).
Acceptance criteria
- The timeline header correctly displays time units (e.g., 9:00, 9:30, 10:00, etc.) for the entire chart duration.
- Each agent's row is clearly labeled with their name.
- Task bars are rendered within their corresponding agent rows.
- The horizontal position of each task bar accurately corresponds to its
startTime on the timeline.
- The width of each task bar accurately represents its
duration (endTime - startTime).
- Hovering over any task bar displays its
name and the startTime - endTime range.
- The application runs without console errors and handles the provided mock data.