738 B
738 B
State and DnD Instructions
Scope
- Applies to stateful feature logic and drag/drop interactions (e.g., Kanban with dnd-kit).
Rules
- Keep business/data mutations in hooks; keep components mostly presentational.
- Persist ordering changes deterministically using explicit
positionupdates. - Avoid nested competing scroll containers when horizontal drag/drop is involved.
- Ensure drag overlays and scroll behavior work for mouse and touch sensors.
- When replacing local persistence with API-backed state, remove stale store dependencies cleanly.
Reliability
- Debounce or batch expensive reorder API calls where appropriate.
- After structural changes (move/delete section), refresh canonical state from API when needed.