← Zurück zu Entwickler interner Systeme
Entdecke, wie der Skill hilft
Zugängliches Umordnen
Ermöglicht verlässliches Umordnen und Baumverschieben durch gültige Ziele, abbrechbares Ziehen und gleichwertige Tastaturaktionen.
drag-and-drop-reordering
Teammitglieder mit diesem Skill
Wann ist der Skill hilfreich?
Nutze ihn beim Organisieren von Blöcken, Lektionen oder verschachtelten Einträgen, wenn Ziehen allein nicht genügt.
Wobei hilft er dir?
- Prüft Ablageziele und verhindert ungültige Baumverschachtelung.
- Ergänzt Ziehen durch Tastaturbewegung und Abbruch.
- Meldet Verschiebungen und koordiniert automatisches Scrollen mit Fokus.
Das könntest du fragen
Ordne verschachtelte Lektionen durch Ziehen und ein Tastaturmenü um. Verschiebe eine Lektion zwischen Modulen und versuche ein Modul in sich selbst abzulegen. Fokus bleibt erhalten, Position wird angesagt, ungültige Verschachtelung abgelehnt.
Ausführliche Dokumentation
Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.
Weniger anzeigen
Drag-and-Drop & Reordering
Use this skill when building sortable block lists, nested tree reordering, column/layout builders, or palette-to-canvas drag-and-drop interactions.
Core Interaction & Tree Validation Rules
- Validate Drop Targets Against the Document Schema:
- Before showing a positive drop indicator or committing a move, verify:
- Cycle Prevention: A parent container can never be dropped inside itself or any of its own descendants.
- Allowed Parent-Child Types: Check whether the target container permits the dragged block type and whether maximum nesting depth would be exceeded.
- Clear Drop Zones: Distinguish
before,after, andinside(reparenting/indenting) drop zones visually using horizontal/vertical pointer displacement and clear indicator lines.
- Before showing a positive drop indicator or committing a move, verify:
- Smooth Auto-Scroll, Touch & Cancellation:
- Auto-Scrolling: Automatically scroll the nearest scrollable editor container (and window if needed) when the pointer approaches top/bottom/side edges during a drag.
- Clean Cancellation: Pressing
Escape, losing window focus (blur), or releasing over an invalid drop zone must abort the drag cleanly and restore the exact pre-drag layout without pushing an entry to the undo stack. - Touch & Pointer Activation Constraints: Require a small distance threshold (e.g.,
4–8 px) or long-press delay (150–200 mson touch) or dedicated drag handle so normal text selection, clicking, and mobile scrolling are never hijacked by accidental drags.
- Commit as a Single Atomic Transaction:
- Keep visual drag previews in ephemeral UI state during pointer movement and dispatch a single document move/reparent command on
drop.
- Keep visual drag previews in ephemeral UI state during pointer movement and dispatch a single document move/reparent command on
Mandatory Keyboard & Accessible Alternatives
Pointer drag-and-drop must never be the only way to reorder or move blocks:
- Provide explicit keyboard reordering shortcuts (e.g.,
Alt/Opt + ArrowUp/ArrowDownorCmd/Ctrl + Shift + ArrowUp/ArrowDownto move blocks up/down,Tab/Shift+Tabor indent/outdent commands to change nesting level). - Or provide an accessible block action menu ("Move up", "Move down", "Move into…") plus keyboard sensor support (
Space/Enterto pick up, arrow keys to move,Space/Enterto drop,Escapeto cancel). - Announce drag start, current target position, drop completion, and cancellation via
aria-livepolite announcements.
Checklist
- Does drop validation block ancestor-into-descendant cycles and disallowed parent-child block types?
- Do edge auto-scrolling,
Escapecancellation, and touch/click activation thresholds work reliably? - Does dropping commit a single atomic transaction to the document model and undo history?
- Is there a complete keyboard and screen-reader alternative for every drag-and-drop reordering operation?
Enthaltene Dateien 1
SKILL.md
