From 8470dd03c7ed11339fa2fa28577600bcf83a3b12 Mon Sep 17 00:00:00 2001 From: saridsa2 Date: Thu, 2 Apr 2026 16:55:16 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20UI=20polish=20=E2=80=94=20nav=20labels,?= =?UTF-8?q?=20date=20picker,=20rules=20engine,=20error=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Sidebar: removed "Master" from nav labels (Leads, Patients, Appointments, Call Log) - Appointment form: Dept + Doctor in 2-col row, Date below, disabled cascade - DatePicker: placement="bottom start" + shouldFlip fixes popover positioning - Team Performance: default to "Week", grid KPI cards, chart legend spacing - Rules Engine: manual save (removed auto-debounce), Reset to Defaults uses DEFAULT_PRIORITY_CONFIG (no template endpoint), removed dead saveTimerRef - Automation rules: 6 showcase cards with trigger/condition/action, replaced agent-specific rule with generic round-robin - Recording analysis: friendly error message with retry instead of raw Deepgram error - Sidebar active/hover: brand color reference for theming Co-Authored-By: Claude Opus 4.6 (1M context) --- .../application/date-picker/date-picker.tsx | 3 +- src/components/call-desk/appointment-form.tsx | 45 ++++----- .../call-desk/recording-analysis.tsx | 2 +- src/components/layout/sidebar.tsx | 8 +- src/pages/branding-settings.tsx | 4 - src/pages/rules-settings.tsx | 95 +++++++++++++------ src/pages/team-performance.tsx | 2 +- 7 files changed, 98 insertions(+), 61 deletions(-) diff --git a/src/components/application/date-picker/date-picker.tsx b/src/components/application/date-picker/date-picker.tsx index 603be63..3753aa7 100644 --- a/src/components/application/date-picker/date-picker.tsx +++ b/src/components/application/date-picker/date-picker.tsx @@ -40,7 +40,8 @@ export const DatePicker = ({ value: valueProp, defaultValue, onChange, onApply, cx( "origin-(--trigger-anchor-point) will-change-transform", diff --git a/src/components/call-desk/appointment-form.tsx b/src/components/call-desk/appointment-form.tsx index 1d8d75b..ec8f8e3 100644 --- a/src/components/call-desk/appointment-form.tsx +++ b/src/components/call-desk/appointment-form.tsx @@ -386,29 +386,29 @@ export const AppointmentForm = ({ )} - +
+ - + +
Date * @@ -416,6 +416,7 @@ export const AppointmentForm = ({ value={date ? parseDate(date) : null} onChange={(val) => setDate(val ? val.toString() : '')} granularity="day" + isDisabled={!doctor} />
diff --git a/src/components/call-desk/recording-analysis.tsx b/src/components/call-desk/recording-analysis.tsx index 59bf5f5..314f59e 100644 --- a/src/components/call-desk/recording-analysis.tsx +++ b/src/components/call-desk/recording-analysis.tsx @@ -178,7 +178,7 @@ export const RecordingAnalysisSlideout = ({ {error && !loading && (
-

{error}

+

Transcription is temporarily unavailable. Please try again.

+ {dirty && ( + + )}
@@ -143,14 +133,63 @@ export const RulesSettingsPage = () => { -
-
-

Automation Rules

-

- Configure rules that automatically assign leads, escalate SLA breaches, and manage lead lifecycle. - This feature is coming soon. -

+
+
+
+

Automation Rules

+

Rules that trigger actions when conditions are met — assign leads, escalate breaches, update status.

+
+ + {[ + { name: 'SLA Breach → Supervisor Alert', description: 'Alert supervisor when a missed call callback exceeds 12-hour SLA', trigger: 'Every 5 minutes', condition: 'SLA > 100% AND status = PENDING_CALLBACK', action: 'Notify supervisor via bell + toast', category: 'escalation', enabled: true }, + { name: 'Cold Lead after 3 Attempts', description: 'Mark lead as COLD when 3 contact attempts fail', trigger: 'On call ended', condition: 'Contact attempts ≥ 3 AND disposition ≠ APPOINTMENT_BOOKED', action: 'Update lead status → COLD', category: 'lifecycle', enabled: true }, + { name: 'Round-robin Lead Assignment', description: 'Distribute new campaign leads evenly across available agents', trigger: 'On lead created', condition: 'assignedAgent is empty AND agent status = READY', action: 'Assign to least-loaded ready agent', category: 'assignment', enabled: false }, + { name: 'Follow-up Reminder at 80% SLA', description: 'Push notification when a follow-up approaches its SLA deadline', trigger: 'Every 5 minutes', condition: 'SLA elapsed ≥ 80% AND status = PENDING', action: 'Notify assigned agent via bell', category: 'escalation', enabled: true }, + { name: 'Spam Lead Auto-close', description: 'Automatically close leads with spam score above 80', trigger: 'On lead updated', condition: 'Spam score > 80', action: 'Update lead status → SPAM_CLOSED', category: 'lifecycle', enabled: false }, + { name: 'VIP Patient Escalation', description: 'Escalate to supervisor when a returning patient calls and waits over 5 minutes', trigger: 'Every 1 minute', condition: 'Patient type = RETURNING AND wait time > 5 min', action: 'Notify supervisor + assign to next available agent', category: 'escalation', enabled: false }, + ].map((rule, i) => { + const categoryColors: Record = { + escalation: 'bg-error-secondary text-error-primary', + lifecycle: 'bg-warning-secondary text-warning-primary', + assignment: 'bg-brand-secondary text-brand-secondary', + }; + return ( +
+
+
+
+ {rule.name} + + {rule.category} + +
+

{rule.description}

+
+
+ Trigger +

{rule.trigger}

+
+
+ Condition +

{rule.condition}

+
+
+ Action +

{rule.action}

+
+
+
+
+
+ {rule.enabled ? 'On' : 'Off'} +
+
+
+ ); + })} + +

Rule editing and creation will be available in a future update.

diff --git a/src/pages/team-performance.tsx b/src/pages/team-performance.tsx index 95e0af4..0765624 100644 --- a/src/pages/team-performance.tsx +++ b/src/pages/team-performance.tsx @@ -76,7 +76,7 @@ const KpiCard = ({ icon, value, label, color }: { icon: any; value: string | num ); export const TeamPerformancePage = () => { - const [range, setRange] = useState('today'); + const [range, setRange] = useState('week'); const [agents, setAgents] = useState([]); const [allCalls, setAllCalls] = useState([]); const [allAppointments, setAllAppointments] = useState([]);