@optifye/dashboard-core 6.12.28 → 6.12.29

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.
@@ -270,6 +270,9 @@ interface LineSignal {
270
270
  weight?: number | null;
271
271
  mode?: KpiSignalMode;
272
272
  reason?: string | null;
273
+ aggregate_eligible?: boolean | null;
274
+ aggregate_reason?: string | null;
275
+ aggregate_threshold_percent?: number | null;
273
276
  effective_end_at?: string | null;
274
277
  computed_at?: string | null;
275
278
  }
@@ -279,6 +282,9 @@ interface KpiSignal {
279
282
  weight?: number | null;
280
283
  mode?: KpiSignalMode;
281
284
  reason?: string | null;
285
+ aggregateEligible?: boolean | null;
286
+ aggregateReason?: string | null;
287
+ aggregateThresholdPercent?: number | null;
282
288
  effectiveEndAt?: string | null;
283
289
  computedAt?: string | null;
284
290
  }
@@ -270,6 +270,9 @@ interface LineSignal {
270
270
  weight?: number | null;
271
271
  mode?: KpiSignalMode;
272
272
  reason?: string | null;
273
+ aggregate_eligible?: boolean | null;
274
+ aggregate_reason?: string | null;
275
+ aggregate_threshold_percent?: number | null;
273
276
  effective_end_at?: string | null;
274
277
  computed_at?: string | null;
275
278
  }
@@ -279,6 +282,9 @@ interface KpiSignal {
279
282
  weight?: number | null;
280
283
  mode?: KpiSignalMode;
281
284
  reason?: string | null;
285
+ aggregateEligible?: boolean | null;
286
+ aggregateReason?: string | null;
287
+ aggregateThresholdPercent?: number | null;
282
288
  effectiveEndAt?: string | null;
283
289
  computedAt?: string | null;
284
290
  }
@@ -1,2 +1,2 @@
1
- export { z as RecentFlowSnapshotGrid, R as RecentFlowSnapshotGridProps, W as WorkspaceMetrics, e as WorkspaceVideoStream } from './automation-CQqrAD4z.mjs';
1
+ export { z as RecentFlowSnapshotGrid, R as RecentFlowSnapshotGridProps, W as WorkspaceMetrics, e as WorkspaceVideoStream } from './automation-DYa3jNEf.mjs';
2
2
  import 'react';
@@ -1,2 +1,2 @@
1
- export { z as RecentFlowSnapshotGrid, R as RecentFlowSnapshotGridProps, W as WorkspaceMetrics, e as WorkspaceVideoStream } from './automation-CQqrAD4z.js';
1
+ export { z as RecentFlowSnapshotGrid, R as RecentFlowSnapshotGridProps, W as WorkspaceMetrics, e as WorkspaceVideoStream } from './automation-DYa3jNEf.js';
2
2
  import 'react';
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as LineSignal, V as VideoGridMetricMode, W as WorkspaceMetrics, a as LineInfo, b as WorkspaceDetailedMetrics, S as SkuBreakdownItem, c as SkuSegmentItem, d as LineSkuBreakdownItem, E as EfficiencyLegendUpdate, D as DashboardKPIs, P as PoorPerformingWorkspace, e as WorkspaceVideoStream, K as KpiTrend, M as MonthlyTrendSummary, f as Workspace, g as WorkspaceCameraIpInfo, h as WorkspaceActionUpdate, A as ActionThreshold, i as ShiftConfiguration, j as KpiSignal, k as LineIssueResolutionSummary } from './automation-CQqrAD4z.mjs';
2
- export { r as CountDelta, C as CurrentWorkspaceSKU, s as DurationDelta, o as KpiSignalMode, n as KpiSignalSource, l as LineDetailedMetrics, m as LineSignalSource, u as LineThreshold, q as PercentageDelta, z as RecentFlowSnapshotGrid, R as RecentFlowSnapshotGridProps, v as ShiftConfigurationRecord, p as ValueDelta, t as WorkspaceCropRect, x as isRecentFlowVideoGridMetricMode, y as isWipGatedVideoGridMetricMode, w as normalizeVideoGridMetricMode } from './automation-CQqrAD4z.mjs';
1
+ import { L as LineSignal, V as VideoGridMetricMode, W as WorkspaceMetrics, a as LineInfo, b as WorkspaceDetailedMetrics, S as SkuBreakdownItem, c as SkuSegmentItem, d as LineSkuBreakdownItem, E as EfficiencyLegendUpdate, D as DashboardKPIs, P as PoorPerformingWorkspace, e as WorkspaceVideoStream, K as KpiTrend, M as MonthlyTrendSummary, f as Workspace, g as WorkspaceCameraIpInfo, h as WorkspaceActionUpdate, A as ActionThreshold, i as ShiftConfiguration, j as KpiSignal, k as LineIssueResolutionSummary } from './automation-DYa3jNEf.mjs';
2
+ export { r as CountDelta, C as CurrentWorkspaceSKU, s as DurationDelta, o as KpiSignalMode, n as KpiSignalSource, l as LineDetailedMetrics, m as LineSignalSource, u as LineThreshold, q as PercentageDelta, z as RecentFlowSnapshotGrid, R as RecentFlowSnapshotGridProps, v as ShiftConfigurationRecord, p as ValueDelta, t as WorkspaceCropRect, x as isRecentFlowVideoGridMetricMode, y as isWipGatedVideoGridMetricMode, w as normalizeVideoGridMetricMode } from './automation-DYa3jNEf.mjs';
3
3
  import * as _supabase_supabase_js from '@supabase/supabase-js';
4
4
  import { SupabaseClient as SupabaseClient$1, Session, User, AuthError } from '@supabase/supabase-js';
5
5
  import { LucideProps, Share2, Download } from 'lucide-react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as LineSignal, V as VideoGridMetricMode, W as WorkspaceMetrics, a as LineInfo, b as WorkspaceDetailedMetrics, S as SkuBreakdownItem, c as SkuSegmentItem, d as LineSkuBreakdownItem, E as EfficiencyLegendUpdate, D as DashboardKPIs, P as PoorPerformingWorkspace, e as WorkspaceVideoStream, K as KpiTrend, M as MonthlyTrendSummary, f as Workspace, g as WorkspaceCameraIpInfo, h as WorkspaceActionUpdate, A as ActionThreshold, i as ShiftConfiguration, j as KpiSignal, k as LineIssueResolutionSummary } from './automation-CQqrAD4z.js';
2
- export { r as CountDelta, C as CurrentWorkspaceSKU, s as DurationDelta, o as KpiSignalMode, n as KpiSignalSource, l as LineDetailedMetrics, m as LineSignalSource, u as LineThreshold, q as PercentageDelta, z as RecentFlowSnapshotGrid, R as RecentFlowSnapshotGridProps, v as ShiftConfigurationRecord, p as ValueDelta, t as WorkspaceCropRect, x as isRecentFlowVideoGridMetricMode, y as isWipGatedVideoGridMetricMode, w as normalizeVideoGridMetricMode } from './automation-CQqrAD4z.js';
1
+ import { L as LineSignal, V as VideoGridMetricMode, W as WorkspaceMetrics, a as LineInfo, b as WorkspaceDetailedMetrics, S as SkuBreakdownItem, c as SkuSegmentItem, d as LineSkuBreakdownItem, E as EfficiencyLegendUpdate, D as DashboardKPIs, P as PoorPerformingWorkspace, e as WorkspaceVideoStream, K as KpiTrend, M as MonthlyTrendSummary, f as Workspace, g as WorkspaceCameraIpInfo, h as WorkspaceActionUpdate, A as ActionThreshold, i as ShiftConfiguration, j as KpiSignal, k as LineIssueResolutionSummary } from './automation-DYa3jNEf.js';
2
+ export { r as CountDelta, C as CurrentWorkspaceSKU, s as DurationDelta, o as KpiSignalMode, n as KpiSignalSource, l as LineDetailedMetrics, m as LineSignalSource, u as LineThreshold, q as PercentageDelta, z as RecentFlowSnapshotGrid, R as RecentFlowSnapshotGridProps, v as ShiftConfigurationRecord, p as ValueDelta, t as WorkspaceCropRect, x as isRecentFlowVideoGridMetricMode, y as isWipGatedVideoGridMetricMode, w as normalizeVideoGridMetricMode } from './automation-DYa3jNEf.js';
3
3
  import * as _supabase_supabase_js from '@supabase/supabase-js';
4
4
  import { SupabaseClient as SupabaseClient$1, Session, User, AuthError } from '@supabase/supabase-js';
5
5
  import { LucideProps, Share2, Download } from 'lucide-react';
package/dist/index.js CHANGED
@@ -22096,7 +22096,7 @@ var normalizeLineSignalSource = (source) => source === "recent_flow" ? "recent_f
22096
22096
  var normalizeLineSignal = (lineSignal, fallbackEfficiency, fallbackWeight) => {
22097
22097
  if (lineSignal && typeof lineSignal === "object") {
22098
22098
  const raw = lineSignal;
22099
- return {
22099
+ const normalized = {
22100
22100
  source: normalizeLineSignalSource(raw.source),
22101
22101
  percent: toOptionalNumber(raw.percent),
22102
22102
  weight: toOptionalNumber(raw.weight),
@@ -22105,6 +22105,21 @@ var normalizeLineSignal = (lineSignal, fallbackEfficiency, fallbackWeight) => {
22105
22105
  effectiveEndAt: raw.effective_end_at ?? raw.effectiveEndAt ?? null,
22106
22106
  computedAt: raw.computed_at ?? raw.computedAt ?? null
22107
22107
  };
22108
+ const aggregateEligible = typeof raw.aggregate_eligible === "boolean" ? raw.aggregate_eligible : typeof raw.aggregateEligible === "boolean" ? raw.aggregateEligible : null;
22109
+ if (aggregateEligible !== null) {
22110
+ normalized.aggregateEligible = aggregateEligible;
22111
+ }
22112
+ const aggregateReason = typeof raw.aggregate_reason === "string" ? raw.aggregate_reason : typeof raw.aggregateReason === "string" ? raw.aggregateReason : null;
22113
+ if (aggregateReason !== null) {
22114
+ normalized.aggregateReason = aggregateReason;
22115
+ }
22116
+ const aggregateThresholdPercent = toOptionalNumber(
22117
+ raw.aggregate_threshold_percent ?? raw.aggregateThresholdPercent
22118
+ );
22119
+ if (aggregateThresholdPercent !== null) {
22120
+ normalized.aggregateThresholdPercent = aggregateThresholdPercent;
22121
+ }
22122
+ return normalized;
22108
22123
  }
22109
22124
  const percent2 = toOptionalNumber(fallbackEfficiency);
22110
22125
  if (percent2 === null) return null;
@@ -22132,7 +22147,7 @@ var getKpiSignalLabel = (signal, legend = DEFAULT_EFFICIENCY_LEGEND) => {
22132
22147
  };
22133
22148
  var aggregateLineSignals = (signals) => {
22134
22149
  const numericSignals = signals.filter(
22135
- (signal) => signal !== null && signal !== void 0 && toOptionalNumber(signal.percent) !== null
22150
+ (signal) => signal !== null && signal !== void 0 && signal.aggregateEligible !== false && toOptionalNumber(signal.percent) !== null
22136
22151
  );
22137
22152
  if (numericSignals.length === 0) return null;
22138
22153
  const percent2 = numericSignals.reduce(
@@ -64837,7 +64852,6 @@ var EMPTY_LINE_IDS = [];
64837
64852
  var EMPTY_WORKSPACES = [];
64838
64853
  var ALL_GREEN_CELEBRATION_DURATION_MS = 6e3;
64839
64854
  var ALL_GREEN_MILESTONE_DURATION_MS = 6e3;
64840
- var ALL_GREEN_STREAK_LOCAL_SECOND_CAP = 59;
64841
64855
  var formatAllGreenCelebrationTimer = (elapsedSeconds) => {
64842
64856
  const safeElapsedSeconds = Math.max(1, Math.floor(elapsedSeconds));
64843
64857
  const minutes = Math.floor(safeElapsedSeconds / 60);
@@ -64845,10 +64859,7 @@ var formatAllGreenCelebrationTimer = (elapsedSeconds) => {
64845
64859
  return `${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}s`;
64846
64860
  };
64847
64861
  var getAllGreenBackendVisibleSeconds = (confirmedSeconds, tickOriginAtMs, nowMs2) => {
64848
- const localSecondOffset = Math.min(
64849
- ALL_GREEN_STREAK_LOCAL_SECOND_CAP,
64850
- Math.max(0, Math.floor((nowMs2 - tickOriginAtMs) / 1e3))
64851
- );
64862
+ const localSecondOffset = Math.max(0, Math.floor((nowMs2 - tickOriginAtMs) / 1e3));
64852
64863
  return confirmedSeconds + localSecondOffset;
64853
64864
  };
64854
64865
  var LoadingPageCmp = LoadingPage_default;
@@ -65308,38 +65319,25 @@ function HomeView({
65308
65319
  allGreenStreakDisplay.tickOriginAtMs,
65309
65320
  currentAllGreenStreakNowMs
65310
65321
  );
65311
- const backendMaxVisibleSeconds = confirmedSeconds + ALL_GREEN_STREAK_LOCAL_SECOND_CAP;
65312
65322
  const currentBaseline = allGreenStreakTimerBaselineRef.current;
65313
65323
  if (!currentBaseline || currentBaseline.identity !== allGreenMilestoneIdentity) {
65314
65324
  allGreenStreakTimerBaselineRef.current = {
65315
65325
  identity: allGreenMilestoneIdentity,
65316
65326
  baseSeconds: backendVisibleSeconds,
65317
- baseReceivedAtMs: currentAllGreenStreakNowMs,
65318
- maxVisibleSeconds: backendMaxVisibleSeconds
65327
+ baseReceivedAtMs: currentAllGreenStreakNowMs
65319
65328
  };
65320
65329
  } else {
65321
- currentBaseline.maxVisibleSeconds = Math.max(
65322
- currentBaseline.maxVisibleSeconds,
65323
- backendMaxVisibleSeconds
65324
- );
65325
- const visibleSeconds = Math.min(
65326
- currentBaseline.maxVisibleSeconds,
65327
- currentBaseline.baseSeconds + Math.max(0, Math.floor((currentAllGreenStreakNowMs - currentBaseline.baseReceivedAtMs) / 1e3))
65328
- );
65330
+ const visibleSeconds = currentBaseline.baseSeconds + Math.max(0, Math.floor((currentAllGreenStreakNowMs - currentBaseline.baseReceivedAtMs) / 1e3));
65329
65331
  if (backendVisibleSeconds > visibleSeconds) {
65330
65332
  allGreenStreakTimerBaselineRef.current = {
65331
65333
  identity: allGreenMilestoneIdentity,
65332
65334
  baseSeconds: backendVisibleSeconds,
65333
- baseReceivedAtMs: currentAllGreenStreakNowMs,
65334
- maxVisibleSeconds: currentBaseline.maxVisibleSeconds
65335
+ baseReceivedAtMs: currentAllGreenStreakNowMs
65335
65336
  };
65336
65337
  }
65337
65338
  }
65338
65339
  const baseline = allGreenStreakTimerBaselineRef.current;
65339
- const elapsedSeconds = baseline ? Math.min(
65340
- baseline.maxVisibleSeconds,
65341
- baseline.baseSeconds + Math.max(0, Math.floor((currentAllGreenStreakNowMs - baseline.baseReceivedAtMs) / 1e3))
65342
- ) : backendVisibleSeconds;
65340
+ const elapsedSeconds = baseline ? baseline.baseSeconds + Math.max(0, Math.floor((currentAllGreenStreakNowMs - baseline.baseReceivedAtMs) / 1e3)) : backendVisibleSeconds;
65343
65341
  return {
65344
65342
  ...allGreenStreakDisplay,
65345
65343
  elapsedSeconds,
package/dist/index.mjs CHANGED
@@ -22067,7 +22067,7 @@ var normalizeLineSignalSource = (source) => source === "recent_flow" ? "recent_f
22067
22067
  var normalizeLineSignal = (lineSignal, fallbackEfficiency, fallbackWeight) => {
22068
22068
  if (lineSignal && typeof lineSignal === "object") {
22069
22069
  const raw = lineSignal;
22070
- return {
22070
+ const normalized = {
22071
22071
  source: normalizeLineSignalSource(raw.source),
22072
22072
  percent: toOptionalNumber(raw.percent),
22073
22073
  weight: toOptionalNumber(raw.weight),
@@ -22076,6 +22076,21 @@ var normalizeLineSignal = (lineSignal, fallbackEfficiency, fallbackWeight) => {
22076
22076
  effectiveEndAt: raw.effective_end_at ?? raw.effectiveEndAt ?? null,
22077
22077
  computedAt: raw.computed_at ?? raw.computedAt ?? null
22078
22078
  };
22079
+ const aggregateEligible = typeof raw.aggregate_eligible === "boolean" ? raw.aggregate_eligible : typeof raw.aggregateEligible === "boolean" ? raw.aggregateEligible : null;
22080
+ if (aggregateEligible !== null) {
22081
+ normalized.aggregateEligible = aggregateEligible;
22082
+ }
22083
+ const aggregateReason = typeof raw.aggregate_reason === "string" ? raw.aggregate_reason : typeof raw.aggregateReason === "string" ? raw.aggregateReason : null;
22084
+ if (aggregateReason !== null) {
22085
+ normalized.aggregateReason = aggregateReason;
22086
+ }
22087
+ const aggregateThresholdPercent = toOptionalNumber(
22088
+ raw.aggregate_threshold_percent ?? raw.aggregateThresholdPercent
22089
+ );
22090
+ if (aggregateThresholdPercent !== null) {
22091
+ normalized.aggregateThresholdPercent = aggregateThresholdPercent;
22092
+ }
22093
+ return normalized;
22079
22094
  }
22080
22095
  const percent2 = toOptionalNumber(fallbackEfficiency);
22081
22096
  if (percent2 === null) return null;
@@ -22103,7 +22118,7 @@ var getKpiSignalLabel = (signal, legend = DEFAULT_EFFICIENCY_LEGEND) => {
22103
22118
  };
22104
22119
  var aggregateLineSignals = (signals) => {
22105
22120
  const numericSignals = signals.filter(
22106
- (signal) => signal !== null && signal !== void 0 && toOptionalNumber(signal.percent) !== null
22121
+ (signal) => signal !== null && signal !== void 0 && signal.aggregateEligible !== false && toOptionalNumber(signal.percent) !== null
22107
22122
  );
22108
22123
  if (numericSignals.length === 0) return null;
22109
22124
  const percent2 = numericSignals.reduce(
@@ -64808,7 +64823,6 @@ var EMPTY_LINE_IDS = [];
64808
64823
  var EMPTY_WORKSPACES = [];
64809
64824
  var ALL_GREEN_CELEBRATION_DURATION_MS = 6e3;
64810
64825
  var ALL_GREEN_MILESTONE_DURATION_MS = 6e3;
64811
- var ALL_GREEN_STREAK_LOCAL_SECOND_CAP = 59;
64812
64826
  var formatAllGreenCelebrationTimer = (elapsedSeconds) => {
64813
64827
  const safeElapsedSeconds = Math.max(1, Math.floor(elapsedSeconds));
64814
64828
  const minutes = Math.floor(safeElapsedSeconds / 60);
@@ -64816,10 +64830,7 @@ var formatAllGreenCelebrationTimer = (elapsedSeconds) => {
64816
64830
  return `${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}s`;
64817
64831
  };
64818
64832
  var getAllGreenBackendVisibleSeconds = (confirmedSeconds, tickOriginAtMs, nowMs2) => {
64819
- const localSecondOffset = Math.min(
64820
- ALL_GREEN_STREAK_LOCAL_SECOND_CAP,
64821
- Math.max(0, Math.floor((nowMs2 - tickOriginAtMs) / 1e3))
64822
- );
64833
+ const localSecondOffset = Math.max(0, Math.floor((nowMs2 - tickOriginAtMs) / 1e3));
64823
64834
  return confirmedSeconds + localSecondOffset;
64824
64835
  };
64825
64836
  var LoadingPageCmp = LoadingPage_default;
@@ -65279,38 +65290,25 @@ function HomeView({
65279
65290
  allGreenStreakDisplay.tickOriginAtMs,
65280
65291
  currentAllGreenStreakNowMs
65281
65292
  );
65282
- const backendMaxVisibleSeconds = confirmedSeconds + ALL_GREEN_STREAK_LOCAL_SECOND_CAP;
65283
65293
  const currentBaseline = allGreenStreakTimerBaselineRef.current;
65284
65294
  if (!currentBaseline || currentBaseline.identity !== allGreenMilestoneIdentity) {
65285
65295
  allGreenStreakTimerBaselineRef.current = {
65286
65296
  identity: allGreenMilestoneIdentity,
65287
65297
  baseSeconds: backendVisibleSeconds,
65288
- baseReceivedAtMs: currentAllGreenStreakNowMs,
65289
- maxVisibleSeconds: backendMaxVisibleSeconds
65298
+ baseReceivedAtMs: currentAllGreenStreakNowMs
65290
65299
  };
65291
65300
  } else {
65292
- currentBaseline.maxVisibleSeconds = Math.max(
65293
- currentBaseline.maxVisibleSeconds,
65294
- backendMaxVisibleSeconds
65295
- );
65296
- const visibleSeconds = Math.min(
65297
- currentBaseline.maxVisibleSeconds,
65298
- currentBaseline.baseSeconds + Math.max(0, Math.floor((currentAllGreenStreakNowMs - currentBaseline.baseReceivedAtMs) / 1e3))
65299
- );
65301
+ const visibleSeconds = currentBaseline.baseSeconds + Math.max(0, Math.floor((currentAllGreenStreakNowMs - currentBaseline.baseReceivedAtMs) / 1e3));
65300
65302
  if (backendVisibleSeconds > visibleSeconds) {
65301
65303
  allGreenStreakTimerBaselineRef.current = {
65302
65304
  identity: allGreenMilestoneIdentity,
65303
65305
  baseSeconds: backendVisibleSeconds,
65304
- baseReceivedAtMs: currentAllGreenStreakNowMs,
65305
- maxVisibleSeconds: currentBaseline.maxVisibleSeconds
65306
+ baseReceivedAtMs: currentAllGreenStreakNowMs
65306
65307
  };
65307
65308
  }
65308
65309
  }
65309
65310
  const baseline = allGreenStreakTimerBaselineRef.current;
65310
- const elapsedSeconds = baseline ? Math.min(
65311
- baseline.maxVisibleSeconds,
65312
- baseline.baseSeconds + Math.max(0, Math.floor((currentAllGreenStreakNowMs - baseline.baseReceivedAtMs) / 1e3))
65313
- ) : backendVisibleSeconds;
65311
+ const elapsedSeconds = baseline ? baseline.baseSeconds + Math.max(0, Math.floor((currentAllGreenStreakNowMs - baseline.baseReceivedAtMs) / 1e3)) : backendVisibleSeconds;
65314
65312
  return {
65315
65313
  ...allGreenStreakDisplay,
65316
65314
  elapsedSeconds,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.12.28",
3
+ "version": "6.12.29",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",