mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-11 18:28:15 +00:00
feat: call desk redesign — 2-panel layout, collapsible sidebar, inline AI, ringtone
- Collapsible sidebar with Jotai atom (icon-only mode, persisted to localStorage) - 2-panel call desk: worklist (60%) + context panel (40%) with AI + Lead 360 tabs - Inline AI call prep card — known lead summary or unknown caller script - Active call card with compact Answer/Decline buttons - Worklist panel with human-readable labels, priority badges, click-to-select - Context panel auto-switches to Lead 360 when lead selected or call incoming - Browser ringtone via Web Audio API on incoming calls - Sonner + Untitled UI IconNotification for toast system - apiClient pattern: centralized post/get/graphql with auto-toast on errors - Remove duplicate avatar from top bar, hide floating widget on call desk - Fix Link routing in collapsed sidebar (was using <a> causing full page reload) - Fix GraphQL field names: adStatus→status, platformUrl needs subfield selection - Silent mode for DataProvider queries to prevent toast spam Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,23 +78,24 @@ export const DataProvider = ({ children }: DataProviderProps) => {
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
const gql = <T,>(query: string) => apiClient.graphql<T>(query, undefined, { silent: true }).catch(() => null);
|
||||
|
||||
const [leadsData, campaignsData, adsData, followUpsData, activitiesData, callsData] = await Promise.all([
|
||||
apiClient.graphql<any>(LEADS_QUERY),
|
||||
apiClient.graphql<any>(CAMPAIGNS_QUERY),
|
||||
apiClient.graphql<any>(ADS_QUERY),
|
||||
apiClient.graphql<any>(FOLLOW_UPS_QUERY),
|
||||
apiClient.graphql<any>(LEAD_ACTIVITIES_QUERY),
|
||||
apiClient.graphql<any>(CALLS_QUERY),
|
||||
gql<any>(LEADS_QUERY),
|
||||
gql<any>(CAMPAIGNS_QUERY),
|
||||
gql<any>(ADS_QUERY),
|
||||
gql<any>(FOLLOW_UPS_QUERY),
|
||||
gql<any>(LEAD_ACTIVITIES_QUERY),
|
||||
gql<any>(CALLS_QUERY),
|
||||
]);
|
||||
|
||||
setLeads(transformLeads(leadsData));
|
||||
setCampaigns(transformCampaigns(campaignsData));
|
||||
setAds(transformAds(adsData));
|
||||
setFollowUps(transformFollowUps(followUpsData));
|
||||
setLeadActivities(transformLeadActivities(activitiesData));
|
||||
setCalls(transformCalls(callsData));
|
||||
if (leadsData) setLeads(transformLeads(leadsData));
|
||||
if (campaignsData) setCampaigns(transformCampaigns(campaignsData));
|
||||
if (adsData) setAds(transformAds(adsData));
|
||||
if (followUpsData) setFollowUps(transformFollowUps(followUpsData));
|
||||
if (activitiesData) setLeadActivities(transformLeadActivities(activitiesData));
|
||||
if (callsData) setCalls(transformCalls(callsData));
|
||||
} catch (err: any) {
|
||||
console.error('Failed to fetch platform data:', err);
|
||||
setError(err.message ?? 'Failed to load data');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user