refactor(web): extract preview target setup

This commit is contained in:
2026-04-01 11:59:10 +02:00
parent 2a7769a0de
commit e103174d39
5 changed files with 245 additions and 41 deletions
+31
View File
@@ -255,6 +255,25 @@ export const rules = [
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelinePreviewSession.ts",
maxLines: 80,
required: [
{
pattern: /\bexport function createProjectPreviewSession\b/,
message: "timeline preview session helpers must keep project preview target resolution centralized",
},
{
pattern: /\bexport function createAllocationPreviewSession\b/,
message: "timeline preview session helpers must keep allocation preview target resolution centralized",
},
{
pattern: /from "\.\/timelineLivePreview\.js"/,
message: "timeline preview session helpers must keep target capture delegated to the live preview helper module",
},
],
forbidden: [],
},
{
file: "apps/web/src/hooks/timelineAllocationFinalize.ts",
maxLines: 100,
@@ -492,6 +511,10 @@ export const rules = [
pattern: /from "\.\/timelineOptimisticAllocations\.js"/,
message: "timeline drag must keep optimistic allocation reconciliation delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelinePreviewSession\.js"/,
message: "timeline drag must keep preview target setup delegated to the extracted helper module",
},
{
pattern: /from "\.\/timelineDragCleanup\.js"/,
message: "timeline drag must keep unmount teardown delegated to the extracted helper module",
@@ -594,6 +617,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: /\bdocument\.querySelectorAll<HTMLElement>\([\s\S]*data-timeline-project-id/,
message: "timeline drag must not re-inline extracted project preview target lookup",
},
{
pattern: /\bcurrentTarget\.closest<HTMLElement>\('\[data-timeline-drag-preview~=\"allocation\"\]'\)/,
message: "timeline drag must not re-inline extracted allocation preview target lookup",
},
{
pattern: /\bconst selection = finalizeRangeSelection\(/,
message: "timeline drag must not re-inline extracted range release resolution",