Keep this file updated whenever meaningful product, architecture, or workflow changes happen.
- Viola app with five tabs: News, Calendario, Classifica, FirenzeViola, LadyRadio.
- Uses Observation (
@Observable,@Bindable) for view models and controllers. - News data comes from a news articles API (see
Viola/News/NewsClient.swift).
- News list:
NewsListModel(cached viaSharingfile storage) +NewsListViewwith integrated.searchable. - Search:
NewsSearchModeldrives results; recents stored inAppStorage("recentSearches"). - Calendario and Classifica derive the current season from the tournament API's
archivio == 0metadata and expose independent season menus. The tournament catalogue is paginated to include historical seasons, and Classifica derives its Serie A group ID from the selected season. - Article detail:
ArticleDetailModelloads detail + media embeds. - Article body images are rendered as markdown images and
SingleImageLinkMarkdownParserinjects tappableviola-image://open?url=...links per image run. Taps open a Quick Look fullscreen preview backed by local cached files (Caches/article-image-previews) in single-image mode (no gallery list/swipe sequence state). Scope excludes hero-image tap handling and fullscreen preview captions. The modal viewer shows a white-tinted top-left share action and top-right close button. - Article body images in
StructuredTextuse a custom Textual image attachment loader (RoundedBodyImageAttachmentLoader) to render with rounded corners. - Live banner + detail:
LiveBannerViewModelfetches current live match list (Fiorentina filter) and injects a banner atop the News list; tapping opensLiveMatchDetailViewdriven byLiveDetailViewModelfetching full live detail (summary/commentary/lineup tabs). Banner result is cached to disk for fast startup. In DEBUG, if the live list is unreachable, the banner falls back toLiveMockData.sampleMatch; detail still calls the real API. - Live summary rows are precomputed in
LiveDetailViewModelduring refresh and consumed byLiveSummarySectionto avoid heavy recomputation inbody.
- Live streams are centralized in
LiveStreamPlayerwith separate audio/video sources. - FirenzeViola/LadyRadio tabs share a Radio/Diretta segmented control tied to a page-style TabView; the palinsesto sits below and does not change with the Radio/Diretta selection.
- Palinsesto filters the empty placeholder slot (
idprogramma == 0), uses a larger section header, and relies on row-level loading spinners for slow episode streams (no background audio prewarm task). PlaybackCoordinatorowns lock screen metadata + remote command routing and enforces single active playback.- Inline audio uses
InlineAudioPlayerViewcontroller; inline video usesInlineVideoPlayerView. - Only one audio/video source plays at a time (live or inline).
- Live video uses
LiveVideoPlayerView(AVPlayerViewController) with optional PiP + auto-start on background for the main Diretta player. - PiP "Back to App" restoration is handled via
AVPlayerViewControllerDelegateinLiveVideoPlayerView; on restore, stream tabs forceDirettaand switch to the active source tab (FirenzeViola/LadyRadio). - Background audio + PiP are enabled in
Config/Info.plist(UIBackgroundModesincludesaudioandpicture-in-picture). - PlaybackCoordinator updates
MPNowPlayingInfoCenter.playbackStateand registers remote command handling. - Live stream source selection does not interrupt playback; switching happens on play when the selected source differs.
- Radio/Diretta controls reflect the selected source rather than the currently playing stream.
- Stream accessory uses an
AVPlayerLayerpreview to avoid creating a secondAVPlayerViewController. - Lady Radio audio reads ICY
timedMetadataviaAVPlayerItemto surface current song (title/artist) for lock screen + Radio view. - Palinsesto decoding now tolerates null/empty
palinsestonodes (returns empty schedule instead of throwing).
- Use XcodeBuildMCP for builds after meaningful changes.
- Typical flow:
list_sims(ensure a booted simulator)session-set-defaultswithprojectPath,scheme: Viola, andsimulatorIdbuild_sim