fix(a11y): every sortable list speaks the user's language to a screen reader

dnd-kit's screen-reader text is hard-coded English and names an item by its id ("Draggable item
10357 was dropped", a role of "sortable"). Only the YouTube playlist replaced it; the Plex playlist,
the saved-views list and the side-panel groups read it out under a Hungarian UI — found while
checking the Plex playlist's keyboard reorder on localdev.

`ui/sortableA11y` is now the one place: `useSortableA11y` gives a DndContext its instructions and
announcements (HU/EN, `common.dnd.*`), `useSortableItem` announces the role. The YouTube playlist's
own announcements move onto it, which also fixes them: its lists reorder on drop, so reading the
dragged row's own index said "moved to position 1" at every step and "dropped at position 1"
wherever the row went. The place announced is now the slot the row would land in.

A `local/sortable-a11y` lint rule (with its contract test) refuses a DndContext without
`accessibility` and a direct `useSortable`.
This commit is contained in:
2026-09-19 17:37:21 +02:00
parent 946c8f26db
commit 17a26894b0
13 changed files with 273 additions and 57 deletions
+9 -1
View File
@@ -35,5 +35,13 @@
"moreRefine": "még {{count}} — finomíts kereséssel",
"matchMode": "Egyezés",
"removeNamed": "{{name}}: eltávolítás",
"resetNamed": "{{name}}: alaphelyzet"
"resetNamed": "{{name}}: alaphelyzet",
"dnd": {
"instructions": "Szóközzel felveszed az elemet, a nyilakkal mozgatod, újabb szóközzel leteszed, Escape-pel megszakítod.",
"roleDescription": "mozgatható elem",
"pickedUp": "„{{title}}” felvéve, {{pos}}. a(z) {{total}} közül.",
"movedOver": "„{{title}}” a(z) {{pos}}. helyre került a(z) {{total}} közül.",
"dropped": "„{{title}}” letéve a(z) {{pos}}. helyre a(z) {{total}} közül.",
"cancelled": "Mozgatás megszakítva; „{{title}}” visszakerült a(z) {{pos}}. helyre."
}
}
@@ -113,11 +113,6 @@
"confirmDeleteLinked": "Törlöd a(z) „{{name}}” listát? A YouTube-bal szinkronban van — válaszd ki, hogy ott is törlődjön-e. Nem vonható vissza.",
"dragBlockedBuiltin": "Ennek a listának kötött a sorrendje — kézzel nem rendezhető át.",
"deleteBoth": "Törlés itt és a YouTube-on",
"dndInstructions": "Szóközzel felveszed a videót, a nyilakkal mozgatod, újabb szóközzel leteszed, Escape-pel megszakítod.",
"dndPickedUp": "„{{title}}” felvéve, {{pos}}. a(z) {{total}} közül.",
"dndMovedOver": "„{{title}}” a(z) {{pos}}. helyre került a(z) {{total}} közül.",
"dndDropped": "„{{title}}” letéve a(z) {{pos}}. helyre a(z) {{total}} közül.",
"dndCancelled": "Mozgatás megszakítva; „{{title}}” visszakerült a(z) {{pos}}. helyre.",
"viewGrouped": "csatorna szerint csoportosítva",
"viewGroupedAnd": "csatorna szerint csoportosítva, {{sort}}",
"viewDiffers": "Ideiglenes nézet ({{view}}) — a lista mentett sorrendje változatlan. Mentsd, ha ez maradjon.",