feat(playlists): sort + group-by-channel with reusable undo/redo
Add a sort toolbar to the Playlists page: Title A-Z/Z-A, shortest/longest first, and a 'group by channel' toggle that groups items by channel (A-Z) and applies the chosen sort within each group. Applying a sort reorders the items and persists via the existing reorder API. The item order is now an undoable value: drag, sort and grouping all go through it, so every change is reversible via undo/redo buttons and Ctrl/Cmd+Z / Ctrl+Y (Ctrl+Shift+Z). Built on two reusable pieces, not playlist-specific: - useUndoable<T> — a generic past/present/future snapshot hook (set/undo/redo/reset + canUndo/canRedo), ref-backed so callbacks are stable and never see a stale snapshot; onApply runs the side effect (here: persist order). - UndoToolbar — undo/redo buttons + keyboard shortcuts, plain props so any undo source can use it. Undo history is reset only when the item set actually changes (different playlist or add/remove), so a refetch confirming our own reorder doesn't wipe it; membership changes (remove) clear history since they aren't reorder-undoable. Trilingual.
This commit is contained in:
parent
1ddeac57cd
commit
40c0cbfc5a
9 changed files with 325 additions and 12 deletions
|
|
@ -6,6 +6,8 @@
|
|||
"confirm": "Bestätigen",
|
||||
"confirmTitle": "Bist du sicher?",
|
||||
"save": "Speichern",
|
||||
"undo": "Rückgängig",
|
||||
"redo": "Wiederholen",
|
||||
"loading": "Wird geladen…",
|
||||
"language": "Sprache",
|
||||
"somethingWrong": "Etwas ist schiefgelaufen.",
|
||||
|
|
|
|||
|
|
@ -34,5 +34,12 @@
|
|||
"deleteOnYoutubeMsg": "„{{name}}“ auch aus deinem YouTube-Konto löschen? Wähle „Nur hier“, um sie auf YouTube zu behalten.",
|
||||
"deleteOnYoutubeConfirm": "Auf YouTube löschen",
|
||||
"deleteHereOnly": "Nur hier",
|
||||
"deleteYtFailed": "Löschen auf YouTube fehlgeschlagen; nur hier entfernt."
|
||||
"deleteYtFailed": "Löschen auf YouTube fehlgeschlagen; nur hier entfernt.",
|
||||
"sortLabel": "Sortierung",
|
||||
"sortManual": "Eigene Reihenfolge",
|
||||
"sortTitleAsc": "Titel A–Z",
|
||||
"sortTitleDesc": "Titel Z–A",
|
||||
"sortDurAsc": "Kürzeste zuerst",
|
||||
"sortDurDesc": "Längste zuerst",
|
||||
"groupByChannel": "Nach Kanal gruppieren"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
"confirm": "Confirm",
|
||||
"confirmTitle": "Are you sure?",
|
||||
"save": "Save",
|
||||
"undo": "Undo",
|
||||
"redo": "Redo",
|
||||
"loading": "Loading…",
|
||||
"language": "Language",
|
||||
"somethingWrong": "Something went wrong.",
|
||||
|
|
|
|||
|
|
@ -34,5 +34,12 @@
|
|||
"deleteOnYoutubeMsg": "Also delete “{{name}}” from your YouTube account? Choose “Here only” to keep it on YouTube.",
|
||||
"deleteOnYoutubeConfirm": "Delete on YouTube",
|
||||
"deleteHereOnly": "Here only",
|
||||
"deleteYtFailed": "Couldn't delete on YouTube; removed here only."
|
||||
"deleteYtFailed": "Couldn't delete on YouTube; removed here only.",
|
||||
"sortLabel": "Sort",
|
||||
"sortManual": "Custom order",
|
||||
"sortTitleAsc": "Title A–Z",
|
||||
"sortTitleDesc": "Title Z–A",
|
||||
"sortDurAsc": "Shortest first",
|
||||
"sortDurDesc": "Longest first",
|
||||
"groupByChannel": "Group by channel"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
"confirm": "Megerősítés",
|
||||
"confirmTitle": "Biztos vagy benne?",
|
||||
"save": "Mentés",
|
||||
"undo": "Visszavonás",
|
||||
"redo": "Újra",
|
||||
"loading": "Betöltés…",
|
||||
"language": "Nyelv",
|
||||
"somethingWrong": "Hiba történt.",
|
||||
|
|
|
|||
|
|
@ -34,5 +34,12 @@
|
|||
"deleteOnYoutubeMsg": "Törlöd a(z) „{{name}}” listát a YouTube-fiókodból is? A „Csak itt” megtartja a YouTube-on.",
|
||||
"deleteOnYoutubeConfirm": "Törlés a YouTube-on",
|
||||
"deleteHereOnly": "Csak itt",
|
||||
"deleteYtFailed": "Nem sikerült törölni a YouTube-on; csak itt lett eltávolítva."
|
||||
"deleteYtFailed": "Nem sikerült törölni a YouTube-on; csak itt lett eltávolítva.",
|
||||
"sortLabel": "Rendezés",
|
||||
"sortManual": "Egyéni sorrend",
|
||||
"sortTitleAsc": "Cím A–Z",
|
||||
"sortTitleDesc": "Cím Z–A",
|
||||
"sortDurAsc": "Legrövidebb elöl",
|
||||
"sortDurDesc": "Leghosszabb elöl",
|
||||
"groupByChannel": "Csoportosítás csatorna szerint"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue