feature/43-custom-playlists #121

Merged
EgorEast merged 19 commits from feature/43-custom-playlists into main 2026-10-11 06:33:56 +00:00
Owner

Closes #43.

Кастомные локальные плейлисты

Пользовательские (локальные) плейлисты без авторизации: создание, редактирование,
шеринг по ссылке, импорт из ссылки, поиск, публикация в глобальные.

Домен

  • Действия над myPlaylists: create / rename / delete / reorder / reorder sermons
    (read-modify-write + persist, favorites защищён)
  • sermonIds — авторитетный состав; sermons — кэш-снапшоты подмножества
  • Лимит MAX_CUSTOM_PLAYLIST_SERMONS = 200

Шеринг и импорт

  • Читаемый URL: https://<host>/listen/playlist?custom&title=<enc>&sermons=<id>
    (id упакованы в base64url, ~340 проповедей влезает в бюджет 8k; csv-фоллбэк)
  • Импорт идемпотентен: id плейлиста детерминированно выводится из payload,
    повторное открытие ссылки открывает тот же плейлист
  • Гидрация перед созданием, состояние загрузки вместо «не найден»

UI

  • Создание: плюс-карточка в слайдере и на странице «Мои плейлисты» (кнопка под списком)
  • Редактирование: отдельный экран — переименование + реордер проповедей (ручки),
    кнопка-галочка в шапке; без добавления/удаления проповедей
  • Удаление: меню шапки, экран редактирования, режим редактирования секции
  • Реордер плейлистов в режиме редактирования секции — только за ручки
  • Карточки без обложки: обложка по умолчанию + blur + затемнение по теме + буква;
    при включённом «заголовке на карточке» буква скрывается
  • Публикация в глобальные: меню плейлиста → форма админки с заполненным названием
    и проповедями (видна только админам)

Прочее

  • Поиск: локальные плейлисты участвуют в результатах (по названию)
  • Добавление в плейлист: тап по всей строке чекбокса; при лимите — disabled + подпись
  • Фиксы: рефетч «Слушать» при закрытии поиска; веб-баг закрытия модалки;
    даблтап навигации; скролл «О приложении» над системным навбаром

Известное

  • Холодный старт: карточки без арта могут показать пустую карточку до перезагрузки —
    записано в docs/debt.md

Проверки

yarn lint 0 ошибок · check:types · check:unused 0 · test 198 suites / 1719 ·
check:fsd · check:circular — всё зелёное

Closes #43. ## Кастомные локальные плейлисты Пользовательские (локальные) плейлисты без авторизации: создание, редактирование, шеринг по ссылке, импорт из ссылки, поиск, публикация в глобальные. ### Домен - Действия над `myPlaylists`: create / rename / delete / reorder / reorder sermons (read-modify-write + persist, favorites защищён) - `sermonIds` — авторитетный состав; `sermons` — кэш-снапшоты подмножества - Лимит `MAX_CUSTOM_PLAYLIST_SERMONS = 200` ### Шеринг и импорт - Читаемый URL: `https://<host>/listen/playlist?custom&title=<enc>&sermons=<id>` (id упакованы в base64url, ~340 проповедей влезает в бюджет 8k; csv-фоллбэк) - Импорт идемпотентен: id плейлиста детерминированно выводится из payload, повторное открытие ссылки открывает тот же плейлист - Гидрация перед созданием, состояние загрузки вместо «не найден» ### UI - Создание: плюс-карточка в слайдере и на странице «Мои плейлисты» (кнопка под списком) - Редактирование: отдельный экран — переименование + реордер проповедей (ручки), кнопка-галочка в шапке; без добавления/удаления проповедей - Удаление: меню шапки, экран редактирования, режим редактирования секции - Реордер плейлистов в режиме редактирования секции — только за ручки - Карточки без обложки: обложка по умолчанию + blur + затемнение по теме + буква; при включённом «заголовке на карточке» буква скрывается - Публикация в глобальные: меню плейлиста → форма админки с заполненным названием и проповедями (видна только админам) ### Прочее - Поиск: локальные плейлисты участвуют в результатах (по названию) - Добавление в плейлист: тап по всей строке чекбокса; при лимите — disabled + подпись - Фиксы: рефетч «Слушать» при закрытии поиска; веб-баг закрытия модалки; даблтап навигации; скролл «О приложении» над системным навбаром ### Известное - Холодный старт: карточки без арта могут показать пустую карточку до перезагрузки — записано в `docs/debt.md` ### Проверки `yarn lint` 0 ошибок · `check:types` · `check:unused` 0 · `test` 198 suites / 1719 · `check:fsd` · `check:circular` — всё зелёное
Add create/rename/delete actions, base64url sermon-id packing and the custom
share-link codec, plus local playlist resolution and custom-link import on the
playlist screen.

Signed-off-by: egoreast <egor.east@yandex.ru>
Add the blurred/darkened default-cover letter tile for playlists without
artwork and wire it into the slider, the section list and search rows. Favorites
is no longer pinned above the list — it scrolls with the rest.

Signed-off-by: egoreast <egor.east@yandex.ru>
Add the create/edit local-playlist modals (Enter submits, create button gated
on a non-blank title), the trailing create card in the my-playlists slider and
the header edit button for user-owned playlists.

Signed-off-by: egoreast <egor.east@yandex.ru>
Add a delete item to the playlist header menu and a per-row delete action in
the my-playlists edit mode, both behind one shared confirmation dialog. In edit
mode reordering now starts only from the drag handle (admin-like), not from a
long-press on the row body.

Signed-off-by: egoreast <egor.east@yandex.ru>
Merge locally stored playlists into playlist title matches and render their
letter tile in the results list; guard the result-row navigation against a
double tap.

Signed-off-by: egoreast <egor.east@yandex.ru>
Pre-fill the admin playlist form with a local playlist's title, ids and
sermon snapshots, and parse them back on the create screen.

Signed-off-by: egoreast <egor.east@yandex.ru>
Disable adding a sermon to a playlist that already holds 200 and show the
reason under the row; removal from a full playlist stays enabled. Extend
CheckboxField with disabled and hint support.

Signed-off-by: egoreast <egor.east@yandex.ru>
Skip the initial sections fetch when they were already loaded, so remounting
the slider (e.g. after closing search) does not revalidate the network.

Signed-off-by: egoreast <egor.east@yandex.ru>
Render the backdrop as an absolute-fill sibling instead of the content's
parent, so a press inside the dialog (e.g. focusing a TextInput on
react-native-web) no longer bubbles up and closes the modal.

Signed-off-by: egoreast <egor.east@yandex.ru>
Add a shared in-progress navigation guard and apply it to the playlist detail
pushes, so two rapid taps no longer stack two copies of the screen.

Signed-off-by: egoreast <egor.east@yandex.ru>
Wrap the about content in a scrollable container with bottom safe-area inset
padding, so the copyright is reachable on native and web.

Signed-off-by: egoreast <egor.east@yandex.ru>
Cover the local playlist domain, share/import, search merge, forms, delete and
reorder entry points, the sermon limit and the updated my-playlists layout.

Signed-off-by: egoreast <egor.east@yandex.ru>
Replace the edit modal with a dedicated /listen/playlist-edit screen opened
from the playlist header pencil. The screen renames the playlist and reorders
its sermons via always-visible drag handles (handle-only drag, admin-like),
and moves the delete confirmation there. Add the reorderLocalPlaylistSermons
entity action (permutes sermons snapshots and sermonIds, persists, pins
favorites first) and register the route in the listen stack.

Signed-off-by: egoreast <egor.east@yandex.ru>
togglePlaylistSermon re-derived sermonIds from sermons, so adding a sermon to
an imported id-only playlist ({ sermonIds: ['a','b','c'], sermons: [] })
dropped a,b,c, and removing any member emptied the playlist. Update sermonIds
directly now: append the id with dedupe on add and filter it on remove,
filtering sermons in parallel.

Also stop flashing "playlist not found" while a custom share link imports:
PlaylistScreen renders the loading state while the custom param is present
instead of treating the empty id as not-found.

Signed-off-by: egoreast <egor.east@yandex.ru>
- Search results: derive local playlist matches at render instead of inside the
  fetch effect, so hydrating or toggling myPlaylistsAtom no longer refetches.
- Edit screen: extract a stable usePlaylistEditItemRenderer so the 200-row list
  stops re-rendering on every keystroke.
- Hydrate myPlaylistsAtom before create/delete/rename/reorder when it is still
  unloaded, mirroring the import hook.
- Guard the edit-screen push against double taps via useNavigationGuard.
- Dedupe sermon ids in parseSermonIds so a crafted ?sermons=a,a,b cannot store
  duplicates.
- Update the playlist docs; note the normalizeLocalPlaylist reload gap in debt.

Signed-off-by: egoreast <egor.east@yandex.ru>
Stored sermonIds are now the source of truth when reading myPlaylists:
normalizeLocalPlaylist keeps them (deduped, empty strings dropped) and
treats sermons as a snapshot subset, dropping snapshots whose id is no
longer a member. sermonIds are derived from sermons only for legacy rows
without stored ids. This closes the reload gap where imported id-only
members ({ sermonIds: [a,b,c,d], sermons: [d] }) collapsed to [d] after
restart (docs/debt.md entry removed).

The same invariant is fixed in the two other places that re-derived
sermonIds from sermons: mergePlaylists (backup merge now unions sermonIds
instead of re-deriving them via toCanonical) and reorderLocalPlaylistSermons
(reorders the authoritative sermonIds and keeps id-only members).

Docs updated: contracts/storage.md, features/my-playlists.md,
features/settings-backup.md.

Signed-off-by: egoreast <egor.east@yandex.ru>
Derive a deterministic `custom-<16 hex>` id from a custom share link payload
(title + ordered sermonIds, two FNV-1a passes) so re-opening the same link
finds the already-imported playlist instead of creating a second copy. The
content-based duplicate search is removed; `createLocalPlaylist` accepts an
optional explicit id.

Size the "my playlists" rows like the server section playlist rows
(`ListItemBase` card variant, `LIST_ITEM_CARD_ARTWORK_SIZE`) instead of the
smaller hardcoded surface artwork, and render a mandatory letter-cover tile
for server playlist rows without artwork so their height no longer collapses.

Docs: deep-links, my-playlists, playlist-list.

Signed-off-by: egoreast <egor.east@yandex.ru>
Add a checkmark IconButton to the playlist-edit header via
navigation.setOptions, enabled only while the form has pending changes and
wired to the same save as the bottom bar. The bottom bar stays as a secondary
affordance. Follows the usePlaylistNavigationOptions pattern.

Signed-off-by: egoreast <egor.east@yandex.ru>
fix(playlists): unify no-artwork slider cards and on-card letter
Some checks failed
CI / dco (pull_request) Successful in 5s
CI / checks (pull_request) Has been cancelled
e7d28c9a17
Server section cards without artwork now render the shared blurred letter
tile (PlaylistLetterAvatar) instead of a plain placeholder, matching local
custom playlist cards. The letter is hidden when the title sits on the card
so it never overlaps the title.

My-playlists cards stop passing the letter as artworkIcon and go through the
same no-artwork fallback, so the title-location setting applies uniformly and
the letter drops out under an on-card title.

Signed-off-by: egoreast <egor.east@yandex.ru>
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Slovo_Propovedi/slovo-propovedi-mobile!121
No description provided.