Group events into five temporal sections with section headers, date subheaders, and context-aware time display (clock time for upcoming, relative for past). Includes new useEventGrouping composable, SectionHeader and DateSubheader components, full unit and E2E test coverage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9.6 KiB
Tasks: Event List Temporal Grouping
Input: Design documents from /specs/010-event-list-grouping/
Prerequisites: plan.md, spec.md, research.md, data-model.md
Tests: Included — spec.md references TDD (Constitution II), and research.md explicitly plans unit + E2E test updates.
Organization: Tasks are grouped by user story to enable independent implementation and testing of each story.
Format: [ID] [P?] [Story] Description
- [P]: Can run in parallel (different files, no dependencies)
- [Story]: Which user story this task belongs to (e.g., US1, US2, US3)
- Include exact file paths in descriptions
Phase 1: Setup
Purpose: No new project setup needed — this is a frontend-only enhancement to an existing codebase. Phase 1 is empty.
(No tasks — existing project structure is sufficient.)
Phase 2: Foundational (Blocking Prerequisites)
Purpose: Create the core grouping composable and its types — all user stories depend on this logic.
CRITICAL: No user story work can begin until this phase is complete.
- T001 Define
SectionKey,EventSection, andDateGrouptypes infrontend/src/composables/useEventGrouping.ts - T002 Implement
useEventGroupingcomposable with section classification, date grouping, and sorting logic infrontend/src/composables/useEventGrouping.ts - T003 Write unit tests for
useEventGroupingcovering all four sections, empty-section omission, sort order, and Sunday edge case infrontend/src/components/__tests__/useEventGrouping.spec.ts
Checkpoint: Grouping logic is fully tested and ready for consumption by UI components.
Phase 3: User Story 1 — Temporal Section Headers (Priority: P1) MVP
Goal: Events appear grouped under "Today", "This Week", "Later", and "Past" section headers. Empty sections are hidden.
Independent Test: Add events with various dates to localStorage, verify they appear under correct section headers.
Tests for User Story 1
NOTE: Write these tests FIRST, ensure they FAIL before implementation
- T004 [P] [US1] Write unit tests for
SectionHeader.vuerendering section label and emphasis flag infrontend/src/components/__tests__/SectionHeader.spec.ts - T005 [P] [US1] Update
EventList.spec.tstests to expect grouped section structure instead of flat list infrontend/src/components/__tests__/EventList.spec.ts
Implementation for User Story 1
- T006 [P] [US1] Create
SectionHeader.vuecomponent with section label (<h2>) andaria-labelinfrontend/src/components/SectionHeader.vue - T007 [US1] Refactor
EventList.vuetemplate to useuseEventGrouping, render<section>per temporal group withSectionHeader, and hide empty sections infrontend/src/components/EventList.vue - T008 [US1] Update E2E tests in
home-events.spec.tsto verify section headers appear with correct events distributed across "Today", "This Week", "Later", "Past" infrontend/e2e/home-events.spec.ts
Checkpoint: Event list shows temporal section headers. All four acceptance scenarios pass.
Phase 4: User Story 2 — Date Subheaders Within Sections (Priority: P2)
Goal: Within each section (except "Today"), events are further grouped by date with formatted subheaders like "Wed, 12 Mar".
Independent Test: Add multiple events on different days within one section, verify date subheaders appear.
Tests for User Story 2
NOTE: Write these tests FIRST, ensure they FAIL before implementation
- T009 [P] [US2] Write unit tests for
DateSubheader.vuerendering formatted date label infrontend/src/components/__tests__/DateSubheader.spec.ts - T010 [P] [US2] Add unit tests to
EventList.spec.tsverifying date subheaders appear within sections and are absent in "Today" infrontend/src/components/__tests__/EventList.spec.ts
Implementation for User Story 2
- T011 [P] [US2] Create
DateSubheader.vuecomponent with formatted date (<h3>) usingIntl.DateTimeFormatinfrontend/src/components/DateSubheader.vue - T012 [US2] Update
EventList.vuetemplate to renderDateSubheaderwithin each section's date groups, skipping subheader for "Today" section (showSubheaderflag) infrontend/src/components/EventList.vue - T013 [US2] Add E2E test scenarios for date subheaders: multiple days within a section, no subheader in "Today" in
frontend/e2e/home-events.spec.ts
Checkpoint: Date subheaders render correctly within sections. "Today" section has no subheader.
Phase 5: User Story 3 — Enhanced Event Card Time Display (Priority: P2)
Goal: Event cards show clock time ("18:30") in Today/This Week/Later sections and relative time ("3 days ago") in Past section.
Independent Test: Check event cards display the correct time format based on which section they appear in.
Tests for User Story 3
NOTE: Write these tests FIRST, ensure they FAIL before implementation
- T014 [P] [US3] Add unit tests to
EventCard.spec.tsfortimeDisplayModeprop:'clock'renders formatted time,'relative'renders relative time infrontend/src/components/__tests__/EventCard.spec.ts
Implementation for User Story 3
- T015 [US3] Add
timeDisplayModeprop ('clock' | 'relative') toEventCard.vue, render clock time viaIntl.DateTimeFormat({ hour: '2-digit', minute: '2-digit' })or existingformatRelativeTime()infrontend/src/components/EventCard.vue - T016 [US3] Update
EventList.vueto passtimeDisplayMode="clock"for today/thisWeek/later sections andtimeDisplayMode="relative"for past section infrontend/src/components/EventList.vue - T017 [US3] Add E2E test scenarios verifying clock time in future sections and relative time in past section in
frontend/e2e/home-events.spec.ts
Checkpoint: Time display adapts to section context. All three acceptance scenarios pass.
Phase 6: User Story 4 — Today Section Visual Emphasis (Priority: P3)
Goal: The "Today" section header is visually more prominent (bolder, slightly larger, accent border) than other sections.
Independent Test: Visual verification that "Today" stands out compared to other section headers.
- T018 [US4] Add
.section--todayCSS class toSectionHeader.vuewithfont-weight: 800,font-size: 1.1rem, and left border accent (#F06292) — triggered byemphasizedprop infrontend/src/components/SectionHeader.vue - T019 [US4] Verify
EventList.vuepassesemphasized: truefor the "Today" section (already set viaEventSection.emphasizedfrom data model) infrontend/src/components/EventList.vue - T020 [US4] Add visual E2E assertion checking that the "Today" section header has the emphasis CSS class applied in
frontend/e2e/home-events.spec.ts
Checkpoint: "Today" section is visually distinct. Past events remain faded.
Phase 7: Polish & Cross-Cutting Concerns
Purpose: Final validation and regression checks.
- T021 Run full unit test suite (
cd frontend && npm run test:unit) and fix any regressions - T022 Run full E2E test suite and verify all existing functionality (swipe-to-delete, role badges, empty state, navigation) still works in
frontend/e2e/home-events.spec.ts - T023 Verify accessibility: section headers are
<h2>, date subheaders are<h3>, sections havearia-label, keyboard navigation works
Dependencies & Execution Order
Phase Dependencies
- Setup (Phase 1): Empty — no work needed
- Foundational (Phase 2): No dependencies — can start immediately
- US1 (Phase 3): Depends on Phase 2 (grouping composable)
- US2 (Phase 4): Depends on Phase 3 (needs section structure in EventList)
- US3 (Phase 5): Depends on Phase 3 (needs section context for time mode)
- US4 (Phase 6): Depends on Phase 3 (needs SectionHeader component)
- Polish (Phase 7): Depends on all user stories being complete
User Story Dependencies
- US1 (P1): Can start after Foundational — no dependencies on other stories
- US2 (P2): Depends on US1 (needs section structure in template to add subheaders)
- US3 (P2): Depends on US1 (needs section context to determine time mode), independent of US2
- US4 (P3): Depends on US1 (needs SectionHeader component), independent of US2/US3
Parallel Opportunities
- Phase 2: T001 must precede T002; T003 can run after T002
- Phase 3: T004 and T005 in parallel; T006 in parallel with tests; T007 after T006
- Phase 4: T009 and T010 in parallel; T011 in parallel with tests; T012 after T011
- Phase 5: T014 can start as soon as US1 is done; T015 after T014; T016 after T015
- Phase 6: T018 can run in parallel with Phase 5 (different files)
- US3 and US4 can run in parallel after US1 completes
Parallel Example: After US1 Completes
# These can run in parallel (different files, no dependencies):
Task: T009 [US2] Write DateSubheader unit tests
Task: T014 [US3] Write EventCard time mode unit tests
Task: T018 [US4] Add .section--today CSS to SectionHeader.vue
Implementation Strategy
MVP First (User Story 1 Only)
- Complete Phase 2: Foundational (grouping composable + tests)
- Complete Phase 3: User Story 1 (section headers in EventList)
- STOP and VALIDATE: Test US1 independently
- Deploy/demo if ready — list is already grouped with headers
Incremental Delivery
- Phase 2 → Grouping logic ready
- Add US1 → Section headers visible → Deploy/Demo (MVP!)
- Add US2 → Date subheaders within sections → Deploy/Demo
- Add US3 → Context-aware time display → Deploy/Demo
- Add US4 → Visual polish for "Today" → Deploy/Demo
- Each story adds value without breaking previous stories