I am batman
This commit is contained in:
15
.github/instructions/state-and-dnd.md
vendored
Normal file
15
.github/instructions/state-and-dnd.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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.
|
||||
Reference in New Issue
Block a user