@optifye/dashboard-core 6.12.7 → 6.12.9

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.
package/dist/index.mjs CHANGED
@@ -4522,11 +4522,12 @@ var fetchLineDummySkuId = async (supabase, lineId, skuTable = "skus") => {
4522
4522
  var fetchLineSkuCatalog = async (supabase, lineId, skuTable = "skus") => {
4523
4523
  if (!supabase || !lineId) return [];
4524
4524
  try {
4525
- const { data } = await supabase.from(skuTable).select("id, sku_id, sku_definition").eq("line_id", lineId).eq("is_active", true);
4525
+ const { data } = await supabase.from(skuTable).select("id, sku_id, display_name, sku_definition").eq("line_id", lineId).eq("is_active", true);
4526
4526
  if (Array.isArray(data)) {
4527
4527
  return data.filter((item) => item && typeof item.id === "string").map((item) => ({
4528
4528
  id: item.id,
4529
4529
  sku_id: typeof item.sku_id === "string" ? item.sku_id : null,
4530
+ display_name: typeof item.display_name === "string" ? item.display_name : null,
4530
4531
  sku_definition: typeof item.sku_definition === "string" ? item.sku_definition : null
4531
4532
  }));
4532
4533
  }
@@ -4547,10 +4548,12 @@ var buildLineSkuBreakdown = (rows, skuCatalog) => {
4547
4548
  if (!skuUuid) return null;
4548
4549
  const meta = catalogById.get(skuUuid);
4549
4550
  const skuCode = meta?.sku_id || skuUuid;
4551
+ const skuDisplayName = meta?.display_name?.trim() || skuCode;
4550
4552
  const isDummy = meta?.sku_definition === "dummy_definition";
4551
4553
  return {
4552
4554
  sku_id: skuUuid,
4553
4555
  sku_code: skuCode,
4556
+ sku_display_name: skuDisplayName,
4554
4557
  is_dummy: isDummy,
4555
4558
  current_output: safeInt(row.current_output),
4556
4559
  ideal_output: safeInt(row.ideal_output),
@@ -13134,6 +13137,7 @@ var normalizeSkuBreakdown = (raw) => {
13134
13137
  return {
13135
13138
  sku_id: typeof item.sku_id === "string" ? item.sku_id : String(item.sku_id ?? ""),
13136
13139
  sku_code: typeof item.sku_code === "string" ? item.sku_code : String(item.sku_code ?? ""),
13140
+ sku_display_name: typeof item.sku_display_name === "string" ? item.sku_display_name : coerceOptionalString(item.sku_display_name),
13137
13141
  sku_definition: typeof item.sku_definition === "string" ? item.sku_definition : String(item.sku_definition ?? ""),
13138
13142
  is_dummy: Boolean(item.is_dummy),
13139
13143
  total_output: coerceNumber(item.total_output, 0),
@@ -13152,6 +13156,7 @@ var normalizeSkuSegment = (raw) => {
13152
13156
  return {
13153
13157
  sku_id: typeof item.sku_id === "string" ? item.sku_id : String(item.sku_id ?? ""),
13154
13158
  sku_code: typeof item.sku_code === "string" ? item.sku_code : String(item.sku_code ?? ""),
13159
+ sku_display_name: typeof item.sku_display_name === "string" ? item.sku_display_name : coerceOptionalString(item.sku_display_name),
13155
13160
  start_time: typeof item.start_time === "string" ? item.start_time : String(item.start_time ?? ""),
13156
13161
  end_time: coerceOptionalString(item.end_time),
13157
13162
  pph_threshold: coerceNumber(item.pph_threshold, 0)
@@ -34427,6 +34432,13 @@ var LineChart = React144__default.memo(LineChartComponent, (prevProps, nextProps
34427
34432
  return true;
34428
34433
  });
34429
34434
  LineChart.displayName = "LineChart";
34435
+
34436
+ // src/lib/utils/skuDisplay.ts
34437
+ var clean = (value) => typeof value === "string" ? value.trim() : "";
34438
+ var getSkuDisplayName = (sku) => {
34439
+ if (!sku) return "SKU";
34440
+ return clean(sku.sku_display_name) || clean(sku.display_name) || clean(sku.sku_code) || clean(sku.sku_id) || clean(sku.id) || "SKU";
34441
+ };
34430
34442
  var formatPercentage = (current, target) => {
34431
34443
  if (!target || target <= 0) return "0.0";
34432
34444
  return (current / target * 100).toFixed(1);
@@ -34503,12 +34515,13 @@ var SkuRow = ({ sku, isSelected, isLive, onSelect }) => {
34503
34515
  const ratio = target > 0 ? Math.min(current / target, 1) : 0;
34504
34516
  const fillColor = "#3b82f6";
34505
34517
  const percentage = formatPercentage(current, target);
34518
+ const skuLabel = getSkuDisplayName(sku);
34506
34519
  return /* @__PURE__ */ jsxs(
34507
34520
  "div",
34508
34521
  {
34509
34522
  className: `space-y-1.5 p-2 rounded-lg cursor-pointer transition-all ${isSelected ? "ring-2 ring-blue-500 ring-dashed bg-blue-50/30" : "hover:bg-gray-50"}`,
34510
34523
  onClick: () => onSelect?.(isSelected ? null : sku.sku_id),
34511
- "data-testid": `sku-progress-row-${sku.sku_code}`,
34524
+ "data-testid": `sku-progress-row-${sku.sku_id}`,
34512
34525
  children: [
34513
34526
  /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [
34514
34527
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 truncate", children: [
@@ -34516,8 +34529,8 @@ var SkuRow = ({ sku, isSelected, isLive, onSelect }) => {
34516
34529
  "span",
34517
34530
  {
34518
34531
  className: "text-sm font-semibold text-gray-800 truncate",
34519
- title: sku.sku_code,
34520
- children: sku.sku_code
34532
+ title: skuLabel,
34533
+ children: skuLabel
34521
34534
  }
34522
34535
  ),
34523
34536
  isLive && /* @__PURE__ */ jsx("div", { className: "w-2 h-2 rounded-full bg-green-500 shrink-0 shadow-[0_0_4px_rgba(34,197,94,0.6)]", title: "Currently running" })
@@ -34536,7 +34549,7 @@ var SkuRow = ({ sku, isSelected, isLive, onSelect }) => {
34536
34549
  "aria-valuenow": Math.round(current),
34537
34550
  "aria-valuemin": 0,
34538
34551
  "aria-valuemax": Math.round(target),
34539
- "aria-label": `${sku.sku_code} output progress`,
34552
+ "aria-label": `${skuLabel} output progress`,
34540
34553
  children: /* @__PURE__ */ jsx(
34541
34554
  "div",
34542
34555
  {
@@ -36507,7 +36520,7 @@ var HourlyOutputChartComponent = ({
36507
36520
  const end = Math.max(start, Math.min(nextOffset, timelineEndOffset));
36508
36521
  return {
36509
36522
  skuId: entry.segment.sku_id,
36510
- label: entry.segment.sku_code,
36523
+ label: getSkuDisplayName(entry.segment),
36511
36524
  start,
36512
36525
  end,
36513
36526
  pphThreshold: entry.segment.pph_threshold ?? pphThreshold
@@ -37383,7 +37396,7 @@ var HourlyOutputChart = React144__default.memo(
37383
37396
  for (let i = 0; i < prevSegments.length; i += 1) {
37384
37397
  const prevSeg = prevSegments[i];
37385
37398
  const nextSeg = nextSegments[i];
37386
- if (prevSeg.sku_id !== nextSeg.sku_id || prevSeg.sku_code !== nextSeg.sku_code || prevSeg.start_time !== nextSeg.start_time || prevSeg.end_time !== nextSeg.end_time) {
37399
+ if (prevSeg.sku_id !== nextSeg.sku_id || prevSeg.sku_code !== nextSeg.sku_code || prevSeg.sku_display_name !== nextSeg.sku_display_name || prevSeg.start_time !== nextSeg.start_time || prevSeg.end_time !== nextSeg.end_time) {
37387
37400
  return false;
37388
37401
  }
37389
37402
  }
@@ -38372,6 +38385,7 @@ var WorkspaceMetricCardsImpl = ({
38372
38385
  const pphThreshold = activeSku ? activeSku.pph_threshold : workspace.pph_threshold;
38373
38386
  const cycleValue = activeSku ? activeSku.avg_cycle_time : workspace.avg_cycle_time;
38374
38387
  const cycleStandard = activeSku ? activeSku.ideal_cycle_time : workspace.ideal_cycle_time;
38388
+ const displaySkuLabel = displaySku ? getSkuDisplayName(displaySku) : "";
38375
38389
  const efficiencyValue = workspace.avg_efficiency || 0;
38376
38390
  const efficiencyTarget = effectiveLegend.green_min;
38377
38391
  const efficiencyColor = getEfficiencyHexColor(efficiencyValue, effectiveLegend);
@@ -38402,7 +38416,7 @@ var WorkspaceMetricCardsImpl = ({
38402
38416
  /* @__PURE__ */ jsxs(Card2, { className: "flex flex-col bg-white shadow-sm h-full min-h-[150px] sm:min-h-0", children: [
38403
38417
  /* @__PURE__ */ jsxs(CardHeader2, { className: "pb-2 flex-none text-center", children: [
38404
38418
  /* @__PURE__ */ jsx(CardTitle2, { className: "text-lg", children: "PPH" }),
38405
- displaySku && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-blue-600 mt-1 truncate px-2", title: displaySku.sku_code, children: displaySku.sku_code })
38419
+ displaySku && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-blue-600 mt-1 truncate px-2", title: displaySkuLabel, children: displaySkuLabel })
38406
38420
  ] }),
38407
38421
  /* @__PURE__ */ jsx(CardContent2, { className: "flex-1 flex items-center justify-center py-6 sm:py-3", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
38408
38422
  /* @__PURE__ */ jsx("p", { className: `text-5xl font-bold ${pphValue >= pphThreshold ? "text-green-500" : "text-red-500"}`, children: pphValue.toFixed(1) }),
@@ -38415,7 +38429,7 @@ var WorkspaceMetricCardsImpl = ({
38415
38429
  /* @__PURE__ */ jsxs(Card2, { className: "flex flex-col bg-white shadow-sm h-full min-h-[150px] sm:min-h-0", children: [
38416
38430
  /* @__PURE__ */ jsxs(CardHeader2, { className: "pb-2 flex-none text-center", children: [
38417
38431
  /* @__PURE__ */ jsx(CardTitle2, { className: "text-lg", children: "Avg. Cycle Time" }),
38418
- displaySku && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-blue-600 mt-1 truncate px-2", title: displaySku.sku_code, children: displaySku.sku_code })
38432
+ displaySku && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-blue-600 mt-1 truncate px-2", title: displaySkuLabel, children: displaySkuLabel })
38419
38433
  ] }),
38420
38434
  /* @__PURE__ */ jsx(CardContent2, { className: "flex-1 flex items-center justify-center py-6 sm:py-3", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
38421
38435
  /* @__PURE__ */ jsx("p", { className: `text-5xl font-bold ${cycleValue > (cycleStandard || 0) ? "text-red-500" : "text-green-500"}`, children: cycleValue.toFixed(1) }),
@@ -51737,7 +51751,7 @@ var LinePdfGenerator = ({
51737
51751
  if (intervalIndex >= 0) {
51738
51752
  if (segmentIndex > 0 || segmentMinutes > hourlyTimeRanges[0]?.start) {
51739
51753
  if (!skuRemarksByIndex[intervalIndex]) skuRemarksByIndex[intervalIndex] = [];
51740
- skuRemarksByIndex[intervalIndex].push(segment.sku_code);
51754
+ skuRemarksByIndex[intervalIndex].push(getSkuDisplayName(segment));
51741
51755
  }
51742
51756
  }
51743
51757
  }
@@ -53751,7 +53765,7 @@ var WorkspacePdfGenerator = ({
53751
53765
  if (intervalIndex >= 0) {
53752
53766
  if (segmentIndex > 0 || segmentMinutes > hourlyIntervals[0]?.start) {
53753
53767
  if (!skuRemarksByIndex[intervalIndex]) skuRemarksByIndex[intervalIndex] = [];
53754
- skuRemarksByIndex[intervalIndex].push(segment.sku_code);
53768
+ skuRemarksByIndex[intervalIndex].push(getSkuDisplayName(segment));
53755
53769
  }
53756
53770
  }
53757
53771
  }
@@ -54416,6 +54430,7 @@ var WorkspaceCycleTimeMetricCards = ({
54416
54430
  }, [activeSku, skuAware, activeSkuId, liveSkuId, skuBreakdown]);
54417
54431
  const cycleValue = activeSku ? activeSku.avg_cycle_time : workspace.avg_cycle_time;
54418
54432
  const cycleStandard = activeSku ? activeSku.ideal_cycle_time : workspace.ideal_cycle_time;
54433
+ const displaySkuLabel = displaySku ? getSkuDisplayName(displaySku) : "";
54419
54434
  const efficiencyValue = workspace.avg_efficiency || 0;
54420
54435
  const efficiencyTarget = effectiveLegend.green_min;
54421
54436
  const efficiencyColor = getEfficiencyHexColor(efficiencyValue, effectiveLegend);
@@ -54443,7 +54458,7 @@ var WorkspaceCycleTimeMetricCards = ({
54443
54458
  /* @__PURE__ */ jsxs(Card2, { className: "flex flex-col bg-white shadow-sm border border-gray-200 h-full min-h-[150px] sm:min-h-0 rounded-xl", children: [
54444
54459
  /* @__PURE__ */ jsxs(CardHeader2, { className: "pb-1 pt-5 flex-none text-center", children: [
54445
54460
  /* @__PURE__ */ jsx(CardTitle2, { className: "text-[15px] font-bold text-gray-900 tracking-wide", children: "Cycle Time (s)" }),
54446
- displaySku && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-blue-600 mt-1 truncate px-2", title: displaySku.sku_code, children: displaySku.sku_code })
54461
+ displaySku && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-blue-600 mt-1 truncate px-2", title: displaySkuLabel, children: displaySkuLabel })
54447
54462
  ] }),
54448
54463
  /* @__PURE__ */ jsxs(CardContent2, { className: "flex-1 flex flex-col items-center justify-center pb-6", children: [
54449
54464
  /* @__PURE__ */ jsx("p", { className: `text-5xl font-bold tracking-tight ${cycleValue > (cycleStandard || 0) ? "text-red-500" : "text-[#34C759]"}`, children: cycleValue.toFixed(1) }),
@@ -66502,6 +66517,7 @@ var MetricCards = memo$1(({
66502
66517
  (prevProps.skuBreakdown || []).map((sku) => ({
66503
66518
  sku_id: sku.sku_id,
66504
66519
  sku_code: sku.sku_code,
66520
+ sku_display_name: sku.sku_display_name,
66505
66521
  total_output: sku.total_output,
66506
66522
  target_output: sku.target_output,
66507
66523
  avg_pph: sku.avg_pph,
@@ -66517,6 +66533,7 @@ var MetricCards = memo$1(({
66517
66533
  (nextProps.skuBreakdown || []).map((sku) => ({
66518
66534
  sku_id: sku.sku_id,
66519
66535
  sku_code: sku.sku_code,
66536
+ sku_display_name: sku.sku_display_name,
66520
66537
  total_output: sku.total_output,
66521
66538
  target_output: sku.target_output,
66522
66539
  avg_pph: sku.avg_pph,
@@ -66826,6 +66843,7 @@ var BottomSection = memo$1(({
66826
66843
  (prevProps.skuSegments || []).map((segment) => ({
66827
66844
  sku_id: segment.sku_id,
66828
66845
  sku_code: segment.sku_code,
66846
+ sku_display_name: segment.sku_display_name,
66829
66847
  start_time: segment.start_time,
66830
66848
  end_time: segment.end_time,
66831
66849
  pph_threshold: segment.pph_threshold
@@ -66835,6 +66853,7 @@ var BottomSection = memo$1(({
66835
66853
  (nextProps.skuSegments || []).map((segment) => ({
66836
66854
  sku_id: segment.sku_id,
66837
66855
  sku_code: segment.sku_code,
66856
+ sku_display_name: segment.sku_display_name,
66838
66857
  start_time: segment.start_time,
66839
66858
  end_time: segment.end_time,
66840
66859
  pph_threshold: segment.pph_threshold
@@ -67515,6 +67534,7 @@ var KPIDetailView = ({
67515
67534
  }).map((item) => ({
67516
67535
  sku_id: item.sku_id,
67517
67536
  sku_code: item.sku_code,
67537
+ sku_display_name: item.sku_display_name,
67518
67538
  sku_definition: "",
67519
67539
  is_dummy: false,
67520
67540
  total_output: item.current_output ?? 0,
@@ -67579,11 +67599,13 @@ var KPIDetailView = ({
67579
67599
  }, [resolvedLineInfo, selectedSkuRow]);
67580
67600
  const handleSkuChange = useCallback((nextSkuId) => {
67581
67601
  if (nextSkuId === selectedSkuId) return;
67602
+ const selectedSkuOption = nextSkuId === "all" ? null : realSkuOptions.find((item) => item.sku_id === nextSkuId) ?? null;
67582
67603
  setSelectedSkuId(nextSkuId);
67583
67604
  trackCoreEvent("Line Detail SKU Filter Changed", {
67584
67605
  line_id: lineId,
67585
67606
  sku_id: nextSkuId === "all" ? null : nextSkuId,
67586
- sku_code: nextSkuId === "all" ? null : realSkuOptions.find((item) => item.sku_id === nextSkuId)?.sku_code ?? null
67607
+ sku_code: selectedSkuOption?.sku_code ?? null,
67608
+ sku_display_name: selectedSkuOption ? getSkuDisplayName(selectedSkuOption) : null
67587
67609
  });
67588
67610
  }, [lineId, realSkuOptions, selectedSkuId]);
67589
67611
  const handleChartSkuSelect = useCallback(
@@ -70441,20 +70463,14 @@ var AnimatedEfficiency = memo$1(({ value }) => {
70441
70463
  });
70442
70464
  AnimatedEfficiency.displayName = "AnimatedEfficiency";
70443
70465
  var getWorkspaceLeaderboardMetricValue = (workspace) => {
70444
- if (workspace.monitoring_mode === "output") {
70445
- return toFiniteNumber(workspace.efficiency);
70446
- }
70447
70466
  if (workspace.leaderboard_metric_kind === "recent_flow_shift_average") {
70448
- return toFiniteNumber(workspace.leaderboard_value);
70467
+ return toFiniteNumber(workspace.leaderboard_value) ?? toFiniteNumber(workspace.avg_recent_flow);
70449
70468
  }
70450
70469
  return toFiniteNumber(workspace.leaderboard_value) ?? toFiniteNumber(workspace.efficiency);
70451
70470
  };
70452
70471
  var getWorkspaceDisplayedMetricValue = (workspace) => getWorkspaceLeaderboardMetricValue(workspace);
70453
- var getWorkspaceLeaderboardMetricLabel = (workspace, defaultLabel) => workspace.monitoring_mode !== "output" && workspace.leaderboard_metric_kind === "recent_flow_shift_average" ? "Avg Flow" : defaultLabel;
70454
- var renderWorkspaceLeaderboardMetric = (workspace, isAssemblyMode) => {
70455
- if (isAssemblyMode) {
70456
- return /* @__PURE__ */ jsx(CycleTimeComparison, { workspace });
70457
- }
70472
+ var getWorkspaceLeaderboardMetricLabel = (workspace, defaultLabel) => workspace.leaderboard_metric_kind === "recent_flow_shift_average" ? "Avg Flow" : defaultLabel;
70473
+ var renderWorkspaceLeaderboardMetric = (workspace) => {
70458
70474
  const displayedMetricValue = getWorkspaceDisplayedMetricValue(workspace);
70459
70475
  if (displayedMetricValue === null) {
70460
70476
  return /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: "--" });
@@ -70511,8 +70527,7 @@ var MobileWorkspaceCard = memo$1(({
70511
70527
  isClickable,
70512
70528
  onWorkspaceClick,
70513
70529
  getMedalIcon,
70514
- metricLabel,
70515
- isAssemblyMode
70530
+ metricLabel
70516
70531
  }) => /* @__PURE__ */ jsx(
70517
70532
  motion.div,
70518
70533
  {
@@ -70539,13 +70554,13 @@ var MobileWorkspaceCard = memo$1(({
70539
70554
  ] })
70540
70555
  ] }),
70541
70556
  /* @__PURE__ */ jsxs("div", { className: "text-right", children: [
70542
- /* @__PURE__ */ jsx("div", { className: "font-bold text-gray-900 text-lg flex justify-end", children: renderWorkspaceLeaderboardMetric(workspace, isAssemblyMode) }),
70557
+ /* @__PURE__ */ jsx("div", { className: "font-bold text-gray-900 text-lg flex justify-end", children: renderWorkspaceLeaderboardMetric(workspace) }),
70543
70558
  /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-500", children: getWorkspaceLeaderboardMetricLabel(workspace, metricLabel) })
70544
70559
  ] })
70545
70560
  ] })
70546
70561
  }
70547
70562
  ), (prevProps, nextProps) => {
70548
- return prevProps.metricLabel === nextProps.metricLabel && prevProps.isAssemblyMode === nextProps.isAssemblyMode && prevProps.rank === nextProps.rank && prevProps.cardClass === nextProps.cardClass && prevProps.isClickable === nextProps.isClickable && prevProps.workspace.workspace_uuid === nextProps.workspace.workspace_uuid && prevProps.workspace.leaderboard_value === nextProps.workspace.leaderboard_value && prevProps.workspace.leaderboard_metric_kind === nextProps.workspace.leaderboard_metric_kind && prevProps.workspace.efficiency === nextProps.workspace.efficiency && prevProps.workspace.ideal_cycle_time === nextProps.workspace.ideal_cycle_time && prevProps.workspace.action_count === nextProps.workspace.action_count && prevProps.workspace.action_threshold === nextProps.workspace.action_threshold && prevProps.workspace.avg_cycle_time === nextProps.workspace.avg_cycle_time && prevProps.workspace.displayName === nextProps.workspace.displayName && prevProps.workspace.lineName === nextProps.workspace.lineName;
70563
+ return prevProps.metricLabel === nextProps.metricLabel && prevProps.rank === nextProps.rank && prevProps.cardClass === nextProps.cardClass && prevProps.isClickable === nextProps.isClickable && prevProps.workspace.workspace_uuid === nextProps.workspace.workspace_uuid && prevProps.workspace.leaderboard_value === nextProps.workspace.leaderboard_value && prevProps.workspace.avg_recent_flow === nextProps.workspace.avg_recent_flow && prevProps.workspace.leaderboard_metric_kind === nextProps.workspace.leaderboard_metric_kind && prevProps.workspace.efficiency === nextProps.workspace.efficiency && prevProps.workspace.ideal_cycle_time === nextProps.workspace.ideal_cycle_time && prevProps.workspace.action_count === nextProps.workspace.action_count && prevProps.workspace.action_threshold === nextProps.workspace.action_threshold && prevProps.workspace.avg_cycle_time === nextProps.workspace.avg_cycle_time && prevProps.workspace.displayName === nextProps.workspace.displayName && prevProps.workspace.lineName === nextProps.workspace.lineName;
70549
70564
  });
70550
70565
  MobileWorkspaceCard.displayName = "MobileWorkspaceCard";
70551
70566
  var DesktopWorkspaceRow = memo$1(({
@@ -70554,8 +70569,7 @@ var DesktopWorkspaceRow = memo$1(({
70554
70569
  rowClass,
70555
70570
  isClickable,
70556
70571
  onWorkspaceClick,
70557
- getMedalIcon,
70558
- isAssemblyMode
70572
+ getMedalIcon
70559
70573
  }) => /* @__PURE__ */ jsxs(
70560
70574
  motion.tr,
70561
70575
  {
@@ -70572,11 +70586,11 @@ var DesktopWorkspaceRow = memo$1(({
70572
70586
  ] }) }),
70573
70587
  /* @__PURE__ */ jsx("td", { className: "px-3 py-2.5 sm:p-4 text-sm sm:text-base whitespace-nowrap", children: /* @__PURE__ */ jsx("div", { className: "font-medium", children: workspace.displayName }) }),
70574
70588
  /* @__PURE__ */ jsx("td", { className: "px-3 py-2.5 sm:p-4 text-sm sm:text-base whitespace-nowrap", children: /* @__PURE__ */ jsx("div", { className: "font-medium", children: workspace.lineName }) }),
70575
- /* @__PURE__ */ jsx("td", { className: `px-3 py-2.5 sm:p-4 text-sm sm:text-base font-medium ${isAssemblyMode ? "" : "whitespace-nowrap"}`, children: isAssemblyMode ? renderWorkspaceLeaderboardMetric(workspace, true) : /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: renderWorkspaceLeaderboardMetric(workspace, false) }) })
70589
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2.5 sm:p-4 text-sm sm:text-base font-medium whitespace-nowrap", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: renderWorkspaceLeaderboardMetric(workspace) }) })
70576
70590
  ]
70577
70591
  }
70578
70592
  ), (prevProps, nextProps) => {
70579
- return prevProps.index === nextProps.index && prevProps.rowClass === nextProps.rowClass && prevProps.isClickable === nextProps.isClickable && prevProps.isAssemblyMode === nextProps.isAssemblyMode && prevProps.workspace.workspace_uuid === nextProps.workspace.workspace_uuid && prevProps.workspace.leaderboard_value === nextProps.workspace.leaderboard_value && prevProps.workspace.leaderboard_metric_kind === nextProps.workspace.leaderboard_metric_kind && prevProps.workspace.efficiency === nextProps.workspace.efficiency && prevProps.workspace.ideal_cycle_time === nextProps.workspace.ideal_cycle_time && prevProps.workspace.avg_cycle_time === nextProps.workspace.avg_cycle_time && prevProps.workspace.displayName === nextProps.workspace.displayName && prevProps.workspace.lineName === nextProps.workspace.lineName;
70593
+ return prevProps.index === nextProps.index && prevProps.rowClass === nextProps.rowClass && prevProps.isClickable === nextProps.isClickable && prevProps.workspace.workspace_uuid === nextProps.workspace.workspace_uuid && prevProps.workspace.leaderboard_value === nextProps.workspace.leaderboard_value && prevProps.workspace.avg_recent_flow === nextProps.workspace.avg_recent_flow && prevProps.workspace.leaderboard_metric_kind === nextProps.workspace.leaderboard_metric_kind && prevProps.workspace.efficiency === nextProps.workspace.efficiency && prevProps.workspace.ideal_cycle_time === nextProps.workspace.ideal_cycle_time && prevProps.workspace.avg_cycle_time === nextProps.workspace.avg_cycle_time && prevProps.workspace.displayName === nextProps.workspace.displayName && prevProps.workspace.lineName === nextProps.workspace.lineName;
70580
70594
  });
70581
70595
  DesktopWorkspaceRow.displayName = "DesktopWorkspaceRow";
70582
70596
  var LeaderboardDetailView = memo$1(({
@@ -71352,14 +71366,6 @@ var LeaderboardDetailView = memo$1(({
71352
71366
  filtered = filtered.filter((ws) => ws.shift_id?.toString() === selectedShiftFilter);
71353
71367
  }
71354
71368
  return filtered.sort((a, b) => {
71355
- if (isAssemblyMode) {
71356
- const ratioA = getCycleRatio(a);
71357
- const ratioB = getCycleRatio(b);
71358
- if (ratioA === null && ratioB === null) return 0;
71359
- if (ratioA === null) return 1;
71360
- if (ratioB === null) return -1;
71361
- return sortAscending ? ratioA - ratioB : ratioB - ratioA;
71362
- }
71363
71369
  const metricA = getWorkspaceLeaderboardMetricValue(a);
71364
71370
  const metricB = getWorkspaceLeaderboardMetricValue(b);
71365
71371
  if (metricA === null && metricB === null) return 0;
@@ -71429,7 +71435,13 @@ var LeaderboardDetailView = memo$1(({
71429
71435
  error.message
71430
71436
  ] }) });
71431
71437
  }
71432
- const metricLabel = viewType === "machine" ? "Utilization" : isAssemblyMode ? "Cycle Time" : "Efficiency";
71438
+ const hasRecentFlowLeaderboardRows = sortedWorkspaces.some(
71439
+ (workspace) => workspace.leaderboard_metric_kind === "recent_flow_shift_average"
71440
+ );
71441
+ const hasEfficiencyLeaderboardRows = sortedWorkspaces.some(
71442
+ (workspace) => workspace.leaderboard_metric_kind !== "recent_flow_shift_average"
71443
+ );
71444
+ const metricLabel = viewType === "machine" ? "Utilization" : hasRecentFlowLeaderboardRows && !hasEfficiencyLeaderboardRows ? "Avg Flow" : hasRecentFlowLeaderboardRows && hasEfficiencyLeaderboardRows ? "Performance" : "Efficiency";
71433
71445
  const descendingSortLabel = "Highest to Lowest";
71434
71446
  const ascendingSortLabel = "Lowest to Highest";
71435
71447
  return /* @__PURE__ */ jsxs("div", { className: `min-h-screen bg-slate-50 flex flex-col ${className}`, style: { willChange: "contents" }, children: [
@@ -71693,8 +71705,7 @@ var LeaderboardDetailView = memo$1(({
71693
71705
  isClickable: canOpenWorkspace(ws.line_id),
71694
71706
  onWorkspaceClick: stableHandleWorkspaceClick,
71695
71707
  getMedalIcon: stableGetMedalIcon,
71696
- metricLabel,
71697
- isAssemblyMode
71708
+ metricLabel
71698
71709
  },
71699
71710
  ws.workspace_uuid
71700
71711
  );
@@ -71718,8 +71729,7 @@ var LeaderboardDetailView = memo$1(({
71718
71729
  rowClass,
71719
71730
  isClickable: canOpenWorkspace(ws.line_id),
71720
71731
  onWorkspaceClick: stableHandleWorkspaceClick,
71721
- getMedalIcon: stableGetMedalIcon,
71722
- isAssemblyMode
71732
+ getMedalIcon: stableGetMedalIcon
71723
71733
  },
71724
71734
  ws.workspace_uuid
71725
71735
  );
@@ -73549,6 +73559,7 @@ var SKUSelector = ({
73549
73559
  if (lineId && (sku.line_id ?? "") !== lineId) return false;
73550
73560
  const term = searchTerm.toLowerCase();
73551
73561
  if (term.length === 0) return true;
73562
+ if (getSkuDisplayName(sku).toLowerCase().includes(term)) return true;
73552
73563
  if ((sku.sku_id || "").toLowerCase().includes(term)) return true;
73553
73564
  if ((sku.sku_definition || "").toLowerCase().includes(term)) return true;
73554
73565
  return JSON.stringify(sku.attributes ?? {}).toLowerCase().includes(term);
@@ -73573,7 +73584,7 @@ var SKUSelector = ({
73573
73584
  disabled,
73574
73585
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
73575
73586
  /* @__PURE__ */ jsx("span", { className: selectedSKU ? "text-gray-900" : "text-gray-500", children: selectedSKU ? /* @__PURE__ */ jsxs("div", { children: [
73576
- /* @__PURE__ */ jsx("span", { className: "font-medium", children: selectedSKU.sku_id }),
73587
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: getSkuDisplayName(selectedSKU) }),
73577
73588
  /* @__PURE__ */ jsxs("span", { className: "text-sm text-gray-500 ml-2", children: [
73578
73589
  "(Target: ",
73579
73590
  selectedSKU.production_target,
@@ -73617,7 +73628,7 @@ var SKUSelector = ({
73617
73628
  ${selectedSKU?.id === sku.id ? "bg-blue-50" : ""}
73618
73629
  `,
73619
73630
  children: /* @__PURE__ */ jsxs("div", { children: [
73620
- /* @__PURE__ */ jsx("div", { className: "font-medium", children: sku.sku_id }),
73631
+ /* @__PURE__ */ jsx("div", { className: "font-medium", children: getSkuDisplayName(sku) }),
73621
73632
  /* @__PURE__ */ jsxs("div", { className: "text-xs text-gray-500", children: [
73622
73633
  "Target: ",
73623
73634
  sku.production_target,
@@ -73673,44 +73684,50 @@ var SKUList = ({
73673
73684
  return /* @__PURE__ */ jsxs(Fragment, { children: [
73674
73685
  /* @__PURE__ */ jsx("div", { className: "hidden lg:block bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "min-w-full divide-y divide-gray-200", children: [
73675
73686
  /* @__PURE__ */ jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxs("tr", { children: [
73676
- /* @__PURE__ */ jsx("th", { scope: "col", className: "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider", children: "SKU Code" }),
73687
+ /* @__PURE__ */ jsx("th", { scope: "col", className: "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider", children: "SKU" }),
73677
73688
  /* @__PURE__ */ jsx("th", { scope: "col", className: "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider", children: "Definition" }),
73678
73689
  /* @__PURE__ */ jsx("th", { scope: "col", className: "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider", children: "Line" }),
73679
73690
  /* @__PURE__ */ jsx("th", { scope: "col", className: "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider", children: "Production Target" }),
73680
73691
  /* @__PURE__ */ jsx("th", { scope: "col", className: "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider", children: "Status" }),
73681
73692
  /* @__PURE__ */ jsx("th", { scope: "col", className: "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider", children: "Created" })
73682
73693
  ] }) }),
73683
- /* @__PURE__ */ jsx("tbody", { className: "bg-white divide-y divide-gray-200", children: skus.map((sku) => /* @__PURE__ */ jsxs("tr", { className: "hover:bg-gray-50 transition-colors duration-150", children: [
73684
- /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-gray-900", children: sku.sku_id }) }),
73685
- /* @__PURE__ */ jsx("td", { className: "px-6 py-4", children: /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-700 max-w-md truncate", title: sku.sku_definition || "", children: sku.sku_definition || /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: "\u2014" }) }) }),
73686
- /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-700", children: formatLine(sku, lineNames) }) }),
73687
- /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-gray-700", children: formatTarget(sku.production_target) }) }),
73688
- /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx("span", { className: `inline-flex px-2 py-1 text-xs font-semibold rounded-full ${sku.is_active ? "bg-green-100 text-green-800" : "bg-gray-100 text-gray-800"}`, children: sku.is_active ? "Active" : "Inactive" }) }),
73689
- /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap text-sm text-gray-500", children: formatCreatedAt(sku.created_at) })
73690
- ] }, sku.id)) })
73694
+ /* @__PURE__ */ jsx("tbody", { className: "bg-white divide-y divide-gray-200", children: skus.map((sku) => {
73695
+ const displayName = getSkuDisplayName(sku);
73696
+ return /* @__PURE__ */ jsxs("tr", { className: "hover:bg-gray-50 transition-colors duration-150", children: [
73697
+ /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-gray-900", children: displayName }) }),
73698
+ /* @__PURE__ */ jsx("td", { className: "px-6 py-4", children: /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-700 max-w-md truncate", title: sku.sku_definition || "", children: sku.sku_definition || /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: "\u2014" }) }) }),
73699
+ /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-700", children: formatLine(sku, lineNames) }) }),
73700
+ /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-gray-700", children: formatTarget(sku.production_target) }) }),
73701
+ /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx("span", { className: `inline-flex px-2 py-1 text-xs font-semibold rounded-full ${sku.is_active ? "bg-green-100 text-green-800" : "bg-gray-100 text-gray-800"}`, children: sku.is_active ? "Active" : "Inactive" }) }),
73702
+ /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap text-sm text-gray-500", children: formatCreatedAt(sku.created_at) })
73703
+ ] }, sku.id);
73704
+ }) })
73691
73705
  ] }) }) }),
73692
- /* @__PURE__ */ jsx("div", { className: "lg:hidden space-y-3 sm:space-y-4", children: skus.map((sku) => /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-xl shadow-sm border border-gray-200 p-4 hover:shadow-md transition-all duration-200", children: [
73693
- /* @__PURE__ */ jsx("div", { className: "flex items-start justify-between mb-3", children: /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
73694
- /* @__PURE__ */ jsx("h3", { className: "text-base sm:text-lg font-semibold text-gray-900 truncate", children: sku.sku_id }),
73695
- /* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx("span", { className: `inline-flex px-2 py-1 text-xs font-semibold rounded-full ${sku.is_active ? "bg-green-100 text-green-800" : "bg-gray-100 text-gray-800"}`, children: sku.is_active ? "Active" : "Inactive" }) })
73696
- ] }) }),
73697
- /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
73698
- /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-gray-500 uppercase tracking-wider mb-1", children: "Definition" }),
73699
- /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-700 break-words", children: sku.sku_definition || /* @__PURE__ */ jsx("span", { className: "text-gray-400 italic", children: "\u2014" }) })
73700
- ] }),
73701
- /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
73702
- /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-gray-500 uppercase tracking-wider mb-1", children: "Line" }),
73703
- /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-700", children: formatLine(sku, lineNames) })
73704
- ] }),
73705
- /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
73706
- /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-gray-500 uppercase tracking-wider mb-1", children: "Production Target" }),
73707
- /* @__PURE__ */ jsx("div", { className: "text-sm sm:text-base font-medium text-gray-700", children: formatTarget(sku.production_target) })
73708
- ] }),
73709
- /* @__PURE__ */ jsxs("div", { className: "text-xs text-gray-500", children: [
73710
- "Created: ",
73711
- formatCreatedAt(sku.created_at)
73712
- ] })
73713
- ] }, sku.id)) })
73706
+ /* @__PURE__ */ jsx("div", { className: "lg:hidden space-y-3 sm:space-y-4", children: skus.map((sku) => {
73707
+ const displayName = getSkuDisplayName(sku);
73708
+ return /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-xl shadow-sm border border-gray-200 p-4 hover:shadow-md transition-all duration-200", children: [
73709
+ /* @__PURE__ */ jsx("div", { className: "flex items-start justify-between mb-3", children: /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
73710
+ /* @__PURE__ */ jsx("h3", { className: "text-base sm:text-lg font-semibold text-gray-900 truncate", children: displayName }),
73711
+ /* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx("span", { className: `inline-flex px-2 py-1 text-xs font-semibold rounded-full ${sku.is_active ? "bg-green-100 text-green-800" : "bg-gray-100 text-gray-800"}`, children: sku.is_active ? "Active" : "Inactive" }) })
73712
+ ] }) }),
73713
+ /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
73714
+ /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-gray-500 uppercase tracking-wider mb-1", children: "Definition" }),
73715
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-700 break-words", children: sku.sku_definition || /* @__PURE__ */ jsx("span", { className: "text-gray-400 italic", children: "\u2014" }) })
73716
+ ] }),
73717
+ /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
73718
+ /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-gray-500 uppercase tracking-wider mb-1", children: "Line" }),
73719
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-700", children: formatLine(sku, lineNames) })
73720
+ ] }),
73721
+ /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
73722
+ /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-gray-500 uppercase tracking-wider mb-1", children: "Production Target" }),
73723
+ /* @__PURE__ */ jsx("div", { className: "text-sm sm:text-base font-medium text-gray-700", children: formatTarget(sku.production_target) })
73724
+ ] }),
73725
+ /* @__PURE__ */ jsxs("div", { className: "text-xs text-gray-500", children: [
73726
+ "Created: ",
73727
+ formatCreatedAt(sku.created_at)
73728
+ ] })
73729
+ ] }, sku.id);
73730
+ }) })
73714
73731
  ] });
73715
73732
  };
73716
73733
  var TargetsViewUI = ({
@@ -73941,7 +73958,7 @@ var TargetsViewUI = ({
73941
73958
  className: "w-full sm:w-auto rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-sm shadow-sm focus:border-blue-500 focus:ring-blue-500 transition-all duration-200 hover:border-gray-400",
73942
73959
  "aria-label": `SKU for ${formattedName}`,
73943
73960
  children: realSkuOptions.map((row) => /* @__PURE__ */ jsxs("option", { value: row.sku_uuid, children: [
73944
- row.sku_code,
73961
+ getSkuDisplayName(row),
73945
73962
  workspace.currentSku && !workspace.currentSku.is_dummy && workspace.currentSku.sku_uuid === row.sku_uuid ? " (active)" : ""
73946
73963
  ] }, row.sku_uuid))
73947
73964
  }
@@ -74208,8 +74225,14 @@ var TargetsView = ({
74208
74225
  const skuMetaByUuid = useMemo(() => {
74209
74226
  const map = /* @__PURE__ */ new Map();
74210
74227
  skuCatalog.forEach((sku) => {
74228
+ const skuCode = sku.sku_id || sku.id;
74211
74229
  map.set(sku.id, {
74212
- sku_code: sku.sku_id || sku.id,
74230
+ sku_code: skuCode,
74231
+ sku_display_name: getSkuDisplayName({
74232
+ display_name: sku.display_name,
74233
+ sku_code: skuCode,
74234
+ id: sku.id
74235
+ }),
74213
74236
  is_dummy: sku.sku_definition === "dummy_definition",
74214
74237
  line_id: sku.line_id
74215
74238
  });
@@ -74221,11 +74244,20 @@ var TargetsView = ({
74221
74244
  skuCatalog.forEach((sku) => {
74222
74245
  if (sku.sku_definition === "dummy_definition") return;
74223
74246
  const list = map.get(sku.line_id) || [];
74224
- list.push({ sku_uuid: sku.id, sku_code: sku.sku_id || sku.id });
74247
+ const skuCode = sku.sku_id || sku.id;
74248
+ list.push({
74249
+ sku_uuid: sku.id,
74250
+ sku_code: skuCode,
74251
+ sku_display_name: getSkuDisplayName({
74252
+ display_name: sku.display_name,
74253
+ sku_code: skuCode,
74254
+ id: sku.id
74255
+ })
74256
+ });
74225
74257
  map.set(sku.line_id, list);
74226
74258
  });
74227
74259
  map.forEach((list) => list.sort(
74228
- (a, b) => a.sku_code.localeCompare(b.sku_code, void 0, { numeric: true })
74260
+ (a, b) => a.sku_display_name.localeCompare(b.sku_display_name, void 0, { numeric: true })
74229
74261
  ));
74230
74262
  return map;
74231
74263
  }, [skuCatalog]);
@@ -74373,8 +74405,9 @@ var TargetsView = ({
74373
74405
  const meta = skuMetaByUuid.get(skuUuid);
74374
74406
  skuRowsMap.set(skuUuid, {
74375
74407
  sku_uuid: skuUuid,
74376
- sku_code: meta?.sku_code || skuUuid,
74377
- is_dummy: meta?.is_dummy ?? false,
74408
+ sku_code: payload?.sku_code || meta?.sku_code || skuUuid,
74409
+ sku_display_name: payload?.sku_display_name || meta?.sku_display_name || payload?.sku_code || meta?.sku_code || skuUuid,
74410
+ is_dummy: payload?.is_dummy ?? meta?.is_dummy ?? false,
74378
74411
  pph_threshold: payload?.pph_threshold ? Math.round(payload.pph_threshold) : "",
74379
74412
  ideal_cycle_time: payload?.ideal_cycle_time ?? "",
74380
74413
  total_day_output: payload?.total_day_output ?? "",
@@ -74427,10 +74460,11 @@ var TargetsView = ({
74427
74460
  const lineDummySkuUuidFallback = dummySkuByLine.get(lineId) || null;
74428
74461
  const buildEmptySkuRows = () => {
74429
74462
  const rows = [];
74430
- lineNonDummySkusFallback.forEach(({ sku_uuid, sku_code }) => {
74463
+ lineNonDummySkusFallback.forEach(({ sku_uuid, sku_code, sku_display_name }) => {
74431
74464
  rows.push({
74432
74465
  sku_uuid,
74433
74466
  sku_code,
74467
+ sku_display_name,
74434
74468
  is_dummy: false,
74435
74469
  pph_threshold: "",
74436
74470
  ideal_cycle_time: "",
@@ -74443,6 +74477,7 @@ var TargetsView = ({
74443
74477
  rows.push({
74444
74478
  sku_uuid: lineDummySkuUuidFallback,
74445
74479
  sku_code: meta?.sku_code || lineDummySkuUuidFallback,
74480
+ sku_display_name: meta?.sku_display_name || meta?.sku_code || lineDummySkuUuidFallback,
74446
74481
  is_dummy: true,
74447
74482
  pph_threshold: "",
74448
74483
  ideal_cycle_time: "",
@@ -74769,6 +74804,7 @@ var TargetsView = ({
74769
74804
  rowsToSave = fallback ? [{
74770
74805
  sku_uuid: fallback.sku_uuid,
74771
74806
  sku_code: "",
74807
+ sku_display_name: "",
74772
74808
  is_dummy: true,
74773
74809
  pph_threshold: fallback.pph_threshold,
74774
74810
  ideal_cycle_time: fallback.ideal_cycle_time,
@@ -76836,7 +76872,7 @@ var SKUManagementView = () => {
76836
76872
  if (activeFilter === "inactive" && sku.is_active) return false;
76837
76873
  if (lineFilter !== "all" && sku.line_id !== lineFilter) return false;
76838
76874
  if (term.length === 0) return true;
76839
- return (sku.sku_id || "").toLowerCase().includes(term);
76875
+ return getSkuDisplayName(sku).toLowerCase().includes(term) || (sku.sku_id || "").toLowerCase().includes(term);
76840
76876
  });
76841
76877
  }, [skus, searchTerm, lineFilter, activeFilter]);
76842
76878
  const handleBack = () => {
@@ -76876,9 +76912,9 @@ var SKUManagementView = () => {
76876
76912
  type: "search",
76877
76913
  value: searchTerm,
76878
76914
  onChange: (event) => setSearchTerm(event.target.value),
76879
- placeholder: "Search by SKU code",
76915
+ placeholder: "Search by SKU",
76880
76916
  className: "w-full pl-9 pr-3 py-2 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
76881
- "aria-label": "Search SKUs by code"
76917
+ "aria-label": "Search SKUs"
76882
76918
  }
76883
76919
  )
76884
76920
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.12.7",
3
+ "version": "6.12.9",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",