Skip to content

Add real-time timecard updates on Earthlight project edit screen #66

@aultra

Description

@aultra

Description

Add Supabase real-time subscription for earthlight_timecard_entries to show live updates when employees clock in/out or entries are modified.

Current Behavior

  • Timecard entries loaded once when screen/tab initializes
  • No automatic refresh when other users modify timecard entries

Implementation

  • Add RealtimeChannel subscription for earthlight_timecard_entries
  • Filter to current project (project_uuid = project.id)
  • Surgical update handlers (INSERT, UPDATE, DELETE)
  • Recalculate hoursByLaborType and summaries on each update
  • Handle employee cache misses
  • Add debouncing to prevent UI thrashing
  • Respect _isSavingLocalChanges flag to prevent echo updates
  • Test with multiple users editing same project

Benefits

  • Managers see live crew activity on projects
  • Immediate visibility when employees clock in/out
  • Consistent with existing real-time patterns in the app

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions