# Home and discovery

Home is implemented entirely in `commonMain` and is available on Android, iOS,
desktop and web. New installations start at Home. Existing explicit navigation
orders are preserved; Home is appended when it is missing. Navigation settings
can move or hide it. Compact navigation uses four destinations and a Sections
menu when more than five destinations are enabled.

## Discover and resume

- Featured titles have manual paging, with optional automatic advance every
  seven seconds. Automatic advance is off by default and pauses during scrolling,
  on e-ink displays, and when Compose reports a zero motion-duration scale.
- Continue reading and watching combines manga, anime and novels. It resumes the
  saved chapter or advances from a completed chapter to the next unread entry in
  reader order. Manga pages, video timestamps and novel percentages retain their
  own units. Deleted history references are ignored.
- AniList supplies popular anime, manga and novels, plus recommendations based
  on the most recent title. Recommended for you combines discovery and library
  titles, preferring genres shared with recent activity.
- Optional TMDB trending movie and series shelves use the API Read Access Token
  supplied by the user in Customize Home.
- With TMDB enabled, "Recommended from your TMDB titles" asks TMDB
  (`/3/{movie|tv}/{id}/recommendations`) about up to eight titles tracked with
  the TMDB tracker, most recently updated or watched first. Titles recommended by
  more seeds rank higher; seeds, other TMDB-tracked titles and library titles are
  never suggested. It uses the TMDB tracker's API key, falling back to the Home
  read access token, and is hidden when neither exists or nothing is tracked. One
  failing seed does not hide the shelf. It follows the All/Movie/Series filters,
  can be hidden under visible shelves, and opens cards like the trending shelves.
  Results are cached for six hours per seed set. Upstream Animetail has no
  equivalent shelf.
- Catalog cards find the title across installed sources. Existing matching local
  titles open directly. Source-feed cards open their source-specific title;
  catalog metadata itself does not provide playback or chapter URLs.
- Media filters, actual ratings, provider toggles, visible shelves, shelf size,
  library-only featured titles and completed-title suppression are configurable.
- Up to eight source feeds can combine popular, latest and saved-search listings.
  They can be removed and reordered. Saved searches are checked against the
  current source schema before use. Source engines have the same platform
  capabilities and requirements as Browse.

## Reliability and storage

Local resume data is projected from observed repository snapshots off the UI
thread. Provider requests run independently with at most three active requests;
each request has a 15-second deadline. Leaving Home cancels requests. Late
responses cannot overwrite newer configuration. A failed refresh retains usable
items and shows a shelf-specific recovery action. AniList authorization failures
are reported as network problems; credential recovery applies to TMDB. Home
cleanup waits for cancelled request generations and their finalizers before
profile resources are released.

The profile-owned metadata cache holds at most 32 entries for five minutes (six
hours for TMDB recommendations).
Refresh bypasses the cache. Provider credentials, adult-content settings, source
versions, saved presets and source preferences participate in cache/request
invalidation.

Home configuration is device-local. It is excluded from hub synchronization and
preserved during restore. Portable exports omit its token and installed-source
references. Credentials are also removed from presentation state.

## Existing visual system

Home extends Yokan's existing Material theme: `YokanScaffold`, theme color roles,
the configured app font and Material type hierarchy, shared `CoverImage` and
`EmptyState`, and existing settings tiles and sheet sizing. It introduces no
separate palette, font family or global design tokens. Featured artwork uses a
dark gradient for white text; shelves use the existing rounded cover treatment.
At 840 dp and above, posters widen from 136 dp to 172 dp and the featured panel
grows from 320 dp to 340 dp. These are Home layout choices, not app-wide rules.

## Validation

Common tests cover resume projection, filters, title matching, ratings, provider
failure/timeout/cancellation, source-runtime disposal, cache refresh/expiry,
token export and compact navigation. Desktop Compose render tests cover phone,
tablet, desktop, 150% text, empty/error states and the customization toolbar.
Images are in `composeApp/build/reports/home-ui`: `home-*.png` are
desktop-rendered shared layouts; `native-android-*.png` are Android runtime
captures. Capture existence alone does not establish visual approval.

Final combined verification passed desktop, WasmJs, iOS SimulatorArm64 and
debug Android compilation, plus 142 tests with zero failures, errors or skips.
Android debug assembly and native UI capture passed earlier, before the final
code-only cleanup and provider-error refinements.

The scoped finish review approved shipping for native Android phone, tablet and
1.4× font captures, with supplemental shared Compose layouts and no material
fixes requested. Native iOS runtime and the actual desktop shell have not
received visual verification; no final all-platform UI approval has been
established.

For optional local capture artwork, set `YOKAN_HOME_UI_COVER` and
`YOKAN_HOME_UI_BANNER` to local image paths when running `HomeScreenRenderTest`.
The test also works without artwork and never requires the network.
