feat(ios): Add editable status picker with database-driven colors

Resolved 💬 2 comments Opened Feb 3, 2026 by evanmcgillivray Closed Feb 12, 2026

Summary

Add an editable status picker component for iOS that matches the React StatusCell implementation. Currently, CompanyRosterStatusPill is display-only with hardcoded category colors. The new component should pull statuses and colors from the database and allow inline editing in DataTable.

Current State

  • React: Has StatusCell component with useStatuses hook that queries statuses + statuses_scoped tables
  • iOS: Uses CompanyRosterStatusPill with hardcoded StatusCategory colors (.active, .pending, .warning, etc.)
  • Database: statuses table has color field (hex), name, normalized, entity_type, sort_order
  • PowerSync: Already syncs statuses (reference_data bucket) and statuses_scoped (user_statuses bucket)

Requirements

1. StatusQueryService

Swift equivalent of the React useStatuses hook:

@MainActor
class StatusQueryService {
    func fetchStatuses(entityType: StatusEntityType) async throws -> [StatusRow]
}

struct StatusRow: Identifiable {
    let id: UUID
    let name: String
    let normalized: String
    let color: String?  // Hex color from database
    let entityType: String?
    let sortOrder: Int
}

enum StatusEntityType: String {
    case project, crew, talent, vendor, location
}

Query should UNION statuses (standard) with statuses_scoped (company custom).

2. EditableStatusPicker Component

struct EditableStatusPicker: View {
    let currentStatus: String
    let statuses: [StatusRow]
    let onStatusChange: ((String) -> Void)?
    let disabled: Bool
}
  • Shows current status as colored badge
  • If onStatusChange provided, shows dropdown/menu on tap
  • Uses color field from database for badge background
  • Chevron indicator when editable

3. Integration Points

  • ProjectsListView - Status column in projects table
  • ProjectDetailView - Contacts tab status column
  • Any future DataTable usage with status fields

Reference

  • React implementation: web/src/components/ui/status-cell.tsx
  • React hook: useStatuses() in same file
  • Current iOS pill: productionGrid/Views/Companies/CompanyRosterComponents.swift

Acceptance Criteria

  • [ ] StatusQueryService fetches statuses from PowerSync
  • [ ] Colors from database render correctly (hex to SwiftUI Color)
  • [ ] Dropdown shows all available statuses for entity type
  • [ ] Status changes persist via edge function or dual-write
  • [ ] Works offline (optimistic update, syncs when online)
  • [ ] Matches React UX (click to open menu, select to change)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗