diff --git a/furniture-3d-system/src/app/intake/new-product-management/NewProductManagementDashboard.tsx b/furniture-3d-system/src/app/intake/new-product-management/NewProductManagementDashboard.tsx
index 49bca8b9..19acf1b1 100644
--- a/furniture-3d-system/src/app/intake/new-product-management/NewProductManagementDashboard.tsx
+++ b/furniture-3d-system/src/app/intake/new-product-management/NewProductManagementDashboard.tsx
@@ -25,6 +25,10 @@ import {
OA_BOARD_APPROVAL_STAGE_TIMELINE_METRIC_KEYS,
getOaBoardTimelineMetricOvertimeDays,
} from "@/lib/oa-board-overtime";
+import {
+ summarizeCompletedDepartmentTimings,
+ type CompletedDepartmentTimingSummary,
+} from "@/lib/new-product-department-timing";
import type {
OaBoardDashboardDTO,
OaBoardProjectListItemDTO,
@@ -109,6 +113,7 @@ type TimingDetailRow = {
type TimingOverview = {
completedAverageDays: number;
+ completedDepartments: CompletedDepartmentTimingSummary[];
completedOvertimeCount: number;
completedAssessedCount: number;
completedOnTimeCount: number;
@@ -1342,6 +1347,11 @@ function buildTimingOverview(
.map((row) => row.totalActualDays)
.filter((value): value is number => value !== null),
),
+ completedDepartments:
+ summarizeCompletedDepartmentTimings(
+ completedRows,
+ completedOvertimeRows,
+ ),
completedOvertimeCount: completedOvertimeRows.length,
completedAssessedCount: completedAssessedRows.length,
completedOnTimeCount: completedOnTimeRows.length,
@@ -1879,6 +1889,7 @@ function EfficiencyCard({
benchmark,
note,
tone,
+ departmentItems,
onClick,
}: {
label: string;
@@ -1887,6 +1898,16 @@ function EfficiencyCard({
benchmark: string;
note: string;
tone: "neutral" | "good" | "warning" | "danger";
+ departmentItems?: Array<{
+ label: string;
+ value: string;
+ tooltipTitle: string;
+ tooltipDetail: string;
+ tone: "good" | "danger";
+ previewRows?: Array<{ openingCode: string; productName: string }>;
+ actionLabel?: string;
+ onSelect?: () => void;
+ }>;
onClick?: () => void;
}) {
const toneClass = {
@@ -1918,6 +1939,86 @@ function EfficiencyCard({
{note}
+ {departmentItems?.length ? (
+
+ {departmentItems.map((item, index) => {
+ const tooltipAlignment =
+ index === 0
+ ? "left-0"
+ : index === departmentItems.length - 1
+ ? "right-0"
+ : "left-1/2 -translate-x-1/2";
+ const itemTone =
+ item.tone === "danger"
+ ? "border-[#efd3cf] bg-[#fff8f7] text-[#a84741]"
+ : "border-[#cfe2dd] bg-[#f4faf8] text-[#28705a]";
+ const itemClassName = `group/dept relative flex min-w-0 flex-col items-center rounded border px-1 py-1 outline-none focus-visible:ring-2 focus-visible:ring-[#245f5a]/30 ${item.onSelect ? "cursor-pointer hover:shadow-sm" : ""} ${itemTone}`;
+ const itemContent = (
+ <>
+
+ {item.label}
+
+
+ {item.value}
+
+
+
+ {item.tooltipTitle}
+
+
+ {item.tooltipDetail}
+
+ {item.previewRows?.length ? (
+
+ {item.previewRows.map((row) => (
+
+
+ {row.openingCode}
+
+
+ {row.productName}
+
+
+ ))}
+
+ ) : null}
+ {item.actionLabel ? (
+
+ {item.actionLabel}
+
+ ) : null}
+
+ >
+ );
+ return item.onSelect ? (
+
+ ) : (
+
+ {itemContent}
+
+ );
+ })}
+
+ ) : null}
>
);
const className = `group flex min-h-[104px] flex-col justify-between rounded-lg border border-l-[3px] border-black/[0.08] bg-white px-4 py-3 text-left ${onClick ? "transition hover:bg-[#fbfcfc] hover:shadow-[0_8px_20px_rgba(30,40,46,0.06)]" : ""} ${toneClass}`;
@@ -2046,11 +2147,13 @@ function TimingOvertimeCell({ value }: { value: TimingStageValue }) {
function TimingDetailTable({
mode,
rows,
+ filterLabel,
onClose,
onSelectRow,
}: {
mode: "completed" | "running";
rows: TimingDetailRow[];
+ filterLabel?: string;
onClose: () => void;
onSelectRow: (row: SampleRow) => void;
}) {
@@ -2064,8 +2167,8 @@ function TimingDetailTable({
<>
}
detail={