refactor(web): extract drag position helpers

This commit is contained in:
2026-04-01 11:18:31 +02:00
parent 3fe3a5fb2a
commit 5402189158
5 changed files with 250 additions and 56 deletions
+23
View File
@@ -292,6 +292,21 @@ export const rules = [
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineDragPosition.ts",
maxLines: 80,
required: [
{
pattern: /\bexport function resolveProjectDragPosition\b/,
message: "timeline drag position helpers must keep project drag date derivation centralized",
},
{
pattern: /\bexport function resolveAllocationDragPosition\b/,
message: "timeline drag position helpers must keep allocation drag date derivation centralized",
},
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineDocumentDrag.ts",
maxLines: 50,
@@ -383,6 +398,10 @@ export const rules = [
pattern: /from "\.\/timelineDragCleanup\.js"/,
message: "timeline drag must keep unmount teardown delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelineDragPosition\.js"/,
message: "timeline drag must keep project and allocation drag position derivation delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelineDocumentDrag\.js"/,
message: "timeline drag must keep document mouse listener lifecycle delegated to the extracted helper module",
@@ -433,6 +452,10 @@ export const rules = [
pattern: /\bfunction attachDocumentMouseDrag\b/,
message: "timeline drag must not re-inline extracted document listener helper implementations",
},
{
pattern: /\bconst (?:deltaX|pointerDeltaX) = clientX - (?:drag|alloc)\.startMouseX;[\s\S]*computeDragDates\(/,
message: "timeline drag must not re-inline extracted project or allocation drag position helpers",
},
{
pattern: /\bfunction (?:isAllocationMultiSelected|startAllocationMultiDrag|updateAllocationMultiDrag|finalizeAllocationMultiDrag)\b/,
message: "timeline drag must not re-inline extracted allocation multi-drag helper implementations",