Files
OpsMastery.v5-Client/.github/instructions/state-and-dnd.md
2026-07-12 20:27:42 -04:00

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 position updates.
  • 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.