# Phase 4: Heatmap Interaction - Research **Researched:** 2026-04-08 **Domain:** d3.js click interaction, Kimai timesheet URL routing, Symfony data passing to Twig/JS **Confidence:** HIGH ## Summary Phase 4 adds click-through navigation from heatmap day cells to Kimai's timesheet view and a project filter dropdown that re-fetches and re-renders the heatmap. The codebase is well-prepared: `renderHeatmap()` already accepts data and re-renders from scratch (clear + redraw pattern), and the `HeatmapController::data()` endpoint already accepts `?project=N`. The main technical findings are: (1) Kimai's timesheet daterange URL format is locale-dependent and uses a `begin - end` range, but Kimai always accepts the fallback `yyyy-MM-dd` format, so we can safely use `YYYY-MM-DD - YYYY-MM-DD` with the same date for both begin and end to filter to a single day; (2) the project list should be passed as a `data-projects` JSON attribute on the container div, populated by the widget/Twig template using `ProjectRepository`; (3) existing test infrastructure (Vitest + jsdom) is sufficient for all new interaction tests. **Primary recommendation:** Add click handlers to d3 cells during rendering, build the filter dropdown as a plain `` element, not an SVG element. It sits outside the SVG in the DOM, styled with Tabler CSS classes. The project list comes from a `data-projects` attribute on the container div. ```typescript // Parse project list from container attribute const projectsJson = container.getAttribute('data-projects'); const projects: Array<{id: number; name: string}> = projectsJson ? JSON.parse(projectsJson) : []; // Create