chordia-ui 4.0.3 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ import UpdatedInteractionRecording from './UpdatedInteractionRecording';
5
5
  import UpdatedCoachingSynthesisCard from './UpdatedCoachingSynthesisCard';
6
6
  import UpdatedInteractionSignals from './UpdatedInteractionSignals';
7
7
  import UpdatedCompassScore from './UpdatedCompassScore';
8
+ import InteractionQualityOverview from './InteractionQualityOverview';
8
9
  import UpdatedThreads from './UpdatedThreads';
9
10
  import UpdatedGuidance from './UpdatedGuidance';
10
11
  import UpdatedTalkPatterns from './UpdatedTalkPatterns';
@@ -200,6 +201,13 @@ const UpdatedInteractionDetails = ({
200
201
  onMenuClick,
201
202
  onMarkResolved,
202
203
  commentsResolved,
204
+ // Temporary client-specific flag (host-controlled, later backend-driven).
205
+ // When true, the OVERVIEW section renders the new InteractionQualityOverview
206
+ // card instead of the gauge / context grid / lift-analysis row.
207
+ oldInteractionDetailsView = false,
208
+ // Host-built data bag consumed by InteractionQualityOverview when
209
+ // `oldInteractionDetailsView` is on. See that component for the prop shape.
210
+ qualityOverview = {},
203
211
  }) => {
204
212
  const [activeTab, setActiveTab] = useState('overview');
205
213
  const [expandedSignals, setExpandedSignals] = useState(new Set());
@@ -243,16 +251,22 @@ const UpdatedInteractionDetails = ({
243
251
  // when data is present. Stays in sync with the section order below so the
244
252
  // scroll-spy reads top-to-bottom.
245
253
  const tabs = useMemo(() => {
246
- if (!hasProductsServices) return BASE_TABS;
254
+ // In the new client view the coaching strengths/improvements are surfaced
255
+ // in the top "Interaction Quality" card, so the dedicated Coaching Summary
256
+ // section (and its tab) is dropped.
257
+ const base = oldInteractionDetailsView
258
+ ? BASE_TABS.filter((t) => t.key !== 'coaching')
259
+ : BASE_TABS;
260
+ if (!hasProductsServices) return base;
247
261
  const out = [];
248
- for (const t of BASE_TABS) {
262
+ for (const t of base) {
249
263
  if (t.key === 'comments') {
250
264
  out.push({ key: 'products', label: 'Products & Services' });
251
265
  }
252
266
  out.push(t);
253
267
  }
254
268
  return out;
255
- }, [hasProductsServices]);
269
+ }, [hasProductsServices, oldInteractionDetailsView]);
256
270
 
257
271
  // Scroll-spy: update active tab based on which section's top is nearest the viewport
258
272
  useEffect(() => {
@@ -760,6 +774,48 @@ const UpdatedInteractionDetails = ({
760
774
  gap: 24,
761
775
  alignSelf: 'stretch',
762
776
  }}>
777
+ {oldInteractionDetailsView ? (
778
+ <InteractionQualityOverview
779
+ title="Interaction Quality"
780
+ dateStr={dateStr}
781
+ direction={direction}
782
+ agentName={agentName}
783
+ agentFullName={agentFullName}
784
+ customerName={customerName}
785
+ customerFullName={customerFullName}
786
+ sessionCount={sessionCount}
787
+ onViewAllSessions={() => setShowSessionDrawer(true)}
788
+ canEdit={canEditInteraction}
789
+ onEditInteraction={onEditInteraction}
790
+ // Reuse the existing context grid behind the "More Details"
791
+ // toggle so nothing is duplicated and no context data is lost.
792
+ moreDetailsContent={
793
+ <UpdatedInteractionContext
794
+ meta={resolvedMeta}
795
+ callPurpose={resolvedCallPurpose}
796
+ classification={resolvedClassification}
797
+ outcomeQuality={externalOutcomeQuality || 'Neutral'}
798
+ dimensions={blockDimensions}
799
+ resolutionOutcome={resolutionOutcome}
800
+ customerIntent={customerIntent}
801
+ location={location ?? meta.location ?? meta.location_name ?? ctx.location}
802
+ interactionId={interactionId ?? meta.interaction_id}
803
+ moreDetails={moreDetails}
804
+ canShowEditButton={false}
805
+ flatView
806
+ />
807
+ }
808
+ scorePercent={qualityOverview.scorePercent}
809
+ scoreOwnerName={qualityOverview.scoreOwnerName}
810
+ details={qualityOverview.details}
811
+ summary={qualityOverview.summary}
812
+ csat={qualityOverview.csat}
813
+ strengths={qualityOverview.strengths}
814
+ improvements={qualityOverview.improvements}
815
+ loading={qualityOverview.loading}
816
+ />
817
+ ) : (
818
+ <>
763
819
  {/* Figma node 106-3508: Section Header — horizontal, gap: 16, height: 40, center */}
764
820
  <div style={{
765
821
  display: 'flex',
@@ -1086,13 +1142,19 @@ const UpdatedInteractionDetails = ({
1086
1142
  })()}
1087
1143
  </div>
1088
1144
  </div>
1145
+ </>
1146
+ )}
1089
1147
 
1090
1148
  </div>
1091
1149
 
1092
1150
  {/* ═══ COACHING SUMMARY SECTION ═══ */}
1093
- <div ref={coachingRef} style={{ paddingTop: 24 }}>
1094
- <UpdatedCoachingSynthesisCard data={coachingLoading ? null : resolvedCoaching} loading={coachingLoading} />
1095
- </div>
1151
+ {/* Hidden in the new client view — its strengths/improvements are
1152
+ already shown in the top "Interaction Quality" card. */}
1153
+ {!oldInteractionDetailsView && (
1154
+ <div ref={coachingRef} style={{ paddingTop: 24 }}>
1155
+ <UpdatedCoachingSynthesisCard data={coachingLoading ? null : resolvedCoaching} loading={coachingLoading} />
1156
+ </div>
1157
+ )}
1096
1158
 
1097
1159
  {/* ═══ SIGNALS & RECORDING SECTION ═══ */}
1098
1160
  <div ref={signalsRef} style={{
@@ -5,6 +5,7 @@ export { default as UpdatedInteractionScores } from './UpdatedInteractionScores.
5
5
  export { default as UpdatedInteractionSignals } from './UpdatedInteractionSignals.jsx';
6
6
  export { default as UpdatedInteractionRecording } from './UpdatedInteractionRecording.jsx';
7
7
  export { default as UpdatedCompassScore } from './UpdatedCompassScore.jsx';
8
+ export { default as InteractionQualityOverview } from './InteractionQualityOverview.jsx';
8
9
  export { default as UpdatedThreads } from './UpdatedThreads.jsx';
9
10
  export { default as UpdatedGuidance } from './UpdatedGuidance.jsx';
10
11
  export { default as UpdatedProductsServices } from './UpdatedProductsServices.jsx';
@@ -85,6 +85,7 @@ export {
85
85
  UpdatedInteractionRecording,
86
86
  UpdatedCoachingSynthesisCard,
87
87
  UpdatedCompassScore,
88
+ InteractionQualityOverview,
88
89
  UpdatedGuidance,
89
90
  UpdatedProductsServices,
90
91
  } from './UpdatedInteractionDetails';