feat/onboarding-help #127
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Slovo_Propovedi/slovo-propovedi-mobile!127
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/onboarding-help"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Онбординг в приложении (#124)
Зачем
В приложении нет обучения пользователей. Добавлена система контекстных обзоров: кнопка «?» в шапке каждого экрана открывает выбор сценария, после которого запускается spotlight-тур — затемнение с «дыркой» вокруг реальных элементов интерфейса и карточками-подсказками.
Что внутри
Кнопка «?» и пикер
headerRightчерезOnboardingHelpRow, отдельные ряды на безшапочных табахscreensу сценария, exact-match)Механика тура
react-native-svg— уже был в зависимостях, новых пакетов нет); карточка шага с «Назад / Далее / Готово», счётчиком и закрытием; Android back завершает турOnboardingTarget, хукuseOnboardingTargetRefи паттернonboardingTargetIdдля переиспользуемых компонентов; замер — мультисемпл 100/500/1200/2500 мс +transitionEnd+onLayout(не ловит середину анимаций и загрузку списков)route(наследование маршрута), навигация черезrouter.navigateбез дублей стека, оверлей скрывается на время переходаtapActionId— трёхкратная имитация тапа → действие → автопереход: открытие меню плеера, выбор «Подробнее», печать запроса «лицемерие» в поиске, нажатие первой проповедиareaTargetIds— затемнение фона с «дырками» и цветной заливкой зон (края перемотки в плеере); зоны остаются живыми для тапаwaitFor: 'sermonSelected' | 'paused') иinteractive-шаги — карточка над живым UI, пользователь выполняет действие самисключаются из колоды (
skipIfMissing) — счётчик «Шаг N из M» показывает реальные числа,последний видимый шаг завершает тур кнопкой «Готово»; задизейбленные, но отрисованные
пункты — подсвечиваются
Автозапуск и настройки
sinceVersion); отметка «видел» пишется до старта, при выключенных турах — не пишетсяtours_disabled/tours_seen_versionдобавлены в резервное копирование (replace + merge)Архитектура
src/features/onboarding/(Reatom-модель, сценарии как данные, оверлей-хост в_RootLayout)@x-мосты между фичами удалены как нарушение правила «@x только между сущностями»: контракт настроек импорта спущен вshared/model/importSettings, экшены плеера инлайнены в виджет, для поиска — dependency inversion (generic wrapper-пропы + регистрация действий на экране)Тесты
298 suites / 2505 тестов (+208 к baseline): модель тура, фильтры сценариев, оверлей (фазы, тапы, ожидания), бэкап round-trip,
useAutoTours,tooltipPosition. lint / types / knip / steiger / depcruise — чисто.Документация
docs/features/onboarding.md— полное описание механик + гайд «как добавить сценарий/цель»docs/screens/*.md,contracts/storage.md,features/player.md,features/settings-backup.md,architecture.md,conventions.md,decisions.mddebt.md— записи закрытыПроверить руками
waitFor-шаги предвыполнены)OnboardingTarget rendered a plain collapsable={false} View with no style, so wrapping flex:1 children (history.rows, offline.rows, study.tabs) collapsed their layout, and wrapping the absolutely-positioned animated MiniPlayer (player.mini) produced a zero-size wrapper that the zero-size guard dropped. - add an optional style passthrough to OnboardingTarget and give the flex targets style={{ flex: 1 }} - extract the shared active-target measurement into useTargetMeasure and add useOnboardingTargetRef, which measures a node via a ref without a wrapper - forward a ref through MiniPlayer and attach the target ref to its root AnimatedPressable, so player.mini is measured with its animated positioning Signed-off-by: egoreast <egor.east@yandex.ru>Android 12+ forbids starting a foreground service from the background (ForegroundServiceStartNotAllowedException). Cold-start restore could reach LockScreenControls full activation while paused/backgrounded, so expo-audio caught and logged the failed FGS start. Gate only the full-activation path on AppState.currentState === 'active' (in-place updateLockScreenMetadata does not start the service): while backgrounded, stash the latest { player, metadata } and lazily register an AppState listener; on the next 'active' transition activate only if the pending player is still the tracked one (clear() invalidates it). Lock-screen controls still appear via the notification fallback until then. Extract the retry/versioning loop into LoadedRetryScheduler to keep LockScreenControls within the file-size limit. Existing suites now pin AppState.currentState = 'active'; new LockScreenControls.test.ts covers immediate activation, deferral-then-foreground, clear() invalidation and the in-place update path. Signed-off-by: egoreast <egor.east@yandex.ru>The «Подробнее» tour now performs the player actions itself instead of describing them as text cards: - features/onboarding/@x/expandable-player.ts + widgets/expandable-player/ @x/onboarding.ts — @x pair exposing register/unregisterTourAction and the usePlayerTourActions({ openMenu, showDetails }) hook. - ui/FullscreenContent/useFullscreenTourActions.ts wires the player's menu and details handlers (details also closes the menu, mirroring a real menu-item tap) into the registry; useFullscreenHandlers invokes it while mounted. - PlayerMenuItems «Подробнее» row is wrapped in OnboardingTarget player-fullscreen.menu-details; DetailsOverlay root — player-fullscreen.details. - player-description scenario reworked to three steps: open the menu, pick «Подробнее», then highlight the details widget with its clickable timecodes. - getCacheActionLabel extracted to widgets/expandable-player/lib to keep PlayerMenuItems within the 130-line limit after the target wrap. - Tests: @x hook registration/unregistration, menu-details rect registration, and the reworked scenario shape. Signed-off-by: egoreast <egor.east@yandex.ru>The «Добавление в плейлист» tour now performs the whole row-menu flow instead of describing it: it taps the first row, opens its dropdown, spotlights each item with an explanation, presses «Добавить в плейлист» and lets the user pick playlists in the modal. Dependency inversion keeps entities free of features/onboarding: - entities/track-list gains MenuActionItem (MenuItem + optional onboardingTargetId, plain data) and two generic props: renderMenuItem (wraps each dropdown row, e.g. in an OnboardingTarget) and bindMenuOpener (hands { open, close } to the owner); a first row's menu is driven without the entity importing the feature; - MenuDropdown renders through an optional renderItem; - pages/playlist sets onboardingTargetId only on the first row's actions (usePlaylistActions), wires the renderer, and registers open-playlist-row-menu / press-row-menu-add via usePlaylistRowMenuTourActions (press mirrors a real tap: close + open the add-to-playlist modal for the first sermon). Signed-off-by: egoreast <egor.east@yandex.ru>1bc153e9dd9be415ac07Action-visualization steps (tapActionId) are no longer tour steps: they attach to the preceding card as its exit transition, play on forward departure (Next/Done) and are excluded from the step counter. Back always returns to the previous card and never replays a visualization. - add lib/tourDeck.ts (buildTourDeck, resolveDeckProgress, deckCardStep, resolveHiddenDeckIndexes, findNearestDeckIndex) and model/derived.ts - rework model/tour.ts to a deck-based state { scenarioId, deckIndex, skippedDeckIndexes } + onboardingExitStepIndexAtom - rework useStepNavigation/useTourTapFlow/useTourActionStep; add useActiveTourStep, useStepRoute, useTourDeckProgress, useTourVisuals - wire the overlay/tap layer to deck entries; counter counts cards only - update docs/features/onboarding.md to the deck model Signed-off-by: egoreast <egor.east@yandex.ru>- Make the row cache item a single toggle card ("Добавить в офлайн" <-> "Удалить из офлайна") and drop the separate row removal card. - Keep the tour on the playlist screen (its tab bar is visible) and blink the "Ещё" tab as an entry transition before navigating to /more. - Drop the /listen return step; the deck is now 5 cards (8 raw steps). - Update the scenario table and test notes in docs/features/onboarding.md. Signed-off-by: egoreast <egor.east@yandex.ru>feat/onboarding-helpto WIP: feat/onboarding-help- Entry transitions never render a card, and OnboardingStep types text/title as optional card content ("they carry neither"), so the share scenario's tab.more and more.share-item entry steps drop their inert texts. - The synthetic returnScenario test resolves the deck via scenariosById[scenario.id] on advance; swap it into the registry in beforeEach/afterEach (same pattern as the entry-transitions describe) instead of relying on the real share deck coincidentally matching. Signed-off-by: egoreast <egor.east@yandex.ru>WIP: feat/onboarding-helpto feat/onboarding-help