Skip to content

Offline Host fallback #51

@zeevenn

Description

@zeevenn

Parent

#39 — PRD: AI Radio — Host-driven Channel experience with chat timeline

What to build

When the device has no network connection, activate the Offline Host — a fallback implementation of the Host Service interface that requires no API calls. Additionally, users retain the option to exit radio mode entirely and use classic (queue) playback for full manual control.

Offline Host behaviour:

  1. On activation (network goes away, or loadChannel is called with no network), play a pre-bundled TTS audio file: "当前无网络连接,为你随机播放本地音乐。" — bundle this MP3/AAC file with the app
  2. After that announcement Segment plays, generate subsequent Programmes by random-shuffling the CandidateSet — Tracks only, no Interludes
  3. The chat timeline shows the announcement as a host announcement message; subsequent track-played entries appear as normal

Classic mode fallback:

  • While offline, the user can exit radio mode by manually selecting a track from the Library
  • This switches to classic (queue) mode with full manual control — same as online classic mode
  • No special handling needed; the existing mode-switching logic (Refactor Player to Programme model #43) covers this

Network detection: monitor connectivity; when connectivity is restored, the Programme Manager switches back to the real Host Service at the next Programme boundary (not mid-Programme).

The Radio Screen layout is identical in offline mode — no second UI, no mode indicator needed.

The Offline Host implements the same interface as the real Host Service (generateProgramme → Promise<Programme>), so the Programme Manager treats it transparently.

Acceptance criteria

  • When network is unavailable and a Channel is loaded, the pre-bundled TTS announcement plays first
  • Subsequent Programmes are random shuffles of the CandidateSet with no Interludes
  • The announcement appears in the chat timeline as a host announcement message
  • When network is restored, the real Host Service resumes at the next Programme boundary
  • Radio Screen layout is unchanged in offline mode
  • User can exit to classic mode while offline by playing a track from Library

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentReady for an AI agent to implement

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions