refactor(web): extract range release resolution

This commit is contained in:
2026-04-01 11:53:11 +02:00
parent 1e2bd3d4eb
commit 2a7769a0de
5 changed files with 208 additions and 12 deletions
+31
View File
@@ -225,6 +225,25 @@ export const rules = [
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineRangeRelease.ts",
maxLines: 80,
required: [
{
pattern: /\bexport function resolveRangeSelectionRelease\b/,
message: "timeline range release helpers must keep canvas release resolution centralized",
},
{
pattern: /\bexport function resolveRangeSelectionCancel\b/,
message: "timeline range release helpers must keep canvas leave cancellation centralized",
},
{
pattern: /from "\.\/timelineRangeSelection\.js"/,
message: "timeline range release helpers must keep selection finalization delegated to the range helper module",
},
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineOptimisticAllocations.ts",
maxLines: 80,
@@ -465,6 +484,10 @@ export const rules = [
pattern: /from "\.\/timelineRangeSelection\.js"/,
message: "timeline drag must keep range preview and finalization delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelineRangeRelease\.js"/,
message: "timeline drag must keep range release and cancel delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelineOptimisticAllocations\.js"/,
message: "timeline drag must keep optimistic allocation reconciliation delegated to the extracted helper module",
@@ -571,6 +594,14 @@ export const rules = [
pattern: /\bconst mutationInput = buildProjectShiftMutationInput\(finalDrag\)\b[\s\S]*applyShiftMutation\.(?:mutate|mutateAsync)\(/,
message: "timeline drag must not re-inline extracted project drag finalize flow",
},
{
pattern: /\bconst selection = finalizeRangeSelection\(/,
message: "timeline drag must not re-inline extracted range release resolution",
},
{
pattern: /\bif \(rangeStateRef\.current\.isSelecting\)\s*\{[\s\S]*setRangeState\(INITIAL_RANGE_STATE\);[\s\S]*\}/,
message: "timeline drag must not re-inline extracted range cancel reset flow",
},
],
},
{