gantt-lib 0.124.2 → 0.126.0

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.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React$1, { ReactNode } from 'react';
2
- import { T as Task$1, R as ResourceTimelineItem, V as ValidationResult, a as TimelineMarker, b as TaskDateChangeMode, c as ResourcePlannerChartProps, d as ResourceTimelineResource } from './index-DD3YvhvA.mjs';
3
- export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, G as GanttChartMode, f as GanttDateRange, g as GridConfig, h as GridLine, L as LinkType, M as MonthSpan, i as ResourceTableColumnId, j as ResourceTableColumnWidthMap, k as ResourceTimelineMove, l as ResourceTimelineResourceMenuCommand, m as TaskBarGeometry, W as WeekendBlock, n as alignToWorkingDay, o as areTasksHierarchicallyRelated, p as buildAdjacencyList, q as buildTaskRangeFromEnd, r as buildTaskRangeFromStart, s as calculateSuccessorDate, t as cascadeByLinks, u as clampTaskRangeForIncomingFS, v as computeCriticalPath, w as computeLagFromDates, x as computeParentDates, y as computeParentProgress, z as detectCycles, A as extendCriticalIdsToParents, E as findParentId, F as getAllDependencyEdges, H as getAllDescendants, I as getBusinessDayOffset, J as getChildren, K as getDependencyLag, N as getSuccessorChain, O as getTaskDuration, P as getTransitiveCascadeChain, Q as isAncestorTask, S as isTaskParent, U as moveTaskRange, X as moveTaskWithCascade, Y as normalizeDependencyLag, Z as normalizePredecessorDates, _ as normalizeTaskDependencyLags, $ as normalizeUTCDate, a0 as parseDateOnly, a1 as recalculateIncomingLags, a2 as recalculateProjectSchedule, a3 as recalculateTaskFromDependencies, a4 as reflowTasksOnModeSwitch, a5 as removeDependenciesBetweenTasks, a6 as resizeTaskWithCascade, a7 as shiftBusinessDayOffset, a8 as universalCascade, a9 as validateDependencies } from './index-DD3YvhvA.mjs';
2
+ import { T as Task$1, R as ResourceTimelineItem, V as ValidationResult, a as TimelineMarker, b as TaskDateChangeMode, c as ResourcePlannerChartProps, d as ResourceTimelineResource } from './index-B1yy4LX0.mjs';
3
+ export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, G as GanttChartMode, f as GanttDateRange, g as GridConfig, h as GridLine, L as LinkType, M as MonthSpan, i as ResourceTableColumnId, j as ResourceTableColumnWidthMap, k as ResourceTimelineMove, l as ResourceTimelineResourceMenuCommand, m as TaskBarGeometry, W as WeekendBlock, n as alignToWorkingDay, o as areTasksHierarchicallyRelated, p as buildAdjacencyList, q as buildTaskRangeFromEnd, r as buildTaskRangeFromStart, s as calculateSuccessorDate, t as cascadeByLinks, u as clampTaskRangeForIncomingFS, v as computeCriticalPath, w as computeLagFromDates, x as computeParentDates, y as computeParentProgress, z as detectCycles, A as extendCriticalIdsToParents, E as findParentId, F as getAllDependencyEdges, H as getAllDescendants, I as getBusinessDayOffset, J as getChildren, K as getDependencyLag, N as getSuccessorChain, O as getTaskDuration, P as getTransitiveCascadeChain, Q as isAncestorTask, S as isTaskParent, U as moveTaskRange, X as moveTaskWithCascade, Y as normalizeDependencyLag, Z as normalizePredecessorDates, _ as normalizeTaskDependencyLags, $ as normalizeUTCDate, a0 as parseDateOnly, a1 as recalculateIncomingLags, a2 as recalculateProjectSchedule, a3 as recalculateTaskFromDependencies, a4 as reflowTasksOnModeSwitch, a5 as removeDependenciesBetweenTasks, a6 as resizeTaskWithCascade, a7 as shiftBusinessDayOffset, a8 as universalCascade, a9 as validateDependencies } from './index-B1yy4LX0.mjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RadixPopover from '@radix-ui/react-popover';
6
6
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React$1, { ReactNode } from 'react';
2
- import { T as Task$1, R as ResourceTimelineItem, V as ValidationResult, a as TimelineMarker, b as TaskDateChangeMode, c as ResourcePlannerChartProps, d as ResourceTimelineResource } from './index-DD3YvhvA.js';
3
- export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, G as GanttChartMode, f as GanttDateRange, g as GridConfig, h as GridLine, L as LinkType, M as MonthSpan, i as ResourceTableColumnId, j as ResourceTableColumnWidthMap, k as ResourceTimelineMove, l as ResourceTimelineResourceMenuCommand, m as TaskBarGeometry, W as WeekendBlock, n as alignToWorkingDay, o as areTasksHierarchicallyRelated, p as buildAdjacencyList, q as buildTaskRangeFromEnd, r as buildTaskRangeFromStart, s as calculateSuccessorDate, t as cascadeByLinks, u as clampTaskRangeForIncomingFS, v as computeCriticalPath, w as computeLagFromDates, x as computeParentDates, y as computeParentProgress, z as detectCycles, A as extendCriticalIdsToParents, E as findParentId, F as getAllDependencyEdges, H as getAllDescendants, I as getBusinessDayOffset, J as getChildren, K as getDependencyLag, N as getSuccessorChain, O as getTaskDuration, P as getTransitiveCascadeChain, Q as isAncestorTask, S as isTaskParent, U as moveTaskRange, X as moveTaskWithCascade, Y as normalizeDependencyLag, Z as normalizePredecessorDates, _ as normalizeTaskDependencyLags, $ as normalizeUTCDate, a0 as parseDateOnly, a1 as recalculateIncomingLags, a2 as recalculateProjectSchedule, a3 as recalculateTaskFromDependencies, a4 as reflowTasksOnModeSwitch, a5 as removeDependenciesBetweenTasks, a6 as resizeTaskWithCascade, a7 as shiftBusinessDayOffset, a8 as universalCascade, a9 as validateDependencies } from './index-DD3YvhvA.js';
2
+ import { T as Task$1, R as ResourceTimelineItem, V as ValidationResult, a as TimelineMarker, b as TaskDateChangeMode, c as ResourcePlannerChartProps, d as ResourceTimelineResource } from './index-B1yy4LX0.js';
3
+ export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, G as GanttChartMode, f as GanttDateRange, g as GridConfig, h as GridLine, L as LinkType, M as MonthSpan, i as ResourceTableColumnId, j as ResourceTableColumnWidthMap, k as ResourceTimelineMove, l as ResourceTimelineResourceMenuCommand, m as TaskBarGeometry, W as WeekendBlock, n as alignToWorkingDay, o as areTasksHierarchicallyRelated, p as buildAdjacencyList, q as buildTaskRangeFromEnd, r as buildTaskRangeFromStart, s as calculateSuccessorDate, t as cascadeByLinks, u as clampTaskRangeForIncomingFS, v as computeCriticalPath, w as computeLagFromDates, x as computeParentDates, y as computeParentProgress, z as detectCycles, A as extendCriticalIdsToParents, E as findParentId, F as getAllDependencyEdges, H as getAllDescendants, I as getBusinessDayOffset, J as getChildren, K as getDependencyLag, N as getSuccessorChain, O as getTaskDuration, P as getTransitiveCascadeChain, Q as isAncestorTask, S as isTaskParent, U as moveTaskRange, X as moveTaskWithCascade, Y as normalizeDependencyLag, Z as normalizePredecessorDates, _ as normalizeTaskDependencyLags, $ as normalizeUTCDate, a0 as parseDateOnly, a1 as recalculateIncomingLags, a2 as recalculateProjectSchedule, a3 as recalculateTaskFromDependencies, a4 as reflowTasksOnModeSwitch, a5 as removeDependenciesBetweenTasks, a6 as resizeTaskWithCascade, a7 as shiftBusinessDayOffset, a8 as universalCascade, a9 as validateDependencies } from './index-B1yy4LX0.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RadixPopover from '@radix-ui/react-popover';
6
6
 
package/dist/index.js CHANGED
@@ -588,8 +588,7 @@ function subtractBusinessDays2(endDate, businessDays, weekendPredicate) {
588
588
  // src/core/scheduling/dependencies.ts
589
589
  function normalizePredecessorDates(predecessor, parseDateFn) {
590
590
  const predStart = parseDateFn(predecessor.startDate);
591
- const isMilestone = predecessor.type === "milestone";
592
- const predEnd = isMilestone ? new Date(predStart.getTime() - DAY_MS) : parseDateFn(predecessor.endDate);
591
+ const predEnd = predecessor.type === "milestone" ? predStart : parseDateFn(predecessor.endDate);
593
592
  return { predStart, predEnd };
594
593
  }
595
594
  function getDependencyLag(dep) {
@@ -598,7 +597,7 @@ function getDependencyLag(dep) {
598
597
  function normalizeTaskDependencyLags(task) {
599
598
  return task;
600
599
  }
601
- function normalizeDependencyLag(linkType, lag, predecessorStart, predecessorEnd, businessDays = false, weekendPredicate) {
600
+ function normalizeDependencyLag(linkType, lag, predecessorStart, predecessorEnd, businessDays = false, weekendPredicate, successorType) {
602
601
  if (linkType !== "FS") {
603
602
  return lag;
604
603
  }
@@ -608,9 +607,10 @@ function normalizeDependencyLag(linkType, lag, predecessorStart, predecessorEnd,
608
607
  businessDays,
609
608
  weekendPredicate
610
609
  );
611
- return Math.max(-predecessorDuration, lag);
610
+ const minimumLag = successorType === "milestone" ? -Math.max(0, predecessorDuration - 1) : -predecessorDuration;
611
+ return Math.max(minimumLag, lag);
612
612
  }
613
- function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, businessDays = false, weekendPredicate) {
613
+ function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, businessDays = false, weekendPredicate, successorType) {
614
614
  const pS = Date.UTC(predStart.getUTCFullYear(), predStart.getUTCMonth(), predStart.getUTCDate());
615
615
  const pE = Date.UTC(predEnd.getUTCFullYear(), predEnd.getUTCMonth(), predEnd.getUTCDate());
616
616
  const sS = Date.UTC(succStart.getUTCFullYear(), succStart.getUTCMonth(), succStart.getUTCDate());
@@ -620,11 +620,12 @@ function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, b
620
620
  case "FS":
621
621
  return normalizeDependencyLag(
622
622
  linkType,
623
- Math.round((sS - pE) / DAY_MS) - 1,
623
+ Math.round((sS - pE) / DAY_MS) - (successorType === "milestone" ? 0 : 1),
624
624
  predStart,
625
625
  predEnd,
626
626
  businessDays,
627
- weekendPredicate
627
+ weekendPredicate,
628
+ successorType
628
629
  );
629
630
  case "SS":
630
631
  return Math.round((sS - pS) / DAY_MS);
@@ -641,11 +642,12 @@ function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, b
641
642
  case "FS":
642
643
  return normalizeDependencyLag(
643
644
  linkType,
644
- businessOffset - 1,
645
+ businessOffset - (successorType === "milestone" ? 0 : 1),
645
646
  predStart,
646
647
  predEnd,
647
648
  businessDays,
648
- weekendPredicate
649
+ weekendPredicate,
650
+ successorType
649
651
  );
650
652
  case "SS":
651
653
  return businessOffset;
@@ -655,19 +657,20 @@ function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, b
655
657
  return businessOffset + 1;
656
658
  }
657
659
  }
658
- function calculateSuccessorDate(predecessorStart, predecessorEnd, linkType, lag = 0, businessDays = false, weekendPredicate) {
660
+ function calculateSuccessorDate(predecessorStart, predecessorEnd, linkType, lag = 0, businessDays = false, weekendPredicate, successorType) {
659
661
  const normalizedLag = normalizeDependencyLag(
660
662
  linkType,
661
663
  lag,
662
664
  predecessorStart,
663
665
  predecessorEnd,
664
666
  businessDays,
665
- weekendPredicate
667
+ weekendPredicate,
668
+ successorType
666
669
  );
667
670
  if (!businessDays || !weekendPredicate) {
668
671
  switch (linkType) {
669
672
  case "FS":
670
- return new Date(predecessorEnd.getTime() + (normalizedLag + 1) * DAY_MS);
673
+ return new Date(predecessorEnd.getTime() + (normalizedLag + (successorType === "milestone" ? 0 : 1)) * DAY_MS);
671
674
  case "SS":
672
675
  return new Date(predecessorStart.getTime() + normalizedLag * DAY_MS);
673
676
  case "FF":
@@ -680,7 +683,7 @@ function calculateSuccessorDate(predecessorStart, predecessorEnd, linkType, lag
680
683
  let offset;
681
684
  switch (linkType) {
682
685
  case "FS":
683
- offset = normalizedLag + 1;
686
+ offset = normalizedLag + (successorType === "milestone" ? 0 : 1);
684
687
  break;
685
688
  case "SS":
686
689
  offset = normalizedLag;
@@ -912,7 +915,8 @@ function clampTaskRangeForIncomingFS(task, proposedStart, proposedEnd, allTasks,
912
915
  "FS",
913
916
  -predecessorDuration,
914
917
  businessDays,
915
- weekendPredicate
918
+ weekendPredicate,
919
+ task.type
916
920
  );
917
921
  if (!minAllowedStart || candidateMinStart.getTime() > minAllowedStart.getTime()) {
918
922
  minAllowedStart = candidateMinStart;
@@ -946,7 +950,8 @@ function recalculateIncomingLags(task, newStartDate, newEndDate, allTasks, busin
946
950
  newStartDate,
947
951
  newEndDate,
948
952
  businessDays,
949
- weekendPredicate
953
+ weekendPredicate,
954
+ task.type
950
955
  );
951
956
  return { ...dep, lag: nextLag };
952
957
  });
@@ -1061,7 +1066,10 @@ function cascadeByLinks(movedTaskId, newStart, newEnd, allTasks, skipChildCascad
1061
1066
  normalizedPredStart,
1062
1067
  normalizedPredEnd,
1063
1068
  dep.type,
1064
- getDependencyLag(dep)
1069
+ getDependencyLag(dep),
1070
+ false,
1071
+ void 0,
1072
+ task.type
1065
1073
  );
1066
1074
  let newSuccStart;
1067
1075
  let newSuccEnd;
@@ -1223,7 +1231,8 @@ function universalCascade(movedTask, newStart, newEnd, allTasks, businessDays =
1223
1231
  dep.type,
1224
1232
  getDependencyLag(dep),
1225
1233
  businessDays,
1226
- weekendPredicate
1234
+ weekendPredicate,
1235
+ task.type
1227
1236
  );
1228
1237
  let succNewStart;
1229
1238
  let succNewEnd;
@@ -1523,7 +1532,8 @@ function recalculateTaskFromDependencies(taskId, snapshot, options) {
1523
1532
  dep.type,
1524
1533
  getDependencyLag(dep),
1525
1534
  businessDays,
1526
- weekendPredicate
1535
+ weekendPredicate,
1536
+ task.type
1527
1537
  );
1528
1538
  const duration = getTaskDuration(
1529
1539
  parseDateOnly(task.startDate),
@@ -1639,7 +1649,8 @@ function recalculateProjectSchedule(snapshot, options) {
1639
1649
  dep.type,
1640
1650
  getDependencyLag(dep),
1641
1651
  businessDays,
1642
- weekendPredicate
1652
+ weekendPredicate,
1653
+ currentTask.type
1643
1654
  );
1644
1655
  const candidateRange = dep.type === "FS" || dep.type === "SS" ? buildTaskRangeFromStart(constraintDate, duration, businessDays, weekendPredicate) : buildTaskRangeFromEnd(constraintDate, duration, businessDays, weekendPredicate);
1645
1656
  if (!constrainedRange || candidateRange.start.getTime() > constrainedRange.start.getTime() || candidateRange.start.getTime() === constrainedRange.start.getTime() && candidateRange.end.getTime() > constrainedRange.end.getTime()) {
@@ -3177,7 +3188,8 @@ var TaskRow = import_react3.default.memo(
3177
3188
  }
3178
3189
  return calculateTaskBar(baselineStartDate, baselineEndDate, monthStart, dayWidth);
3179
3190
  }, [baselineStartDate, baselineEndDate, milestone, monthStart, dayWidth]);
3180
- const barColor = isExpired ? "var(--gantt-expired-color)" : task.color || "var(--gantt-task-bar-default-color)";
3191
+ const criticalBarColor = "var(--gantt-critical-path-color, #dc2626)";
3192
+ const barColor = isExpired ? "var(--gantt-expired-color)" : isCritical ? criticalBarColor : task.color || "var(--gantt-task-bar-default-color)";
3181
3193
  const progressWidth = (0, import_react3.useMemo)(() => {
3182
3194
  if (task.progress === void 0 || task.progress <= 0) return 0;
3183
3195
  return Math.min(100, Math.max(0, Math.round(task.progress)));
@@ -3186,21 +3198,31 @@ var TaskRow = import_react3.default.memo(
3186
3198
  if (isExpired) {
3187
3199
  return "color-mix(in srgb, var(--gantt-expired-color) 40%, black)";
3188
3200
  }
3201
+ if (isCritical) {
3202
+ return `color-mix(in srgb, ${criticalBarColor} 40%, black)`;
3203
+ }
3189
3204
  if (progressWidth === 100) {
3190
3205
  return task.accepted ? "var(--gantt-progress-accepted, #22c55e)" : "var(--gantt-progress-completed, #fbbf24)";
3191
3206
  }
3192
3207
  const baseColor = task.color || "var(--gantt-task-bar-default-color)";
3193
3208
  return `color-mix(in srgb, ${baseColor} 40%, black)`;
3194
- }, [isExpired, progressWidth, task.accepted, task.color]);
3209
+ }, [isCritical, isExpired, progressWidth, task.accepted, task.color]);
3195
3210
  const externalTaskNameColor = (0, import_react3.useMemo)(() => {
3196
3211
  if (isExpired) {
3197
3212
  return "color-mix(in srgb, var(--gantt-expired-color) 40%, black)";
3198
3213
  }
3199
3214
  const baseColor = isParent ? task.color || defaultParentBarColor : task.color || "var(--gantt-task-bar-default-color)";
3200
3215
  return `color-mix(in srgb, ${baseColor} 40%, black)`;
3201
- }, [defaultParentBarColor, isExpired, isParent, task.color]);
3216
+ }, [defaultParentBarColor, isCritical, isExpired, isParent, task.color]);
3202
3217
  const barStyle = (0, import_react3.useMemo)(() => {
3203
3218
  const parentBarColor = task.color || defaultParentBarColor;
3219
+ if (isCritical && !isExpired) {
3220
+ const c = criticalBarColor;
3221
+ if (isParent) {
3222
+ return { backgroundColor: c, "--gantt-parent-bar-color": c };
3223
+ }
3224
+ return { backgroundColor: c };
3225
+ }
3204
3226
  if (isParent) {
3205
3227
  if (progressWidth >= 100) {
3206
3228
  const c = isExpired ? "color-mix(in srgb, var(--gantt-expired-color) 40%, black)" : `color-mix(in srgb, ${parentBarColor} 40%, black)`;
@@ -3212,7 +3234,7 @@ var TaskRow = import_react3.default.memo(
3212
3234
  return { backgroundColor: progressColor };
3213
3235
  }
3214
3236
  return { backgroundColor: barColor };
3215
- }, [defaultParentBarColor, isExpired, isParent, progressWidth, barColor, progressColor, task.color]);
3237
+ }, [isCritical, defaultParentBarColor, isExpired, isParent, progressWidth, barColor, progressColor, task.color]);
3216
3238
  const handleDragEnd = (result) => {
3217
3239
  const updatedTask = {
3218
3240
  ...normalizedTask,
@@ -3791,6 +3813,7 @@ var DependencyLines = import_react7.default.memo(({
3791
3813
  for (const task of allTasks) {
3792
3814
  if (positions.has(task.id)) continue;
3793
3815
  if (collapsedParentIds.size > 0 && isTaskHidden(task.id, collapsedParentIds, taskMap)) continue;
3816
+ if (rowIndexByTaskId && !rowIndexByTaskId.has(task.id)) continue;
3794
3817
  hidden.add(task.id);
3795
3818
  const override = dragOverrides?.get(task.id);
3796
3819
  const computed = resolveTaskHorizontalGeometry(task, monthStart, dayWidth, override);
@@ -5206,7 +5229,8 @@ var DepChip = ({
5206
5229
  predStart,
5207
5230
  predEnd,
5208
5231
  businessDays,
5209
- weekendPredicate
5232
+ weekendPredicate,
5233
+ task.type
5210
5234
  );
5211
5235
  const constraintDate = calculateSuccessorDate(
5212
5236
  predStart,
@@ -5214,7 +5238,8 @@ var DepChip = ({
5214
5238
  dep.type,
5215
5239
  normalizedLag,
5216
5240
  businessDays,
5217
- weekendPredicate
5241
+ weekendPredicate,
5242
+ task.type
5218
5243
  );
5219
5244
  let newStart, newEnd;
5220
5245
  if (dep.type === "FS" || dep.type === "SS") {
@@ -8042,14 +8067,15 @@ var TaskList = ({
8042
8067
  const predecessor = tasks.find((t) => t.id === predecessorTaskId);
8043
8068
  if (predecessor) {
8044
8069
  const predStart = new Date(predecessor.startDate);
8045
- const predEnd = new Date(predecessor.endDate);
8070
+ const predEnd = predecessor.type === "milestone" ? predStart : new Date(predecessor.endDate);
8046
8071
  const constraintDate = calculateSuccessorDate(
8047
8072
  predStart,
8048
8073
  predEnd,
8049
8074
  linkType,
8050
8075
  0,
8051
8076
  businessDays ?? true,
8052
- weekendPredicate
8077
+ weekendPredicate,
8078
+ updatedTask.type
8053
8079
  );
8054
8080
  const origSuccessor = tasks.find((t) => t.id === successorTaskId);
8055
8081
  const duration = getTaskDuration(
@@ -12849,11 +12875,12 @@ function TaskGanttChartInner(props, ref) {
12849
12875
  }
12850
12876
  const constraintDate = calculateSuccessorDate(
12851
12877
  parseUTCDate(predecessor.startDate),
12852
- parseUTCDate(predecessor.endDate),
12878
+ predecessor.type === "milestone" ? parseUTCDate(predecessor.startDate) : parseUTCDate(predecessor.endDate),
12853
12879
  nextDependency.type,
12854
12880
  0,
12855
12881
  businessDays,
12856
- isCustomWeekend
12882
+ isCustomWeekend,
12883
+ successor.type
12857
12884
  );
12858
12885
  const duration = getTaskDuration(
12859
12886
  updatedSuccessor.startDate,
@@ -13010,13 +13037,18 @@ function TaskGanttChartInner(props, ref) {
13010
13037
  if (filterMode === "hide") {
13011
13038
  return /* @__PURE__ */ new Set();
13012
13039
  }
13013
- if ((!highlightedTaskIds || highlightedTaskIds.size === 0) && matchedTaskIds.size === 0) {
13040
+ const criticalHighlightMode = criticalPathMode === "highlight";
13041
+ const hasExternalHighlights = !!highlightedTaskIds && highlightedTaskIds.size > 0;
13042
+ if (!hasExternalHighlights && matchedTaskIds.size === 0 && !criticalHighlightMode) {
13014
13043
  return /* @__PURE__ */ new Set();
13015
13044
  }
13016
13045
  const mergedHighlightedTaskIds = new Set(highlightedTaskIds ?? []);
13017
13046
  matchedTaskIds.forEach((taskId) => mergedHighlightedTaskIds.add(taskId));
13047
+ if (criticalHighlightMode) {
13048
+ criticalTaskIds.forEach((taskId) => mergedHighlightedTaskIds.add(taskId));
13049
+ }
13018
13050
  return mergedHighlightedTaskIds;
13019
- }, [filterMode, highlightedTaskIds, matchedTaskIds]);
13051
+ }, [filterMode, highlightedTaskIds, matchedTaskIds, criticalPathMode, criticalTaskIds]);
13020
13052
  const totalGridHeight = (0, import_react18.useMemo)(
13021
13053
  () => visibleTasks.length * effectiveRowHeight,
13022
13054
  [effectiveRowHeight, visibleTasks.length]
@@ -14011,7 +14043,7 @@ function TaskGanttChartInner(props, ref) {
14011
14043
  onCascade: handleCascade,
14012
14044
  highlightExpiredTasks,
14013
14045
  showBaseline,
14014
- isFilterMatch: filterMode === "highlight" ? matchedTaskIds.has(task.id) : false,
14046
+ isFilterMatch: (filterMode === "highlight" ? matchedTaskIds.has(task.id) : false) || (criticalPathMode === "highlight" ? criticalTaskIds.has(task.id) : false),
14015
14047
  isCritical: criticalTaskIds.has(task.id),
14016
14048
  businessDays,
14017
14049
  customDays,