From dc3bcf1f1cb0391902ce321c446527c46e5de430 Mon Sep 17 00:00:00 2001 From: jasonMPM Date: Thu, 5 Mar 2026 17:33:27 -0600 Subject: [PATCH] fix: remove redundant top-row heatmaps, keep labeled status rows only --- .../components/Calendar/WorkloadHeatmap.jsx | 157 ++++-------------- 1 file changed, 34 insertions(+), 123 deletions(-) diff --git a/frontend/src/components/Calendar/WorkloadHeatmap.jsx b/frontend/src/components/Calendar/WorkloadHeatmap.jsx index 437f161..1a6f279 100644 --- a/frontend/src/components/Calendar/WorkloadHeatmap.jsx +++ b/frontend/src/components/Calendar/WorkloadHeatmap.jsx @@ -1,5 +1,5 @@ import { useMemo, useState } from 'react' -import { format, startOfWeek, addDays, addWeeks, parseISO, isToday } from 'date-fns' +import { format, startOfWeek, addDays, addWeeks, isToday } from 'date-fns' import useProjectStore from '../../store/useProjectStore' import useFocusStore from '../../store/useFocusStore' @@ -56,7 +56,7 @@ export default function WorkloadHeatmap() { }) ) - const all = projects.flatMap(p => p.deliverables || []) + const all = projects.flatMap(p => p.deliverables || []) const stats = { total: all.length, upcoming: all.filter(d => d.status === 'upcoming').length, @@ -81,7 +81,7 @@ export default function WorkloadHeatmap() { return (
- {/* Header with spacing that clears FABDASH corner logo */} + {/* Header */}

Workload Heatmap

@@ -92,96 +92,7 @@ export default function WorkloadHeatmap() {
- {/* Stat cards + aligned status heatmaps */} -
- {STATUS_KEYS.map((statusKey) => ( -
- {/* Stat card */} -
-

- {stats[statusKey]} -

-

{STATUS_LABEL[statusKey]}

-
- - {/* Heatmap for this status */} -
-
- {/* Day labels */} -
- {DAY_INIT.map((d, i) => ( -
- {d} -
- ))} -
- - {/* Grid */} -
- {/* Month labels */} -
- {monthLabels.map(({ wi, label }) => ( - - {label} - - ))} -
- -
- {weeks.map((week, wi) => ( -
- {week.map(({ date, key, items, statusCounts }) => { - const countForStatus = (statusCounts || {})[statusKey] || 0 - const baseDensity = countForStatus - const hoverRing = - statusKey === 'upcoming' ? 'hover:ring-blue-300/80 hover:shadow-[0_0_0_1px_rgba(147,197,253,0.8)]' : - statusKey === 'in_progress' ? 'hover:ring-amber-300/80 hover:shadow-[0_0_0_1px_rgba(252,211,77,0.8)]' : - statusKey === 'completed' ? 'hover:ring-green-300/80 hover:shadow-[0_0_0_1px_rgba(74,222,128,0.8)]' : - statusKey === 'overdue' ? 'hover:ring-red-400/90 hover:shadow-[0_0_0_1px_rgba(248,113,113,0.9)]' : - 'hover:ring-white/60'; - return ( -
{ - if (!items || !items.length) return - const match = items.find(({ deliverable }) => deliverable.status === statusKey) || items[0] - if (match) openFocus(match.project.id, match.deliverable.id) - }} - onMouseEnter={(e) => { - const filtered = (items || []).filter(({ deliverable }) => deliverable.status === statusKey) - const showItems = filtered.length ? filtered : items || [] - setTooltip({ - x: e.clientX, - y: e.clientY, - date, - statusKey, - items: showItems, - }) - }} - onMouseLeave={() => setTooltip(null)} - /> - ) - })} -
- ))} -
-
-
-
-
- ))} -
- {/* Multi-row heatmaps by status */} + {/* Status heatmaps */}
{STATUS_KEYS.map((statusKey) => (
@@ -270,37 +181,37 @@ export default function WorkloadHeatmap() {
))} - {tooltip && ( -
-

- {isToday(tooltip.date) ? 'Today — ' : ''}{format(tooltip.date, 'EEE, MMM d, yyyy')} -

-

- {STATUS_LABEL[tooltip.statusKey]} · {tooltip.items.length} task{tooltip.items.length !== 1 ? 's' : ''} -

- {tooltip.items.length === 0 ? ( -

No deliverables

- ) : ( -
- {tooltip.items.slice(0, 5).map(({ deliverable, project }) => ( -
-
-
-

{deliverable.title}

-

{project.name}

+ {tooltip && ( +
+

+ {isToday(tooltip.date) ? 'Today — ' : ''}{format(tooltip.date, 'EEE, MMM d, yyyy')} +

+

+ {STATUS_LABEL[tooltip.statusKey]} · {tooltip.items.length} task{tooltip.items.length !== 1 ? 's' : ''} +

+ {tooltip.items.length === 0 ? ( +

No deliverables

+ ) : ( +
+ {tooltip.items.slice(0, 5).map(({ deliverable, project }) => ( +
+
+
+

{deliverable.title}

+

{project.name}

+
-
- ))} - {tooltip.items.length > 5 && ( -

+{tooltip.items.length - 5} more

- )} -
- )} -
- )} + ))} + {tooltip.items.length > 5 && ( +

+{tooltip.items.length - 5} more

+ )} +
+ )} +
+ )}
)