7.8 KiB
Tasks: Semantic Hover Tokens
Input: Design documents from /specs/028-semantic-hover-tokens/
Prerequisites: plan.md, spec.md, research.md, data-model.md, quickstart.md
Tests: No test tasks — feature is purely presentational with manual visual verification.
Organization: Tasks grouped by user story. US1 and US2 are both P1 and share implementation work (defining tokens + migrating components), so they are combined into one phase.
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 (Theme Token Definitions)
Purpose: Define the six semantic hover tokens in the theme
- T001 Add six
--color-hover-*CSS custom properties to the@themeblock inapps/web/src/index.css:--color-hover-neutral: var(--color-foreground),--color-hover-action: var(--color-primary),--color-hover-destructive: var(--color-destructive),--color-hover-neutral-bg: var(--color-card),--color-hover-action-bg: var(--color-muted),--color-hover-destructive-bg: transparent
Checkpoint: Tokens defined — Tailwind now generates text-hover-neutral, bg-hover-neutral-bg, etc. utility classes
Phase 2: User Story 1 + User Story 2 — Token Migration (Priority: P1)
Goal: Migrate all hover color references in affected components from hardcoded values to the semantic tokens, ensuring correct tier assignment per element
Independent Test: Hover over every interactive element and verify: editable fields show grey-to-white (neutral), navigation/add buttons show blue (action), remove/clear buttons show red (destructive). Then change each token value in DevTools and confirm all elements in that tier update.
Neutral-Interactive Tier
- T002 [P] [US1] Migrate combatant-row.tsx neutral hovers: replace 5×
hover:text-primarywithhover:text-hover-neutralon EditableName, MaxHpDisplay, ClickableHp, initiative d20 button, and initiative value button inapps/web/src/components/combatant-row.tsx - T002b [P] [US1] Migrate ac-shield.tsx neutral hover: replace
hover:text-primarywithhover:text-hover-neutralon the AC shield button inapps/web/src/components/ac-shield.tsx - T003 [P] [US1] Migrate condition-tags.tsx neutral hovers: replace
hover:bg-cardwithhover:bg-hover-neutral-bgon condition icon buttons, and replacehover:text-foreground hover:bg-cardwithhover:text-hover-neutral hover:bg-hover-neutral-bgon the add condition (+) button inapps/web/src/components/condition-tags.tsx - T004 [P] [US1] Migrate condition-picker.tsx neutral hover: replace
hover:bg-cardwithhover:bg-hover-neutral-bgon condition row items inapps/web/src/components/condition-picker.tsx - T005 [P] [US1] Migrate action-bar.tsx neutral hover: replace
hover:bg-accent/10withhover:bg-hover-neutral-bgon bestiary search result items inapps/web/src/components/action-bar.tsx - T006 [P] [US1] Migrate stat-block-panel.tsx neutral hovers: replace 2×
hover:text-foregroundwithhover:text-hover-neutralon the desktop close button and mobile close button inapps/web/src/components/stat-block-panel.tsx - T007 [P] [US1] Migrate bestiary-search.tsx neutral hovers: replace
hover:text-foregroundwithhover:text-hover-neutralon the close button, and replacehover:bg-accent/10withhover:bg-hover-neutral-bgon search result items inapps/web/src/components/bestiary-search.tsx
Primary-Action Tier
- T008 [P] [US2] Migrate turn-navigation.tsx action hovers: replace
hover:text-primary hover:border-primary hover:bg-mutedwithhover:text-hover-action hover:border-hover-action hover:bg-hover-action-bgon Previous/Next buttons, and replacehover:text-primarywithhover:text-hover-actionon the Roll All button inapps/web/src/components/turn-navigation.tsx
Destructive-Action Tier
- T009 [P] [US2] Migrate combatant-row.tsx destructive hover: replace
hover:text-destructivewithhover:text-hover-destructiveon the remove button (X) inapps/web/src/components/combatant-row.tsx - T010 [US2] Migrate turn-navigation.tsx destructive hover: replace
hover:text-destructivewithhover:text-hover-destructiveon the Clear button inapps/web/src/components/turn-navigation.tsx
Checkpoint: All components use semantic hover tokens. Hovering shows correct tier colors. Changing any token in DevTools updates all elements in that tier.
Phase 3: User Story 3 — Eliminate One-Off Hover Colors (Priority: P2)
Goal: Verify no hardcoded hover color values remain in the affected components and eliminate any one-offs (e.g., amber)
Independent Test: Search all affected component files for hover:text- and hover:bg- classes that don't reference hover-neutral, hover-action, or hover-destructive tokens. Zero matches expected.
- T011 [US3] Audit all affected components for remaining hardcoded hover colors: grep for
hover:text-andhover:bg-patterns inapps/web/src/components/{combatant-row,condition-tags,condition-picker,turn-navigation,action-bar,stat-block-panel,bestiary-search}.tsxand replace any remaining non-token hover colors (including any amber one-off) with the appropriate semantic token
Checkpoint: Zero hardcoded hover color values in affected components
Phase 4: Polish & Cross-Cutting Concerns
Purpose: Validate everything passes and no regressions
- T012 Run
pnpm checkto verify all linting, formatting, type checking, and tests pass - T013 Visual regression check: start dev server with
pnpm --filter web devand manually verify all hover states per quickstart.md scenarios
Dependencies & Execution Order
Phase Dependencies
- Setup (Phase 1): No dependencies — start immediately
- US1+US2 (Phase 2): Depends on T001 (tokens must exist before components can reference them)
- US3 (Phase 3): Depends on Phase 2 completion (audit after migration)
- Polish (Phase 4): Depends on all previous phases
User Story Dependencies
- US1 (P1): Needs tokens defined (T001), then component migrations (T002–T007)
- US2 (P1): Needs tokens defined (T001), then component migrations (T008–T010). Can run in parallel with US1 tasks.
- US3 (P2): Depends on US1+US2 completion — audit step
Parallel Opportunities
- T002–T010 are all [P] — different files, no dependencies between them. All can run in parallel after T001.
- T008+T010 both modify turn-navigation.tsx but are sequential (T008 handles action tier, T010 handles destructive tier in the same file).
Parallel Example: Phase 2
# After T001 completes, launch all component migrations in parallel:
Task: "T002 - combatant-row neutral hovers"
Task: "T002b - ac-shield neutral hover"
Task: "T003 - condition-tags neutral hovers"
Task: "T004 - condition-picker neutral hover"
Task: "T005 - action-bar neutral hover"
Task: "T006 - stat-block-panel neutral hover"
Task: "T007 - bestiary-search neutral hovers"
Task: "T008 - turn-navigation action hovers"
Task: "T009 - combatant-row destructive hover"
# Then T010 after T008 (same file: turn-navigation.tsx)
Implementation Strategy
MVP First (US1 + US2)
- Complete Phase 1: Define tokens (T001)
- Complete Phase 2: Migrate all components (T002–T010)
- STOP and VALIDATE: Verify all hover tiers visually
- Complete Phase 3: Audit for remaining hardcoded hovers (T011)
- Complete Phase 4: Run checks and visual regression
Notes
- [P] tasks = different files, no dependencies
- T008 and T010 both touch turn-navigation.tsx — run T010 after T008
- T002 and T009 both touch combatant-row.tsx — run T009 after T002
- Commit after each phase or logical group
- No domain/application layer changes needed