refactor(web): split touch canvas adapters

This commit is contained in:
2026-04-01 11:09:26 +02:00
parent a4789d718b
commit 922394c56a
7 changed files with 114 additions and 58 deletions
+21 -6
View File
@@ -127,10 +127,6 @@ export const rules = [
pattern: /\bexport function getTouchPoint\b/,
message: "timeline touch helpers must keep touch coordinate fallback centralized",
},
{
pattern: /\bexport function createTouchMouseDownEvent\b/,
message: "timeline touch helpers must keep touch-to-mouse adapter wiring centralized",
},
{
pattern: /\bexport function resolveTouchDragDecision\b/,
message: "timeline touch helpers must keep scroll-vs-drag disambiguation centralized",
@@ -138,6 +134,21 @@ export const rules = [
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineTouchAdapters.ts",
maxLines: 60,
required: [
{
pattern: /\bexport function createTouchMouseDownEvent\b/,
message: "timeline touch adapter helpers must keep touch-to-mouse adapter wiring centralized",
},
{
pattern: /\bexport function createTouchCanvasPointerEvent\b/,
message: "timeline touch adapter helpers must keep canvas pointer adapter wiring centralized",
},
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineMultiSelect.ts",
maxLines: 90,
@@ -307,6 +318,10 @@ export const rules = [
pattern: /from "\.\/timelineTouch\.js"/,
message: "timeline drag must keep touch fallback and drag disambiguation delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelineTouchAdapters\.js"/,
message: "timeline drag must keep touch pointer adapter wiring 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",
@@ -354,8 +369,8 @@ export const rules = [
message: "timeline drag must not re-inline touch coordinate fallback helpers",
},
{
pattern: /as unknown as React\.MouseEvent/,
message: "timeline drag must not re-inline synthetic touch mouse-down adapters",
pattern: /as (?:unknown as )?React\.MouseEvent/,
message: "timeline drag must not re-inline synthetic touch pointer adapters",
},
{
pattern: /\bfunction (?:hasAllocationDateChange|shouldTreatAllocationDragAsClick|requiresAllocationFragmentExtraction|buildAllocationMovedSnapshot|reconcileOptimisticEntries)\b/,