Skip to content

Deduplicate UI patterns: empty states, badges, headers #147

@dhilgaertner

Description

@dhilgaertner

Problem

Several UI patterns are repeated across views without a shared component:

  • Empty states — TicketBoardView, ReviewBoardView, GlobalTerminalView all have ContentUnavailableView with icon + title + subtitle + action button, each slightly different
  • Badge capsules.padding(.horizontal, 6).background(...).clipShape(Capsule()) appears in 5+ views
  • Section headers with loading spinner — TicketBoardView, ReviewBoardView, AllowListView all have title + loading indicator + count

Proposed Improvement

Extract shared components:

  • EmptyStateView(icon:title:subtitle:action:)
  • BadgeCapsule(text:color:) modifier or view
  • SectionHeader(title:isLoading:count:) — partially addressed by SectionHelpBanner but not fully

Effort

Low (1 hour). Small view extractions.

Files Affected

  • Packages/CrowUI/Sources/CrowUI/TicketBoardView.swift
  • Packages/CrowUI/Sources/CrowUI/ReviewBoardView.swift
  • Packages/CrowUI/Sources/CrowUI/GlobalTerminalView.swift
  • Packages/CrowUI/Sources/CrowUI/SessionListView.swift
  • New: shared UI components

Priority: 10/10

Metadata

Metadata

Assignees

Labels

refactorCode refactoring and cleanup

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions