Timeline
Renders interactive Gantt-style timelines and roadmaps in the browser using vis-timeline from context-supplied phases, milestones, and tasks.
Workflow
- Extract items and groups — identify tasks/phases (items) and workstreams/swimlanes (groups) from context. See TEMPLATE.md for data shapes.
- Convert all dates to ISO strings — translate every vague time reference ("month 1-3", "Q2", "next sprint") to "YYYY-MM-DD" format. Default base date is today. See TEMPLATE.md for conversion patterns.
- Assign group colors — give each group a className and matching CSS color class. See TEMPLATE.md for the color class system.
- Write the HTML file — write a complete self-contained file to /tmp/timeline.html using the vis-timeline template. See TEMPLATE.md for the full template.
- Render in browser — follow
_shared/chrome-devtools-render.mdto open/tmp/timeline.html, wait for render, screenshot, and fix-and-reload if needed.wait_fora group label string that appears after vis-timeline renders. See TROUBLESHOOTING.md for timeline-specific fixes.
Self-review checklist
Before delivering, verify ALL:
- Screenshot shows all group swimlane labels in the left panel
- Screenshot shows colored item bars spanning correct date ranges
- No items are invisible or rendering as unstyled plain text (CSS CDN loaded)
- Timeline container has explicit pixel height — vis-timeline did not collapse to 0px
- All start/end values in items array are ISO date strings "YYYY-MM-DD", not relative strings
- Every item has a group property matching a group id
- stack: false is present in timeline options
- Dark theme CSS overrides are present and text is readable on dark background
- wait_for was called before take_screenshot
Golden rules
Hard rules. Never violate these.
- Never use relative date strings. Always convert vague references ("month 1", "Q3", "next sprint") to explicit ISO date strings "YYYY-MM-DD" before passing to vis-timeline. Relative strings will throw a parse error or render at wrong positions.
- Always set explicit pixel height on the container div. vis-timeline collapses to 0px without it. Use height: 500px; width: 100%; at minimum.
- Always include the CSS CDN link tag. Without the vis-timeline CSS CDN, items render as unstyled plain text with no bar shape or color.
- Use
stack: truewhen items within a group overlap in time; usestack: falseonly when items are guaranteed non-overlapping.stack: falsecauses overlapping items in the same group to render on top of each other, hiding all but the topmost. Default tostack: truefor safety. - Always assign every item to a group. Ungrouped items pile into a single unlabelled row, defeating swimlane separation.
- Always call wait_for on a group label string before screenshotting. The group label only appears after vis-timeline fully renders; screenshotting before it appears captures a blank or partially-rendered page.
- Always use new_page for first open. Use mcp__chrome-devtools__new_page with url: file:///tmp/timeline.html. Use navigate_page with type: reload only for subsequent fixes.
Reference files
| File | Contents |
|---|---|
| TEMPLATE.md | Complete vis-timeline HTML template, date conversion patterns, color class system, group/item data format |
| TROUBLESHOOTING.md | Failure diagnosis table: symptoms, causes, fixes |