[OPTIMIZATION] LogInteraction & AddPersonDrawer - Layout Thrashing Animations #59

Closed
opened 2026-06-06 20:45:21 +00:00 by Mark · 0 comments
Owner

src/pages/LogInteraction.tsx - Critical (1), High (2), Medium (1), Low (1)

Critical:

  1. height: "auto" animation triggers 60 layout passes/sec
    • Fix: Use max-height or CSS transform: scaleY() / clip-path

High:
2. form.personIds.includes() ×5 per person in render loop

  • Fix: Convert to Set + useMemo
  1. people.find() in map() loop for person selection
    • Fix: Pre-build peopleMap

Medium:
4. useEffect with filter/sort on every dep - move to useMemo

Low:
5. FileReader missing onerror handler


src/pages/people/AddPersonDrawer.tsx - Critical (1), High (1)

Critical:

  1. height: "auto" animation (2 locations) - same layout thrashing

High:
2. Object useState({ contact: false, dates: false }) causes full re-render on any field change

  • Fix: Split into separate useState calls
## src/pages/LogInteraction.tsx - Critical (1), High (2), Medium (1), Low (1) **Critical**: 1. `height: "auto"` animation triggers 60 layout passes/sec - Fix: Use `max-height` or CSS `transform: scaleY()` / `clip-path` **High**: 2. `form.personIds.includes()` ×5 per person in render loop - Fix: Convert to `Set` + `useMemo` 3. `people.find()` in `map()` loop for person selection - Fix: Pre-build `peopleMap` **Medium**: 4. `useEffect` with filter/sort on every dep - move to `useMemo` **Low**: 5. `FileReader` missing `onerror` handler --- ## src/pages/people/AddPersonDrawer.tsx - Critical (1), High (1) **Critical**: 1. `height: "auto"` animation (2 locations) - same layout thrashing **High**: 2. Object `useState({ contact: false, dates: false })` causes full re-render on any field change - Fix: Split into separate `useState` calls
Mark closed this issue 2026-06-14 10:04:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/kimi_agent_kin_app_sync#59
No description provided.