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.
16 lines
461 B
JSON
16 lines
461 B
JSON
{
|
|
"privacyPolicy": "Privacy Policy",
|
|
"termsOfService": "Terms of Service",
|
|
"close": "Close",
|
|
"cancel": "Cancel",
|
|
"confirm": "Confirm",
|
|
"confirmTitle": "Are you sure?",
|
|
"save": "Save",
|
|
"undo": "Undo",
|
|
"redo": "Redo",
|
|
"loading": "Loading…",
|
|
"language": "Language",
|
|
"somethingWrong": "Something went wrong.",
|
|
"accessRequestsTitle": "Access requests",
|
|
"accessRequestsMessage": "{{count}} pending — review in Settings → Account."
|
|
}
|