Skip to content

Replace color-only milestone status badges with icon plus label tokens #53

@mikewheeleer

Description

@mikewheeleer

Description

In MilestonesList.tsx the statusColors map conveys Pending, Completed, Paid, and Disputed primarily through background color. Refactor these into a shared status badge token that pairs each status with an icon and consistent label so meaning does not rely on color alone. This badge can then be reused in ContractSummary.tsx.

Requirements and context

  • Scoped to TalentTrust Talenttrust-Frontend (Next.js App Router + TS + Tailwind). Align with milestone/contract/reputation flows and the backend API.
  • Centralize status styling into a single StatusBadge component consumed by lists and summaries.
  • Verify contrast of every status variant meets AA against its background.
  • Must be accessible (WCAG 2.1 AA), responsive, tested, and documented. Concrete acceptance criteria: each badge includes a non-color indicator.

Suggested execution

  • Fork the repo and create a branch:
    • git checkout -b enhancement/status-badge-token
  • Implement changes:
    • src/components/StatusBadge.tsx (real or new)
    • Tests: src/components/__tests__/StatusBadge.test.tsx (Jest + React Testing Library)
    • Docs: docs/components/StatusBadge.md
    • Ensure keyboard nav, focus states, ARIA, color-contrast, and responsive breakpoints

Test and commit

  • Run: npm test, npm run lint, npm run build
  • Cover edge cases (loading, empty, error, no-wallet, slow network, small screens)
  • Include screenshots/notes and a11y check results in the PR

Example commit message

feat(ui): add icon-and-label status badge token

Guidelines

  • Accessible (WCAG 2.1 AA), responsive, keyboard-navigable
  • Minimum 95% coverage on new/changed component logic
  • Clear documentation
  • Timeframe: 96 hours from assignment

Metadata

Metadata

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions