# Source-provided related entries

Source-related browsing is implemented with the platform and bridge limitations
documented below. Related entries are separate from tracker recommendations and
watch-order discovery.

Open a remote title’s overflow menu → **Related entries**. The shared screen keeps
the source’s relation labels and order, opens a result through that same source,
and offers reload/retry. Loading, unsupported, empty and error states are distinct.
Failed refreshes retain usable results; opening an existing saved title preserves
its favourites, notes, credits and progress. Browsing does not add titles to the
library. Only a selected entry is cached, using the normal source-title path.
Requests belong to the screen’s ViewModel and cancel when it is cleared. A removed
source or rebound parent title cannot receive a late response or create an entry.
There is no database fallback that fabricates online relations.

## Extension contract

JavaScript extensions can optionally implement:

```javascript
getRelated(url) {
    return [
        { name: "Sequel", animes: [
            { title: "Next season", url: "/anime/next", thumbnail_url: "/covers/next.jpg" }
        ] }
    ];
}
```

The common client probes for the method before calling it. `items` is accepted in
place of `animes`; existing listing title/URL/image aliases are supported. Missing
methods are unsupported, and an empty returned array is a supported empty result.
Malformed roots and oversized results surface errors. At most 50 groups and 1,000
rows are accepted. Repeated labels merge in first-seen order, repeated URLs within
a group keep the first item, and invalid rows are skipped. Source links accept web
URLs or relative source paths; file/content/data schemes are rejected. Images use
the shared source HTTP(S) validation and relative resolution.

The common Mihon client sends `getRelatedAnimeList` with `animeData.url`. It accepts
the upstream relation-array shape, or a bridge wrapper:

```json
{"supported":true,"groups":[{"name":"Sequel","animes":[{"title":"Next","url":"/next"}]}]}
```

The bundled Android bridge calls `AnimeSource.supportsRelatedAnime` and
`getRelatedAnimeList`, defaults older sources to unsupported, and forwards grouped
`SAnime` metadata. Other runtime formats default to unsupported until their API
provides relations. Desktop/iOS use a configured external JVM bridge and web uses
its configured HTTP bridge; those binaries must implement the method. Older bridge
errors remain visible and are not counted as an empty success. This change does not
upgrade external binaries or claim full compatibility with every extensions-lib 17 API.

The pinned upstream contract is
[AnimeSource](https://github.com/Animetailapp/Animetail/blob/d0eab5d6237dd09ebdb21a63fff5b66097c91087/source-api/src/main/kotlin/eu/kanade/tachiyomi/animesource/AnimeSource.kt)
and [AnimeRelation](https://github.com/Animetailapp/Animetail/blob/d0eab5d6237dd09ebdb21a63fff5b66097c91087/source-api/src/main/kotlin/eu/kanade/tachiyomi/animesource/model/AnimeRelation.kt).

## Verification

Verification passed 57 desktop checks and 51 Kotlin/Wasm browser tests without
failures/errors/skips; the bundled Android bridge unit suite was up to date and
passing, and Android, iOS simulator ARM64, desktop and web compiled. Tests cover
codec shapes, unsupported vs empty results, bridge errors, source isolation, saved
entry preservation, cancellation and late responses after rebinding, plus a rendered
desktop click on a related row. Compact/wide desktop Compose captures received a
scoped `ship` finish review. Native-device UI/accessibility/frame rate and live
third-party extensions/bridges are unverified.
