Release Kaleido 0.6.0 with Silo-style browsing and details
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m35s

Movie, show, season and episode pages now share the browse previews'
design: the same top-right artwork and optional colour wash, title art, a
facts line with rating and format badges, and a three-line synopsis.
Season and episode pages follow the focused episode's still and details,
and the player's controls show title art and the rating badge. The
details tests step past the library filter row and read title art from
its content description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-10-28 16:48:00 -07:00
parent 7471f7cac2
commit 24042bebbc
14 changed files with 130 additions and 84 deletions

View file

@ -426,7 +426,7 @@ private val SectionPreviewHeight=190.dp
private val SectionLogo=DpSize(280.dp,56.dp)
private const val HeaderMillis=380
private const val CopyMillis=380
private val HeaderLift=12.dp
internal val HeaderLift=12.dp
/** Focus must rest this long before the preview follows it, so a held direction doesn't replay fades. */
private const val PreviewRestMillis=110L
@ -468,7 +468,7 @@ internal fun previewArt(item:Title)=if(item.type=="episode")item.still.ifBlank{i
* Swaps [item] Silo-style: the outgoing copy lifts slightly as it fades; the next rises into
* place as it fades in. Two keyed layers driven by one animation, read only while drawing.
*/
@Composable private fun <T:Any> FadingCopy(item:T?,id:(T)->String,lift:Float,modifier:Modifier=Modifier,contentAlignment:Alignment=Alignment.TopStart,content:@Composable (T)->Unit) {
@Composable internal fun <T:Any> FadingCopy(item:T?,id:(T)->String,lift:Float,modifier:Modifier=Modifier,contentAlignment:Alignment=Alignment.TopStart,content:@Composable (T)->Unit) {
val progress=remember{Animatable(1f)}
var shown by remember{mutableStateOf(item)}
var leaving by remember{mutableStateOf<T?>(null)}
@ -533,8 +533,7 @@ internal fun previewArt(item:Title)=if(item.type=="episode")item.still.ifBlank{i
// Cast and formats need the full details. Their rows are reserved, and fade in when they arrive.
val details=remember{Animatable(0f)}
LaunchedEffect(loaded){if(loaded)details.animateTo(1f,tween(220))}
val media=metadata.media.firstOrNull()
val formats=listOfNotNull(media?.resolutionLabel?.ifBlank{null},media?.dynamicRange?.ifBlank{null},media?.let{if(it.atmos)"Atmos"else it.channelLabel.ifBlank{null}})
val formats=formatLabels(metadata.media.firstOrNull())
val runtime=when{item.duration<=0->"";item.offset>0->runtimeLabel(item.duration-item.offset)+" left";else->runtimeLabel(item.duration)}
Column(Modifier.width(420.dp).clearAndSetSemantics{contentDescription=listOf(item.displayTitle,metadata.rating,item.summary).filter{it.isNotBlank()}.joinToString(". ")}) {
TitleIdentity(vm.api,item,Modifier.size(logo))
@ -553,13 +552,16 @@ internal fun previewArt(item:Title)=if(item.type=="episode")item.still.ifBlank{i
}
}
/** Resolution, dynamic range and the best audio format, e.g. 4K · Dolby Vision · Atmos. */
internal fun formatLabels(media:Media?)=listOfNotNull(media?.resolutionLabel?.ifBlank{null},media?.dynamicRange?.ifBlank{null},media?.let{if(it.atmos)"Atmos"else it.channelLabel.ifBlank{null}})
/** A small outlined label: a content rating or a video/audio format. */
@Composable private fun FormatBadge(label:String,modifier:Modifier=Modifier) {
@Composable internal fun FormatBadge(label:String,modifier:Modifier=Modifier) {
Text(label.uppercase(),color=Color.White.copy(alpha=.9f),fontSize=8.5.sp,lineHeight=11.sp,fontWeight=FontWeight.SemiBold,letterSpacing=.5.sp,maxLines=1,
modifier=modifier.border(.5.dp,Color.White.copy(alpha=.3f),RoundedCornerShape(3.dp)).background(Color.White.copy(alpha=.06f),RoundedCornerShape(3.dp)).padding(horizontal=5.dp,vertical=1.5.dp))
}
private fun runtimeLabel(ms:Long):String {val minutes=(ms/60000).coerceAtLeast(1);return if(minutes>=60)"${minutes/60}h ${minutes%60}m"else "${minutes}m"}
internal fun runtimeLabel(ms:Long):String {val minutes=(ms/60000).coerceAtLeast(1);return if(minutes>=60)"${minutes/60}h ${minutes%60}m"else "${minutes}m"}
@Composable private fun HeroCopy(vm:KaleidoViewModel,feature:HomeFeature) {
val item=feature.item

View file

@ -18,6 +18,9 @@ data class Media(val id: String, val container: String, val videoCodec: String,
listOf(audioCodec.uppercase(),channelLabel,if(atmos)"Atmos"else "").filter{it.isNotBlank()}.joinToString(" "),
if(bitrate>0)"${(bitrate+500)/1000} Mbps"else "",if(includeSize&&size>0)fileSize(size)else "",if(parts.size>1)"${parts.size} parts"else "")
.filter{it.isNotBlank()}.joinToString(" · ")
/** What the format badges leave out: codecs, audio layout and bitrate, e.g. "AV1 · EAC3 5.1 · 10 Mbps". */
val technical get()=listOf(videoCodec.uppercase(),listOf(audioCodec.uppercase(),channelLabel).filter{it.isNotBlank()}.joinToString(" "),
if(bitrate>0)"${(bitrate+500)/1000} Mbps"else "",if(parts.size>1)"${parts.size} parts"else "").filter{it.isNotBlank()}.joinToString(" · ")
}
internal fun fileSize(bytes:Long):String = if(bytes>=1_000_000_000L)String.format(java.util.Locale.US,"%.1f GB",bytes/1e9)else "${bytes/1_000_000} MB"
data class Marker(val type: String, val start: Long, val end: Long)

View file

@ -161,11 +161,19 @@ import kotlinx.coroutines.delay
if(controller.loading)CircularProgressIndicator(color=Accent,strokeWidth=2.dp,modifier=Modifier.align(Alignment.Center).size(30.dp))
QuickSkipFeedback(skipSeconds,skipPulse,!visible&&!postPlay,Modifier.align(if(skipForward)Alignment.CenterEnd else Alignment.CenterStart).padding(horizontal=32.dp))
AnimatedVisibility(visible=visible,enter=fadeIn(tween(190))+slideInVertically(tween(190)){it/8},exit=fadeOut(tween(190))+slideOutVertically(tween(190)){it/10},modifier=Modifier.align(Alignment.BottomCenter)) {
Column(Modifier.fillMaxWidth().background(Brush.verticalGradient(0f to Color.Transparent,.42f to Color.Black.copy(alpha=.46f),1f to Color.Black.copy(alpha=.79f))).padding(start=Cinema.gutter,end=Cinema.gutter,top=31.dp,bottom=16.dp)) {
Row(Modifier.fillMaxWidth().padding(bottom=7.dp),verticalAlignment=Alignment.Bottom) {
Text(item.displayTitle,color=Accent,fontSize=18.sp,lineHeight=23.sp,fontWeight=FontWeight.SemiBold,maxLines=1,overflow=TextOverflow.Ellipsis,modifier=Modifier.weight(1f))
Column(Modifier.fillMaxWidth().background(Brush.verticalGradient(0f to Color.Transparent,.35f to Color.Black.copy(alpha=.5f),1f to Color.Black.copy(alpha=.85f))).padding(start=Cinema.gutter,end=Cinema.gutter,top=48.dp,bottom=16.dp)) {
// The title art and facts the browse previews and details use, at playback scale.
Row(Modifier.fillMaxWidth().padding(bottom=10.dp),verticalAlignment=Alignment.Bottom) {
Column(Modifier.weight(1f)) {
TitleIdentity(vm.api,item,Modifier.size(240.dp,44.dp))
Row(Modifier.padding(top=8.dp).height(17.dp),verticalAlignment=Alignment.CenterVertically) {
if(item.contentRating.isNotBlank())FormatBadge(item.contentRating,Modifier.padding(end=8.dp))
Text((if(item.type=="episode")listOf("S${item.parentIndex} · E${item.index}",item.title)else listOf(item.year,item.genres.firstOrNull().orEmpty())).filter{it.isNotBlank()}.joinToString(" · "),
color=Cinema.secondary,fontSize=11.sp,lineHeight=15.sp,maxLines=1,overflow=TextOverflow.Ellipsis)
}
}
Spacer(Modifier.width(18.dp))
Text(if(item.type=="episode")"S${item.parentIndex} · E${item.index} ${item.title}"else controller.qualityLabel,color=Color.White.copy(alpha=.72f),fontSize=12.sp,lineHeight=16.sp,maxLines=1,overflow=TextOverflow.Ellipsis,modifier=Modifier.widthIn(max=420.dp))
Text(controller.qualityLabel,color=Color.White.copy(alpha=.6f),fontSize=10.sp,lineHeight=14.sp,maxLines=1,overflow=TextOverflow.Ellipsis,modifier=Modifier.widthIn(max=360.dp))
}
SeekTimeline(controller,item,Modifier.fillMaxWidth().focusRequester(timelineFocus).focusProperties{down=playFocus},::interacted)
Box(Modifier.fillMaxWidth().height(40.dp)) {

View file

@ -81,39 +81,16 @@ import kotlinx.coroutines.launch
// An episode started from the season row gets focus back itself, once the rebuilt row composes.
LaunchedEffect(vm.playbackReturn){if(vm.playbackReturn!=seenReturn[0]){seenReturn[0]=vm.playbackReturn;if(vm.focusId.startsWith("children:${item.id}:"))return@LaunchedEffect;withFrameNanos{};list.scrollToItem(0);withFrameNanos{};runCatching{actionFocus.requestFocus()}}}
Box(Modifier.fillMaxSize().background(Ink)) {
val usesPosterHeader=item.type in listOf("show","movie")
if(usesPosterHeader||episodic) {
// Season headers are shorter than 16:9: cropping into that box cut off heads.
// Frame TV artwork against the full page, with its top edge flush to movies.
val showArtwork=item.type=="show"||episodic
BrowseBackdrop(vm.api,item.art.ifBlank{item.thumb},Modifier.fillMaxSize().graphicsLayer {
alpha=if(list.firstVisibleItemIndex>0)0f else (1f-list.firstVisibleItemScrollOffset/backdropFadeDistance).coerceIn(0f,1f)
},cinematic=true,alignment=if(showArtwork)Alignment.TopCenter else Alignment.Center,contentScale=if(showArtwork)ContentScale.FillWidth else ContentScale.Crop)
// Keep the scene in the header; rows and captions sit on near-black. Read scroll
// in the layer so scrolling doesn't recompose the details and cast hierarchy.
Box(Modifier.fillMaxSize().background(Brush.verticalGradient(0f to Ink.copy(alpha=.4f),.35f to Ink.copy(alpha=.5f),.62f to Ink.copy(alpha=.96f),.8f to Ink)))
}
// The browse previews' framing, so opening a title keeps its artwork in place; a season's
// artwork follows the episode it shows. Scroll is read in the layer, never in composition.
BrowseBackdrop(vm.api,if(episodic)previewArt(shown)else item.art.ifBlank{item.thumb},Modifier.fillMaxSize().graphicsLayer {
alpha=if(list.firstVisibleItemIndex>0)0f else (1f-list.firstVisibleItemScrollOffset/backdropFadeDistance).coerceIn(0f,1f)
},header=true,wash=vm.colourWash,animate=true)
// Actions lead to the first row below them: seasons/episodes, otherwise the first cast member.
val below=if(vm.children.isNotEmpty())childFocus else if(item.castMembers.isNotEmpty())castFocus else null
CompositionLocalProvider(LocalBringIntoViewSpec provides DetailsScroll) {
LazyColumn(state=list,contentPadding=PaddingValues(bottom=30.dp),verticalArrangement=Arrangement.spacedBy(18.dp),modifier=Modifier.fillMaxSize()) {
item(key="details-${item.id}") {
// A fixed episode header, so moving along the season row never shifts the page.
Box(Modifier.fillMaxWidth().then(if(usesPosterHeader)Modifier.heightIn(min=248.dp)else if(episodic)Modifier.height(322.dp)else Modifier.heightIn(min=286.dp))) {
if(!usesPosterHeader&&!episodic) {
Artwork(vm.api,item.art,Modifier.matchParentSize(),1920,1080)
Box(Modifier.matchParentSize().background(Brush.horizontalGradient(listOf(Ink.copy(alpha=.98f),Ink.copy(alpha=.8f),Color.Transparent))))
Box(Modifier.matchParentSize().background(Brush.verticalGradient(listOf(Color.Black.copy(alpha=.12f),Color.Transparent,Ink))))
}
IconControl(Icons.AutoMirrored.Outlined.ArrowBack,"Back",modifier=Modifier.padding(start=36.dp,top=14.dp)){vm.back()}
if(usesPosterHeader) {
Row(Modifier.fillMaxWidth().padding(start=Cinema.gutter,end=Cinema.gutter,top=56.dp),horizontalArrangement=Arrangement.spacedBy(24.dp),verticalAlignment=Alignment.Top) {
Artwork(vm.api,item.poster.ifBlank{item.thumb},Modifier.width(128.dp).height(192.dp).clip(androidx.compose.foundation.shape.RoundedCornerShape(6.dp)),384,576,animate=false,contentScale=ContentScale.Fit)
TitleInformation(vm,item,item,actionFocus,below,!restoreRow,Modifier.weight(1f))
}
}else TitleInformation(vm,shown,item,actionFocus,below,!restoreRow,Modifier.align(Alignment.CenterStart).padding(start=Cinema.gutter,end=Cinema.gutter,top=64.dp,bottom=24.dp).fillMaxWidth())
}
}
item(key="details-${item.id}"){DetailHeader(vm,shown,item,actionFocus,below,!restoreRow)}
// Rebuilt after playback so the row scrolls to the episode last played.
if(vm.children.isNotEmpty())item(key="children-${item.id}-${if(episodic)vm.playbackReturn else 0}") {
if(episodic)MediaRow(vm,if(item.type=="season")item.title else "Season ${item.parentIndex}",vm.children,"children:${item.id}",landscape=true,entryFocus=childFocus,episodeTitles=true,
@ -137,41 +114,75 @@ private object DetailsScroll:BringIntoViewSpec {
}
}
/** [page] is the open title; on a season or episode page, [item] is the episode it shows. */
@Composable private fun TitleInformation(vm:KaleidoViewModel,item:Title,page:Title,actionFocus:FocusRequester,below:FocusRequester?,initialFocus:Boolean,modifier:Modifier) {
val actionNavigation=Modifier.focusProperties{if(below!=null)down=below}
/**
* The header, after the browse previews: title art, facts and format, synopsis, then actions.
* [page] is the open title; on a season or episode page, [item] is the episode it shows, and
* moving along the season row fades its copy like the previews. Fixed heights keep the rows
* below in place, and leave a show's season captions on screen.
*/
@Composable private fun DetailHeader(vm:KaleidoViewModel,item:Title,page:Title,actionFocus:FocusRequester,below:FocusRequester?,initialFocus:Boolean) {
var summaryOverflow by remember(item.id){mutableStateOf(false)}
val episodic=page.type in listOf("season","episode")
val technical=item.type in listOf("movie","episode")
val height=when{episodic->296.dp;technical->276.dp;else->250.dp}
Box(Modifier.fillMaxWidth().height(height)) {
IconControl(Icons.AutoMirrored.Outlined.ArrowBack,"Back",modifier=Modifier.padding(start=36.dp,top=14.dp)){vm.back()}
Column(Modifier.align(Alignment.BottomStart).padding(start=Cinema.gutter,end=Cinema.gutter,bottom=4.dp)) {
CompositionLocalProvider(LocalTextStyle provides LocalTextStyle.current.copy(shadow=CaptionShadow)) {
FadingCopy(item,{it.id},with(LocalDensity.current){HeaderLift.toPx()},Modifier.height(if(episodic)166.dp else 150.dp),Alignment.BottomStart) {shown->
DetailCopy(vm,shown,page){if(shown.id==item.id)summaryOverflow=it}
}
}
DetailActions(vm,item,page,actionFocus,below,initialFocus,summaryOverflow)
if(technical)item.media.getOrNull(vm.mediaIndex(item))?.let{Text(it.technical,color=Cinema.quiet,fontSize=9.5.sp,lineHeight=13.sp,maxLines=1,modifier=Modifier.padding(top=10.dp))}
}
}
}
@Composable private fun DetailCopy(vm:KaleidoViewModel,item:Title,page:Title,onOverflow:(Boolean)->Unit) {
val runtime=when{item.duration<=0->"";item.offset>0->runtimeLabel(item.duration-item.offset)+" left";else->runtimeLabel(item.duration)}
val seasons=vm.children.size.takeIf{page.id==item.id&&item.type=="show"&&it>0}?.let{if(it==1)"1 season"else "$it seasons"}.orEmpty()
val facts=when(item.type) {
"episode"->listOf("S${item.parentIndex} · E${item.index}",airDate(item.releaseDate),runtime)
"season"->listOf(item.subtitle)
"show"->listOf(item.year,item.genres.take(2).joinToString(" / "),seasons,if(item.leafCount>0)"${item.leafCount} episodes"else "")
else->listOf(item.year,item.genres.take(2).joinToString(" / "),runtime)
}
Column(Modifier.width(560.dp)) {
// Episodes name their show with its title art, then the episode itself.
if(item.type=="episode") {
TitleIdentity(vm.api,item,Modifier.size(280.dp,48.dp))
Text(item.title,color=Accent,fontSize=19.sp,lineHeight=24.sp,fontWeight=FontWeight.SemiBold,maxLines=1,overflow=TextOverflow.Ellipsis,modifier=Modifier.padding(top=8.dp))
}else TitleIdentity(vm.api,item,Modifier.size(340.dp,64.dp))
Row(Modifier.padding(top=9.dp,bottom=7.dp).height(17.dp),verticalAlignment=Alignment.CenterVertically) {
if(item.contentRating.isNotBlank())FormatBadge(item.contentRating,Modifier.padding(end=8.dp))
Text(facts.filter{it.isNotBlank()}.joinToString(" · "),color=Cinema.secondary,fontSize=11.sp,lineHeight=15.sp,maxLines=1,overflow=TextOverflow.Ellipsis,modifier=Modifier.weight(1f,fill=false))
AudienceRatings(item,Modifier.padding(start=10.dp))
formatLabels(item.media.getOrNull(vm.mediaIndex(item))).forEachIndexed{index,label->FormatBadge(label,Modifier.padding(start=if(index==0)14.dp else 6.dp))}
}
Text(item.summary,color=Cinema.secondary,fontSize=12.sp,lineHeight=17.5.sp,maxLines=3,overflow=TextOverflow.Ellipsis,onTextLayout={onOverflow(it.hasVisualOverflow)})
}
}
@Composable private fun DetailActions(vm:KaleidoViewModel,item:Title,page:Title,actionFocus:FocusRequester,below:FocusRequester?,initialFocus:Boolean,summaryOverflow:Boolean) {
val actionNavigation=Modifier.focusProperties{if(below!=null)down=below}
var showSynopsis by remember(item.id){mutableStateOf(false)}
var showVersions by remember(item.id){mutableStateOf(false)}
val media=item.media.getOrNull(vm.mediaIndex(item))
Column(modifier) {
CompositionLocalProvider(LocalTextStyle provides LocalTextStyle.current.copy(shadow=Shadow(Color.Black.copy(alpha=.95f),Offset(0f,2f),6f))) {
// Seasons and episodes name their show above the title.
val show=when(page.type){"episode"->page.grandparentTitle;"season"->page.parentTitle;else->""}.ifBlank{item.grandparentTitle.takeIf{item.type=="episode"}.orEmpty()}
if(show.isNotBlank())Text(show,color=Cinema.secondary,fontSize=12.sp,lineHeight=16.sp,fontWeight=FontWeight.Medium)
Text(item.title,color=Accent,fontSize=32.sp,lineHeight=36.sp,fontWeight=FontWeight.Bold,maxLines=if(page.type in listOf("season","episode"))1 else 2,overflow=TextOverflow.Ellipsis,modifier=Modifier.widthIn(max=560.dp))
Row(Modifier.widthIn(max=620.dp).padding(top=9.dp),verticalAlignment=Alignment.CenterVertically) {
Text(listOf(item.subtitle,airDate(item.releaseDate).takeIf{item.type=="episode"}.orEmpty(),item.contentRating).filter{it.isNotBlank()}.joinToString(" · "),color=Muted,fontSize=10.5.sp,lineHeight=16.sp,maxLines=1,overflow=TextOverflow.Ellipsis,modifier=Modifier.weight(1f,fill=false))
AudienceRatings(item,Modifier.padding(start=12.dp))
// Scrolls sideways only if a title has more actions than fit the page.
if(item.type!="collection")Row(Modifier.padding(top=9.dp).horizontalScroll(rememberScrollState()).padding(vertical=3.dp),horizontalArrangement=Arrangement.spacedBy(9.dp),verticalAlignment=Alignment.CenterVertically) {
ActionButton(if(item.offset>0)"Resume from ${clockTime(item.offset)}"else if(item.type=="show")"Watch next"else "Play",Icons.Filled.PlayArrow,modifier=actionNavigation.focusRequester(actionFocus),primary=true,initialFocus=initialFocus){played(vm,page);vm.play(item)}
if(item.offset>0)ActionButton("Start over",Icons.Outlined.Replay,modifier=actionNavigation){played(vm,page);vm.play(item,true)}
if(page.type=="show"&&item.type=="show")ActionButton("Shuffle episodes",Icons.Outlined.Shuffle,modifier=actionNavigation){played(vm,page);vm.playShuffled(item)}
if(item.type in listOf("movie","show","season","episode")) {
val watched=item.isWatched(vm.watchedPercent)
ActionButton(if(vm.markingId==item.id)"Updating…"else if(watched)"Mark unwatched"else "Mark watched",if(watched)Icons.Outlined.CheckCircle else Icons.Outlined.Check,modifier=actionNavigation){vm.mark(item)}
}
Text(item.summary,color=Cinema.secondary,fontSize=12.sp,lineHeight=18.sp,maxLines=3,overflow=TextOverflow.Ellipsis,onTextLayout={summaryOverflow=it.hasVisualOverflow},modifier=Modifier.widthIn(max=560.dp).padding(top=10.dp,bottom=17.dp))
}
// Scrolls sideways only if a title has more actions than fit beside its poster.
if(item.type!="collection")Row(Modifier.horizontalScroll(rememberScrollState()).padding(vertical=3.dp),horizontalArrangement=Arrangement.spacedBy(9.dp),verticalAlignment=Alignment.CenterVertically) {
ActionButton(if(item.offset>0)"Resume from ${clockTime(item.offset)}"else if(item.type=="show")"Watch next"else "Play",Icons.Filled.PlayArrow,modifier=actionNavigation.focusRequester(actionFocus),primary=true,initialFocus=initialFocus){played(vm,page);vm.play(item)}
if(item.offset>0)ActionButton("Start over",Icons.Outlined.Replay,modifier=actionNavigation){played(vm,page);vm.play(item,true)}
if(page.type=="show"&&item.type=="show")ActionButton("Shuffle episodes",Icons.Outlined.Shuffle,modifier=actionNavigation){played(vm,page);vm.playShuffled(item)}
if(item.type in listOf("movie","show","season","episode")) {
val watched=item.isWatched(vm.watchedPercent)
ActionButton(if(vm.markingId==item.id)"Updating…"else if(watched)"Mark unwatched"else "Mark watched",if(watched)Icons.Outlined.CheckCircle else Icons.Outlined.Check,modifier=actionNavigation){vm.mark(item)}
}
item.trailer?.let{trailer->ActionButton("Trailer",Icons.Outlined.Movie,modifier=actionNavigation){vm.play(trailer)}}
// Name the version by resolution unless several share it, e.g. two 1080p encodes.
if(item.media.size>1)ActionButton(if(item.media.map{it.resolutionLabel}.distinct().size==item.media.size&&media?.resolutionLabel?.isNotBlank()==true)"Version · ${media.resolutionLabel}"
else "Version ${vm.mediaIndex(item)+1} of ${item.media.size}",Icons.Outlined.Layers,modifier=actionNavigation){showVersions=true}
if(item.type in listOf("show","movie")&&summaryOverflow)ActionButton("Synopsis",Icons.Outlined.Description,modifier=actionNavigation){showSynopsis=true}
}
if(item.type !in listOf("show","season"))media?.let{Text(it.description(),color=Cinema.quiet,fontSize=9.5.sp,modifier=Modifier.padding(top=12.dp))}
item.trailer?.let{trailer->ActionButton("Trailer",Icons.Outlined.Movie,modifier=actionNavigation){vm.play(trailer)}}
// Name the version by resolution unless several share it, e.g. two 1080p encodes.
if(item.media.size>1)ActionButton(if(item.media.map{it.resolutionLabel}.distinct().size==item.media.size&&media?.resolutionLabel?.isNotBlank()==true)"Version · ${media.resolutionLabel}"
else "Version ${vm.mediaIndex(item)+1} of ${item.media.size}",Icons.Outlined.Layers,modifier=actionNavigation){showVersions=true}
if(item.type in listOf("show","movie")&&summaryOverflow)ActionButton("Synopsis",Icons.Outlined.Description,modifier=actionNavigation){showSynopsis=true}
}
if(showSynopsis)SynopsisDialog(vm.api,item){showSynopsis=false}
if(showVersions)ChoiceDialog("Versions",item.media.map{it.description(includeSize=true)},vm.mediaIndex(item),{showVersions=false}){vm.chooseMedia(item,it);showVersions=false}