Broadcast Module¶
Overview¶
The broadcast area currently has two distinct surfaces:
- src/pages/Broadcasts.tsx for campaign management and campaign-lead navigation
- src/pages/EnhancedBroadcastAnalytics.tsx for KPI, funnel, and chart views
Campaign Creation And Editing¶
- Primary wizard entrypoint:
src/components/broadcast/BroadcastWizard.tsx - The wizard is already split into concrete step components rather than the generic placeholders described in older docs
- The older redesign concepts map most closely to the existing step breakdown:
- audience and area-code balancing
- message composition and templates
- scheduling and batch controls
- review/confirmation
- Supporting sections live under
src/components/broadcast/sections/andsrc/components/broadcast/step3,step4
Broadcast Table Screen¶
Broadcasts.tsxdrives the list view- It uses the shared table stack plus
useSimpleBroadcastsState - Global filters are wired to real search behavior for search text, Phoenix date range, and broadcast statuses
- Inline edits call the
campaign-updateEdge Function for fields such as status, schedule dates, message content, and send rate
Analytics Status¶
useCampaignMetricsand thecampaign-metricsEdge Function provide real campaign summary and aggregate KPI data- KPI cards and the campaign control bar are connected to backend data
- The analytics page is still only partially real:
- funnel data is derived heuristically from campaign metrics, not a dedicated opportunity-stage dataset
- line and bar charts still use in-file mock arrays
- global filters currently influence the page state/UI more than the backend query shape
- conversion counts in
campaign-metricsare placeholder calculations
Current Integration Points¶
- Campaign CRUD/search functions under
supabase/functions/campaign-* - Delivery queue and status functions under
campaign-lead-* - Broadcast analytics hook:
src/hooks/useCampaignMetrics.ts - Broadcast columns:
src/components/leads/config/broadcastColumns.ts
Practical Guidance¶
- Treat
EnhancedBroadcastAnalyticsas a mixed real/mock dashboard, not a finished analytics backend - When extending the wizard, add behavior to the existing step/section components instead of introducing a second broadcast flow
- When extending analytics, prefer upgrading
campaign-metricsand replacing mock chart inputs before adding more front-end visual polish