test(repo): guard timeline drag helper boundaries

This commit is contained in:
2026-04-01 09:52:23 +02:00
parent 848797b4d2
commit ea4074af8f
2 changed files with 82 additions and 0 deletions
+61
View File
@@ -119,6 +119,51 @@ export const rules = [
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineTouch.ts",
maxLines: 80,
required: [
{
pattern: /\bexport function getTouchPoint\b/,
message: "timeline touch helpers must keep touch coordinate fallback centralized",
},
{
pattern: /\bexport function resolveTouchDragDecision\b/,
message: "timeline touch helpers must keep scroll-vs-drag disambiguation centralized",
},
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineMultiSelect.ts",
maxLines: 90,
required: [
{
pattern: /\bexport function createMultiSelectState\b/,
message: "timeline multi-select helpers must keep selection bootstrap centralized",
},
{
pattern: /\bexport function finalizeMultiSelectDraft\b/,
message: "timeline multi-select helpers must keep minimal-drag reset logic centralized",
},
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineRangeSelection.ts",
maxLines: 90,
required: [
{
pattern: /\bexport function updateRangeSelectionDraft\b/,
message: "timeline range helpers must keep preview date derivation centralized",
},
{
pattern: /\bexport function finalizeRangeSelection\b/,
message: "timeline range helpers must keep ordered range finalization centralized",
},
],
forbidden: [],
},
{
file: "apps/web/src/hooks/useTimelineDrag.ts",
required: [
@@ -126,12 +171,28 @@ export const rules = [
pattern: /from "\.\/timelineLivePreview\.js"/,
message: "timeline drag must keep live preview behavior delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelineTouch\.js"/,
message: "timeline drag must keep touch fallback and drag disambiguation delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelineMultiSelect\.js"/,
message: "timeline drag must keep multi-select rectangle lifecycle delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelineRangeSelection\.js"/,
message: "timeline drag must keep range preview and finalization delegated to the extracted helper module",
},
],
forbidden: [
{
pattern: /\bfunction (?:toPxValue|joinTransforms|captureLivePreviewTargets|renderLivePreview|scheduleLivePreview|clearLivePreview|datesMatch|preserveLivePreview)\b/,
message: "timeline drag must not re-inline live preview helper implementations",
},
{
pattern: /\bfunction toClientX\b/,
message: "timeline drag must not re-inline touch coordinate fallback helpers",
},
],
},
{