Repository navigation
feat(android): polish foldable details and player UI - #190
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis change adds adaptive detail layouts, cached season episode paging, foldable tabletop player support, shared adaptive player sheets and controls, and scroll-aware image presentation on the home screen. ChangesAdaptive detail screens
Foldable player experience
Home image presentation
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant WindowInfoTracker
participant PlayerScreen
participant PlayerView
participant PlayerOverlay
participant PlayerSheetSupport
WindowInfoTracker->>PlayerScreen: emit tabletop folding feature
PlayerScreen->>PlayerView: apply fold-aware video pane
PlayerScreen->>PlayerOverlay: pass tabletop mode and pane height
PlayerOverlay->>PlayerSheetSupport: open sheets with tabletop sizing
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackStatsSheet.kt (1)
82-91: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winThe header close action skips
sheetState.hide()in three sheets. Each sheet wrapsonBackwithscope.launch { sheetState.hide() }but passes the bareonDismisstoPlayerSheetHeader. A close-button tap then removes the sheet without the hide animation, whileonDismissRequestanimates out. The shared root cause is one unwrapped dismiss callback.
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackStatsSheet.kt#L82-L91: wraponDismisswithscope.launch { sheetState.hide() }before calling it, as done foronBack.androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/SleepTimerSheet.kt#L97-L106: apply the same wrapper to theonDismisspassed toPlayerSheetHeader.androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/SubtitleStyleSheet.kt#L108-L117: apply the same wrapper to theonDismisspassed toPlayerSheetHeader.A shared helper in
PlayerSheetSupport.ktthat builds the dismiss lambda would prevent the three copies from diverging again.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackStatsSheet.kt` around lines 82 - 91, Wrap the onDismiss callback passed to PlayerSheetHeader so it launches sheetState.hide() before invoking the dismissal callback, matching the existing onBack behavior. Apply this in PlaybackStatsSheet.kt (lines 82-91), SleepTimerSheet.kt (lines 97-106), and SubtitleStyleSheet.kt (lines 108-117); optionally centralize the shared dismiss-lambda construction in PlayerSheetSupport.kt to prevent divergence.
🧹 Nitpick comments (4)
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.kt (1)
633-655: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMerge the row and switch into one accessible toggle target.
The
Rowis clickable and theSwitchkeeps its ownonCheckedChange. Screen readers then expose two separate targets for one setting, and the row reports the generic button role instead of the switch state. The Material pattern is atoggleablerow withRole.Switchand a non-interactiveSwitch.♻️ Proposed refactor
Row( modifier = Modifier .fillMaxWidth() - .clickable { onCheckedChange(!checked) } + .toggleable( + value = checked, + onValueChange = onCheckedChange, + role = Role.Switch, + ) .heightIn(min = 68.dp) .padding(horizontal = 16.dp, vertical = 10.dp), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), ) { RowLabel(label = label, subtitle = subtitle, modifier = Modifier.weight(1f)) Switch( checked = checked, - onCheckedChange = onCheckedChange, + onCheckedChange = null,Add the imports:
import androidx.compose.foundation.selection.toggleable import androidx.compose.ui.semantics.Role🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.kt` around lines 633 - 655, Update the toggle row containing RowLabel and Switch to use a single toggleable target with Role.Switch, replacing the row’s clickable modifier and importing toggleable and Role. Keep the checked state and onCheckedChange behavior on the row, and make the nested Switch non-interactive by removing its onCheckedChange handler while preserving its visual checked state and colors.androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerControls.kt (1)
456-460: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider syncing the volume slider with external volume changes.
volumeFractionis read once. If the user presses the hardware volume keys, or another app changes the music stream, the slider position becomes stale untilTabletopUtilityRowleaves and re-enters composition. AContentObserveronSettings.System.CONTENT_URI, or a periodic read while the controls are visible, keeps the slider aligned with the actual stream volume.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerControls.kt` around lines 456 - 460, Update the volume state around volumeFraction and TabletopUtilityRow so it observes external music-stream volume changes while the controls remain visible, using a ContentObserver on Settings.System.CONTENT_URI or an equivalent periodic refresh. Re-read AudioManager.STREAM_MUSIC and update the slider state whenever changes occur, while preserving the existing initialization and user-controlled volume behavior.androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerNextUpScreen.kt (1)
203-254: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueThe two action branches duplicate the same three buttons.
The compact branch and the fullscreen branch differ only in the container and the per-button modifier. Extract the button content into private composables, then place them in the chosen container. This keeps the two layouts in sync when labels or actions change.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerNextUpScreen.kt` around lines 203 - 254, Extract the shared Play Now, Keep Watching, and Back button content from the compact and fullscreen branches into private composables, preserving their existing click handlers, visibility conditions, labels, icons, and colors. Keep only the branch-specific container and button modifiers in each layout, and reuse the extracted composables so both branches remain synchronized.androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/ChaptersSheet.kt (1)
107-111: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
weight(1f)makes the phone sheet always use the maximum height.In phone mode
playerSheetContentappliesheightIn(max = ...), not a fixed height. A weighted child inside that Column forces the Column to the maximum constraint. A two-chapter list then renders in a sheet that is 80% of the screen height. If you want the phone sheet to size to content, applyweight(1f)only in tabletop mode.♻️ Proposed change
LazyVerticalGrid( columns = GridCells.Fixed(if (tabletopPaneHeight == null) 1 else 2), modifier = Modifier .fillMaxWidth() - .weight(1f), + .then( + if (tabletopPaneHeight == null) Modifier else Modifier.weight(1f), + ),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/ChaptersSheet.kt` around lines 107 - 111, Update the LazyVerticalGrid modifier in ChaptersSheet so weight(1f) is applied only when tabletopPaneHeight is non-null; preserve the existing full-width behavior and allow phone-mode sheets to size to their content under heightIn(max = ...).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailSharedComponents.kt`:
- Around line 283-302: Update ExpandedHeroTitle so the episode hierarchy check
using isEpisode and seriesTitle runs before the logoUrl branch, matching
HeroTitle’s compact-layout ordering. Preserve the existing episode title and
SxEy subtitle rendering, then evaluate the logo branch before the regular-title
fallback.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/SeasonEpisodePager.kt`:
- Around line 69-75: Update the LaunchedEffect collecting pagerState.settledPage
in SeasonEpisodePager so it only calls onSeasonSelected when the settled page’s
seasonNumber differs from selectedSeasonNumber. Preserve the existing
seasons.getOrNull(page) lookup and avoid propagating the initial or otherwise
already-selected page.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerControls.kt`:
- Around line 405-416: Clamp the brightness value used to initialize
brightnessFraction within the slider’s 0f–1f range. Update the fallback
calculation in the remember block, while preserving the existing
originalWindowBrightness preference and 0.5f default behavior.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerNextUpScreen.kt`:
- Around line 159-196: Replace the compactTabletop action Row with a FlowRow so
all buttons wrap within narrower lower panes instead of extending beyond the
verticalScroll viewport. Configure verticalArrangement with
Arrangement.spacedBy(8.dp), preserve the existing spacing and alignment
behavior, and add the required ExperimentalLayoutApi opt-in for the containing
screen or relevant scope.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.kt`:
- Around line 116-119: Update dismissSheet in
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.kt:116-119
to invoke onDismiss only after sheetState.hide() completes, preserving animated
dismissal and follow-up sheet callbacks. Apply the same invokeOnCompletion
change to dismissSheet in
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/TracksSheet.kt:72-75.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSheetSupport.kt`:
- Around line 72-78: Update Modifier.tabletopPlayerSheet to retain only the
height(tabletopPaneHeight) constraint when the height is non-null; remove
paneTop, LocalConfiguration.current.screenHeightDp, and the offset call so
ModalBottomSheet remains responsible for positioning.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/SubtitleSearchSheet.kt`:
- Around line 101-107: Update the LazyColumn result list in the outer Column to
use weight(1f) instead of the fixed 420.dp height constraint, allowing it to
occupy the remaining constrained tabletop-pane space. Apply the same change to
the corresponding list instance noted in the comment, while preserving the
existing scrolling behavior.
---
Outside diff comments:
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackStatsSheet.kt`:
- Around line 82-91: Wrap the onDismiss callback passed to PlayerSheetHeader so
it launches sheetState.hide() before invoking the dismissal callback, matching
the existing onBack behavior. Apply this in PlaybackStatsSheet.kt (lines 82-91),
SleepTimerSheet.kt (lines 97-106), and SubtitleStyleSheet.kt (lines 108-117);
optionally centralize the shared dismiss-lambda construction in
PlayerSheetSupport.kt to prevent divergence.
---
Nitpick comments:
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/ChaptersSheet.kt`:
- Around line 107-111: Update the LazyVerticalGrid modifier in ChaptersSheet so
weight(1f) is applied only when tabletopPaneHeight is non-null; preserve the
existing full-width behavior and allow phone-mode sheets to size to their
content under heightIn(max = ...).
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerControls.kt`:
- Around line 456-460: Update the volume state around volumeFraction and
TabletopUtilityRow so it observes external music-stream volume changes while the
controls remain visible, using a ContentObserver on Settings.System.CONTENT_URI
or an equivalent periodic refresh. Re-read AudioManager.STREAM_MUSIC and update
the slider state whenever changes occur, while preserving the existing
initialization and user-controlled volume behavior.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerNextUpScreen.kt`:
- Around line 203-254: Extract the shared Play Now, Keep Watching, and Back
button content from the compact and fullscreen branches into private
composables, preserving their existing click handlers, visibility conditions,
labels, icons, and colors. Keep only the branch-specific container and button
modifiers in each layout, and reuse the extracted composables so both branches
remain synchronized.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.kt`:
- Around line 633-655: Update the toggle row containing RowLabel and Switch to
use a single toggleable target with Role.Switch, replacing the row’s clickable
modifier and importing toggleable and Role. Keep the checked state and
onCheckedChange behavior on the row, and make the nested Switch non-interactive
by removing its onCheckedChange handler while preserving its visual checked
state and colors.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 549c869d-a15e-4535-bb43-6f7471bcdb39
📒 Files selected for processing (30)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/ui/components/ThumbhashImage.ktandroidApp/build.gradle.ktsandroidApp/gradle.lockfileandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailSharedComponents.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailScreen.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailViewModel.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MovieDetailContent.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/SeasonEpisodePager.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/SeriesDetailContent.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/home/HomeScreen.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/AiTranslateSheet.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/ChaptersSheet.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/FoldablePlayerPosture.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackStatsSheet.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerControls.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerNextUpScreen.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerProgressBar.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSheetSupport.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/QualitySelector.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/SleepTimerSheet.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/SubtitleSearchSheet.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/SubtitleStyleSheet.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/TracksSheet.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/detail/MobileDetailActionsSourceTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/FoldablePlayerPostureTest.ktgradle/libs.versions.tomlgradle/verification-metadata.xml
| var brightnessFraction by remember(activity, originalWindowBrightness) { | ||
| mutableFloatStateOf( | ||
| originalWindowBrightness | ||
| ?.takeIf { it >= 0f } | ||
| ?: runCatching { | ||
| Settings.System.getInt( | ||
| context.contentResolver, | ||
| Settings.System.SCREEN_BRIGHTNESS, | ||
| ) / 255f | ||
| }.getOrDefault(0.5f), | ||
| ) | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Clamp the initial brightness fraction to the slider range.
Settings.System.SCREEN_BRIGHTNESS is not guaranteed to use a 0–255 scale. Several OEM devices report a maximum of 1023 or 4095. On those devices value / 255f returns a number greater than 1f, so the brightness slider starts at a wrong position. Clamp the computed fraction.
🛠️ Proposed fix
var brightnessFraction by remember(activity, originalWindowBrightness) {
mutableFloatStateOf(
- originalWindowBrightness
- ?.takeIf { it >= 0f }
- ?: runCatching {
- Settings.System.getInt(
- context.contentResolver,
- Settings.System.SCREEN_BRIGHTNESS,
- ) / 255f
- }.getOrDefault(0.5f),
+ (
+ originalWindowBrightness
+ ?.takeIf { it >= 0f }
+ ?: runCatching {
+ Settings.System.getInt(
+ context.contentResolver,
+ Settings.System.SCREEN_BRIGHTNESS,
+ ) / 255f
+ }.getOrDefault(0.5f)
+ ).coerceIn(0f, 1f),
)
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| var brightnessFraction by remember(activity, originalWindowBrightness) { | |
| mutableFloatStateOf( | |
| originalWindowBrightness | |
| ?.takeIf { it >= 0f } | |
| ?: runCatching { | |
| Settings.System.getInt( | |
| context.contentResolver, | |
| Settings.System.SCREEN_BRIGHTNESS, | |
| ) / 255f | |
| }.getOrDefault(0.5f), | |
| ) | |
| } | |
| var brightnessFraction by remember(activity, originalWindowBrightness) { | |
| mutableFloatStateOf( | |
| ( | |
| originalWindowBrightness | |
| ?.takeIf { it >= 0f } | |
| ?: runCatching { | |
| Settings.System.getInt( | |
| context.contentResolver, | |
| Settings.System.SCREEN_BRIGHTNESS, | |
| ) / 255f | |
| }.getOrDefault(0.5f) | |
| ).coerceIn(0f, 1f), | |
| ) | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerControls.kt`
around lines 405 - 416, Clamp the brightness value used to initialize
brightnessFraction within the slider’s 0f–1f range. Update the fallback
calculation in the remember block, while preserving the existing
originalWindowBrightness preference and 0.5f default behavior.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed77eadd1a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (tabletopPaneHeight == null) return this | ||
| val paneTop = (LocalConfiguration.current.screenHeightDp.dp - tabletopPaneHeight) | ||
| .coerceAtLeast(0.dp) | ||
| return height(tabletopPaneHeight).offset(y = paneTop) |
There was a problem hiding this comment.
Stop offsetting fixed-height tabletop sheets
In tabletop posture, ModalBottomSheet already positions a sheet with this fixed height against the bottom of the window. Adding paneTop again moves every player sheet downward a second time; with an evenly split display, the sheet starts at the bottom edge and becomes completely invisible, while asymmetric splits leave only a small portion visible. Apply the pane height without this extra offset so Chapters, Tracks, Quality, and Settings remain usable.
Useful? React with 👍 / 👎.
| DisposableEffect(activity, originalWindowBrightness) { | ||
| onDispose { | ||
| val window = activity?.window ?: return@onDispose | ||
| val attributes = window.attributes | ||
| attributes.screenBrightness = originalWindowBrightness ?: -1f |
There was a problem hiding this comment.
Preserve tabletop brightness until the player exits
Restore the original window brightness at the player-screen lifecycle rather than when TabletopUtilityRow leaves composition. The controls are disposed whenever state.showUpNext becomes true, so a user-adjusted brightness is reset at the end of every episode and remains lost when they choose the next episode without leaving the player.
Useful? React with 👍 / 👎.
| snapshotFlow { pagerState.settledPage } | ||
| .distinctUntilChanged() | ||
| .collect { page -> | ||
| seasons.getOrNull(page)?.let { onSeasonSelected(it.seasonNumber) } |
There was a problem hiding this comment.
Ignore the pager's initial settled-page emission
When a multi-season series first renders, snapshotFlow immediately emits the pager's initial settledPage and calls selectSeason even though that season is already selected. This cancels the initial loadEpisodes job started by loadSeasons; the replacement request lacks seasonsForDownloadRollup, so loadAllEpisodeFileIds is never started and the series-wide download badge cannot report partial or completed state for that route. Skip the initial/same-season emission and only select after the pager actually settles on a different season.
Useful? React with 👍 / 👎.
| val useSideRail = tabletopPaneHeight != null || | ||
| LocalConfiguration.current.smallestScreenWidthDp >= 600 |
There was a problem hiding this comment.
Gate the settings side rail on available width
Any non-null tabletop pane forces the 212dp category rail, even on narrow clamshell foldables. At roughly 360–412dp of total width, the row's 48dp outer padding, 16dp gap, and fixed rail leave only about 84–136dp for the settings card; controls such as the 184dp delay spinner and toggle labels are consequently clipped or unusable. Base the rail decision on the current pane width and retain the tab layout for compact tabletop windows.
Useful? React with 👍 / 👎.
| if (compactTabletop) { | ||
| Row( | ||
| modifier = Modifier.widthIn(max = 620.dp).fillMaxWidth(), | ||
| horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally), |
There was a problem hiding this comment.
Wrap compact tabletop next-up actions
On narrow tabletop devices, this single non-wrapping row cannot fit Play Now, Keep Watching, and Back together. Their intrinsic button widths plus spacing exceed the lower pane available on common 360–412dp-wide clamshell layouts, and the screen only scrolls vertically, leaving edge actions clipped with no way to reach them. Use a wrapping or stacked arrangement for the compact path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08bf89e9fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| seasons.getOrNull(page) | ||
| ?.takeIf { it.seasonNumber != selectedSeasonNumber } | ||
| ?.let { onSeasonSelected(it.seasonNumber) } |
There was a problem hiding this comment.
Prevent stale pager emissions from undoing chip selections
When a user taps a different season chip while the pager is still settled on the old page, updating selectedSeasonNumber restarts this LaunchedEffect; snapshotFlow immediately emits that old settledPage, passes this inequality check, and selects the old season again, cancelling the requested season load and bouncing the UI back. Fresh evidence beyond the earlier initial-emission report is that the new same-season guard does not reject this stale emission after a programmatic chip selection; suppress the collector while the pager is animating toward the selected page or otherwise ignore its first emission after this key change.
Useful? React with 👍 / 👎.
| if (castState.isConnected || !orientationLockSupported || tabletopPosture != null) { | ||
| activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED | ||
| return@LaunchedEffect |
There was a problem hiding this comment.
Detect tabletop posture before forcing landscape
When the default locked-orientation setting resolves before the asynchronous WindowManager flow reports the current fold, tabletopPosture is still null here and the effect forces SENSOR_LANDSCAPE. On a clamshell already in tabletop posture, that rotates the window-relative horizontal folding feature to vertical, so isTabletopPlayerPosture can no longer recognize it and this effect never reaches the new unlock branch; the player remains in the ordinary landscape layout until exit. Defer applying the landscape lock until initial posture detection completes, rather than treating the producer's initial null as proof that the device is not tabletop.
Useful? React with 👍 / 👎.
| val deferNewArtworkPresentation = remember(listState) { | ||
| derivedStateOf { listState.isScrollInProgress } | ||
| } |
There was a problem hiding this comment.
Defer artwork during horizontal row flings too
The presentation gate observes only the outer LazyColumn state, but Home's media cards are primarily scrolled inside independent horizontal LazyRows. During a pure horizontal fling listState.isScrollInProgress remains false, so newly decoded images bypass the new deferral path and are presented/uploaded while that row is moving—the exact rendering work this change is intended to keep out of flings. Include the active row-scroll states in the provided gate, or provide a row-scoped deferral state from MediaRow.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6fb9ca8171
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| scope.launch { sheetState.hide() } | ||
| onDismiss() | ||
| }, | ||
| if (tabletopPaneHeight != null && audioTracks.isNotEmpty()) { |
There was a problem hiding this comment.
Use one column for compact tabletop track sheets
On 360–412dp-wide clamshells in tabletop posture, this condition selects the two-column layout solely because a pane height is present. After the 48dp outer padding and 16dp gap, the audio card is only about 130–153dp wide, and its own padding, icon, and selection indicator leave too little room for language, codec, and channel labels; tracks with the same language become effectively indistinguishable. Gate the split layout on available width and use the existing stacked branch for compact panes.
Useful? React with 👍 / 👎.
Summary
Why
Foldable devices need layouts that react to window posture and available panes rather than Samsung-specific APIs or fixed screen assumptions. The existing detail and player surfaces also performed avoidable relayout/draw work while artwork loaded, and player sheets could expand across the hinge.
User impact
Validation
git diff origin/main...HEAD --check:androidApp:testDebugUnitTest --tests org.siloserver.silo.android.ui.screens.player.FoldablePlayerPostureTest --tests org.siloserver.silo.android.ui.screens.player.PlayerVerticalDragModeTest --tests org.siloserver.silo.android.ui.screens.detail.MobileDetailActionsSourceTest220000044Summary by CodeRabbit