diff --git a/.planning/REQUIREMENTS.md b/.planning/REQUIREMENTS.md index 89e4853..40a773d 100644 --- a/.planning/REQUIREMENTS.md +++ b/.planning/REQUIREMENTS.md @@ -27,12 +27,12 @@ Requirements for initial release. Each maps to roadmap phases. - [ ] **HEAT-04**: Day-of-week labels (Mon/Wed/Fri) on Y-axis - [ ] **HEAT-05**: Month labels along the top showing month boundaries - [ ] **HEAT-06**: Empty days render with a distinct "no data" color -- [ ] **HEAT-07**: Clicking a day cell navigates to Kimai timesheet view filtered to that date +- [x] **HEAT-07**: Clicking a day cell navigates to Kimai timesheet view filtered to that date - [ ] **HEAT-08**: Color scheme uses Kimai's theme CSS variables ### Interactivity -- [ ] **INTR-01**: Dropdown filter to view heatmap for a specific project or activity +- [x] **INTR-01**: Dropdown filter to view heatmap for a specific project or activity ### Polish @@ -97,8 +97,8 @@ Which phases cover which requirements. Updated during roadmap creation. | HEAT-06 | Phase 3 | Pending | | HEAT-08 | Phase 3 | Pending | | TEST-03 | Phase 3 | Pending | -| HEAT-07 | Phase 4 | Pending | -| INTR-01 | Phase 4 | Pending | +| HEAT-07 | Phase 4 | Complete | +| INTR-01 | Phase 4 | Complete | | TEST-04 | Phase 4 | Pending | | POLI-01 | Phase 5 | Pending | | POLI-02 | Phase 5 | Pending | diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 0c582b9..f3d85ec 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -81,7 +81,7 @@ Plans: **UI hint**: yes Plans: -- [ ] 04-01: Day cell click navigation + project filter dropdown +- [x] 04-01: Day cell click navigation + project filter dropdown - [ ] 04-02: Vitest tests for click navigation and filter behavior ### Phase 5: Polish diff --git a/.planning/STATE.md b/.planning/STATE.md index 052eca3..8f3d4bd 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -3,14 +3,14 @@ gsd_state_version: 1.0 milestone: v1.0 milestone_name: milestone status: executing -stopped_at: Completed 03-03-PLAN.md -last_updated: "2026-04-08T11:21:00Z" +stopped_at: Completed 04-01-PLAN.md +last_updated: "2026-04-08T13:31:58.924Z" last_activity: 2026-04-08 progress: total_phases: 5 completed_phases: 0 - total_plans: 2 - completed_plans: 1 + total_plans: 4 + completed_plans: 2 percent: 50 --- @@ -21,12 +21,12 @@ progress: See: .planning/PROJECT.md (updated 2026-04-08) **Core value:** At a glance, see where your time went -- a visual map of tracking activity that makes patterns obvious -**Current focus:** Phase 2: Plugin Scaffold + Data Layer +**Current focus:** Phase 4 — Heatmap Interaction ## Current Position -Phase: 2 of 5 (Plugin Scaffold + Data Layer) -Plan: 2 of 2 in current phase +Phase: 4 (Heatmap Interaction) — EXECUTING +Plan: 2 of 2 Status: Ready to execute Last activity: 2026-04-08 @@ -55,6 +55,7 @@ Progress: [██░░░░░░░░] 20% | Phase 2 P02-01 | 5min | 5 tasks | 8 files | | Phase 03 P01 | 3min | 4 tasks | 7 files | | Phase 03 P03 | 2min | 4 tasks | 1 files | +| Phase 04 P01 | 2min | 2 tasks | 7 files | ## Accumulated Context @@ -76,6 +77,7 @@ Recent decisions affecting current work: - [Phase 2]: Removed final from HeatmapService to allow PHPUnit mocking - [Phase 03]: IIFE format with KimaiHeatmap global for browser compat - [Phase 03]: kimai.initialized event for deferred widget init, javascriptRequest fallback for AJAX +- [Phase 04]: Render project filter only when user has tracked projects ### Pending Todos @@ -87,6 +89,6 @@ None yet. ## Session Continuity -Last session: 2026-04-08T11:21:00Z -Stopped at: Completed 03-03-PLAN.md +Last session: 2026-04-08T13:31:58.922Z +Stopped at: Completed 04-01-PLAN.md Resume file: None diff --git a/.planning/phases/04-heatmap-interaction/04-01-SUMMARY.md b/.planning/phases/04-heatmap-interaction/04-01-SUMMARY.md new file mode 100644 index 0000000..e45fd63 --- /dev/null +++ b/.planning/phases/04-heatmap-interaction/04-01-SUMMARY.md @@ -0,0 +1,99 @@ +--- +phase: 04-heatmap-interaction +plan: 01 +subsystem: ui +tags: [d3, heatmap, click-navigation, project-filter, typescript, esbuild] + +requires: + - phase: 03-heatmap-rendering + provides: d3 heatmap SVG rendering, esbuild bundle, Twig widget template +provides: + - Click-through navigation from heatmap cells to Kimai timesheet filtered by date + - Project filter dropdown that re-fetches and re-renders heatmap + - getUserProjects service method for querying user project list +affects: [04-02-PLAN, polish] + +tech-stack: + added: [] + patterns: [onCellClick callback pattern for cell interaction, flex wrapper layout for widget + sidebar controls] + +key-files: + created: [] + modified: + - Service/HeatmapService.php + - Widget/HeatmapWidget.php + - Resources/views/widget/heatmap.html.twig + - assets/src/heatmap.ts + - assets/src/types.ts + - Resources/public/heatmap.css + - Resources/public/heatmap.js + +key-decisions: + - "Render project filter only when user has tracked projects (skip empty dropdown)" + - "Use encodeURIComponent for daterange param in navigation URL (T-04-03 mitigation)" + +patterns-established: + - "Callback injection: renderHeatmap accepts optional onCellClick for cell interaction" + - "Flex wrapper: heatmap-wrapper div with heatmap-svg-area + heatmap-filter side by side" + +requirements-completed: [HEAT-07, INTR-01] + +duration: 2min +completed: 2026-04-08 +--- + +# Phase 4 Plan 1: Click Navigation & Project Filter Summary + +**Click-through day cell navigation to Kimai timesheet with daterange filter, plus project filter dropdown that re-fetches and re-renders the heatmap in place** + +## Performance + +- **Duration:** 2 min +- **Started:** 2026-04-08T13:29:12Z +- **Completed:** 2026-04-08T13:31:15Z +- **Tasks:** 2 +- **Files modified:** 7 + +## Accomplishments +- Heatmap cells navigate to Kimai timesheet filtered by clicked date via window.location.href +- Project filter dropdown renders with Tabler form-select classes, re-fetches data on change +- CSS provides cursor:pointer hover affordance and flex layout for heatmap + filter +- All 20 existing Vitest tests still pass + +## Task Commits + +Each task was committed atomically: + +1. **Task 1: Backend -- getUserProjects, widget getData, Twig data attributes** - `3df754e` (feat) +2. **Task 2: Frontend -- click navigation, filter dropdown, CSS, esbuild rebuild** - `b57eb93` (feat) + +## Files Created/Modified +- `Service/HeatmapService.php` - Added getUserProjects() returning distinct projects user has tracked time for +- `Widget/HeatmapWidget.php` - Removed final, injected HeatmapService, getData() returns project list +- `Resources/views/widget/heatmap.html.twig` - Added data-projects and data-timesheet-url attributes +- `assets/src/types.ts` - Added ProjectOption interface +- `assets/src/heatmap.ts` - Refactored init() with click handler, project filter dropdown, re-fetch logic +- `Resources/public/heatmap.css` - Added click affordance styles and flex wrapper layout +- `Resources/public/heatmap.js` - Rebuilt bundle with all frontend changes + +## Decisions Made +- Render project filter only when user has tracked projects (avoids empty dropdown) +- Use encodeURIComponent for daterange param per T-04-03 threat mitigation + +## Deviations from Plan + +None - plan executed exactly as written. + +## Issues Encountered +None + +## User Setup Required +None - no external service configuration required. + +## Next Phase Readiness +- Click navigation and project filter are functional +- Ready for 04-02 (tests for interaction features) + +--- +*Phase: 04-heatmap-interaction* +*Completed: 2026-04-08*