Repository navigation
Fix Fire TV playback and TV auth input regressions - #14
Conversation
|
Warning Review limit reached
Next review available in: 21 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (24)
📝 WalkthroughWalkthroughThis PR replaces custom Android TV keyboards (ANSI, credential, server-URL, search) with platform IME text fields across TV screens, adds enabled-state support to shared TV components, introduces playback session renewal on transcode fallback, adds server-scoped auth status probing with multi-scheme URL candidates, adds duplicate-submit guards and single-flight/race protection to TV auth ViewModels, adds Silo-Client device metadata headers, and adds keep-screen-on plus intro-skip/manual-subtitle handling in the TV player. ChangesDevice Metadata and Session Renewal
Auth Probing and Guards
TV Custom Keyboard Removal
TV Player UX
Estimated code review effort: 4 (Complex) | ~75 minutes Sequence Diagram(s)sequenceDiagram
participant ViewModel
participant PlaybackSessionManager
participant Server
ViewModel->>PlaybackSessionManager: startTranscodeFallbackRecoveringMissingSession(renewSession)
PlaybackSessionManager->>Server: startTranscodeFallback
Server-->>PlaybackSessionManager: 404 playback_session_not_found
PlaybackSessionManager->>ViewModel: renewSession()
ViewModel->>Server: sessionLifecycle.start(renewStartParams)
Server-->>ViewModel: renewed session
ViewModel-->>PlaybackSessionManager: ApiResult.Success
PlaybackSessionManager->>Server: retry startTranscodeFallback(renewed session)
Server-->>PlaybackSessionManager: fresh fallback session
sequenceDiagram
participant User
participant TvLoginViewModel
participant AuthRepository
participant DeviceLoginApi
participant TokenManager
User->>TvLoginViewModel: onLoginClick
TvLoginViewModel->>AuthRepository: loginForTokens
par device login polling
TvLoginViewModel->>DeviceLoginApi: poll
DeviceLoginApi-->>TvLoginViewModel: approved
TvLoginViewModel->>TvLoginViewModel: tryCompleteAuth()
TvLoginViewModel->>TokenManager: saveTokens (QR)
and credential login
AuthRepository-->>TvLoginViewModel: tokens
TvLoginViewModel->>TvLoginViewModel: tryCompleteAuth()
TvLoginViewModel->>TokenManager: saveTokens (skipped if already completed)
end
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 153464cba5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
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)
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt (1)
188-217: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
ManualEntryCardcan overflow the fixed 300dp chooser
The new shortcut row leaves too little room inside the 300dp card once padding, the 60dp field, 58dp button, and the optional error line are all present, so error states or larger font scales can clip. Make this section scrollable or relax the fixed height.🤖 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 `@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt` around lines 188 - 217, The `ManualEntryCard` content can exceed the fixed 300dp chooser height once the shortcut row, field, button, and optional error text are shown, especially at larger font scales. Update the layout in `TvServerSetupScreen` so this section can grow or scroll instead of relying on a hard fixed height, and keep the `ManualEntryCard`/chooser contents from being clipped in error states.
🧹 Nitpick comments (8)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/network/AndroidDeviceMetadataProvider.kt (1)
16-49: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winCache
appVersionName()instead of recomputing per request.
current()is invoked on every outgoing HTTP request (viaattachSiloDeviceMetadataHeadersinAuthInterceptorImpl, called from both the pinned and defaultonRequestpaths).appVersionName()now performs aPackageManager.getPackageInfoBinder IPC call on every single invocation, adding unnecessary IPC overhead to the request hot path. Since the app version and platform-derivedclientNamenever change during process lifetime, they should be computed once and cached.⚡ Proposed fix: cache client name/version
class AndroidDeviceMetadataProvider( private val context: Context, private val platform: String, ) : DeviceMetadataProvider { private val prefs = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) + private val cachedClientName: String by lazy { clientNameFor(platform) } + private val cachedClientVersion: String? by lazy { appVersionName() } override suspend fun current(): SiloDeviceMetadata { ... return SiloDeviceMetadata( id = deviceId, name = model, platform = platform, - clientName = clientNameFor(platform), - clientVersion = appVersionName(), + clientName = cachedClientName, + clientVersion = cachedClientVersion, ) }Separately,
getPackageInfo(String, Int)is deprecated since API 33 in favor of thePackageInfoFlagsoverload; the@Suppressmasks this rather than branching onBuild.VERSION.SDK_INT, but that's a minor/deferrable concern given it still works correctly.🤖 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 `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/network/AndroidDeviceMetadataProvider.kt` around lines 16 - 49, Cache the derived metadata in AndroidDeviceMetadataProvider instead of recomputing it in current() on every request: compute the client name once from platform via clientNameFor and compute appVersionName once from PackageManager.getPackageInfo during initialization (or lazily on first use), then reuse those values when building SiloDeviceMetadata. Keep current() focused on reading/storing the deviceId and returning the already-cached name/version fields.androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.kt (1)
356-365: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the screen wiring for manual subtitle intent.
This test still passes if
applyTvSubtitleSelectionstops callingviewModel.onManualSubtitleSelectionIntent(). Add a source assertion against the selection block so the integration regression is caught.Proposed test hardening
fun manualSubtitleSelectionSuppressesAutoLanguageReselection() { + val selectionBlock = screenSource + .substringAfter("val applyTvSubtitleSelection") + .substringBefore("fun handleSkipIntroNow") + + assertTrue(selectionBlock.contains("viewModel.onManualSubtitleSelectionIntent()")) assertTrue(viewModelSource.contains("manualSubtitleSelectionApplied"))🤖 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 `@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.kt` around lines 356 - 365, The manual subtitle selection test only checks the ViewModel-side guard, so it can miss a broken screen-to-ViewModel wiring. Harden TvPlayerControlsUsabilityTest by asserting the subtitle selection flow in the player controls code path, specifically that applyTvSubtitleSelection still calls viewModel.onManualSubtitleSelectionIntent() when a user picks a subtitle track. Keep the existing manualSubtitleSelectionApplied assertions in the same test, but add a source assertion on the selection block so the integration regression is caught.androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt (1)
1089-1120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffDuplicated renewal-lambda pattern vs. mobile
PlayerViewModel.onUnsupportedPlayback.The
renewStartParamsconstruction +renewSessionlambda mappingSessionState→ApiResulthere is near-identical to the mobile ViewModel's version. Consider extracting a shared helper (e.g. inandroid-shared, alongsidePlaybackSessionManager) that takessessionLifecycle+StartParamsand returns theApiResult<PlaybackSessionResponse>mapping, to avoid the two copies drifting (as already happened withpreserveDirectAudioSelection, see companion comment onPlayerViewModel.kt).🤖 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 `@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt` around lines 1089 - 1120, The renewal flow in TvPlayerViewModel duplicates the same StartParams build and SessionState-to-ApiResult mapping used in the mobile PlayerViewModel.onUnsupportedPlayback path, so it should be centralized. Extract a shared helper near PlaybackSessionManager in android-shared that accepts sessionLifecycle and StartParams, performs sessionLifecycle.start(...) and maps SessionState.Active/Failed/other to ApiResult<PlaybackSessionResponse>, then replace the inline renewSession lambda in TvPlayerViewModel with that helper to keep both call sites in sync.androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginViewModel.kt (1)
96-111: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winConsider making the isLoading invariant explicit for
authCompletedearly-returns.The early returns in the
Error/NetworkErrorbranches (Lines 98, 107) and inhandleDeviceLoginApproved(Line 157) rely on the implicit invariant that whichever flow callstryCompleteAuth()successfully always also drivesisLoadingback tofalsebefore/while the loser's branch runs. That holds today (validated bycredentialCompletionAfterQrApprovalDoesNotOverwriteQrTokens), but it's not enforced by the code shape — a future refactor to either winning branch (e.g., reorderingtryCompleteAuth()before persisting tokens) could leave the UI stuck showing a loading spinner with no error surfaced, since the losing branch never resetsisLoadingon its own.Consider having the guarded branches proactively set
isLoading = falseeven whenauthCompletedis true, independent of what the winning flow does, so this doesn't silently regress later.🛡️ Proposed defensive fix
is ApiResult.Error -> { - if (authCompleted) return@launch + if (authCompleted) { + _uiState.update { it.copy(isLoading = false) } + return@launch + } val msg = when (result.code) { 401 -> "Invalid username or password" 403 -> "Account is disabled" else -> result.message.ifBlank { "Login failed" } } _uiState.update { it.copy(isLoading = false, error = msg) } } is ApiResult.NetworkError -> { - if (authCompleted) return@launch + if (authCompleted) { + _uiState.update { it.copy(isLoading = false) } + return@launch + } _uiState.update { it.copy(isLoading = false, error = "Network error. Check your connection.") } }Also applies to: 150-165, 167-171
🤖 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 `@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginViewModel.kt` around lines 96 - 111, The `authCompleted` early-return paths in `TvLoginViewModel` can leave the UI stuck loading if the winning auth flow changes in the future. Update the guarded branches in the `tryCompleteAuth()` result handling and in `handleDeviceLoginApproved` so they always clear `isLoading` before returning, even when `authCompleted` is already true. Keep the existing success path behavior intact, but make the spinner reset explicit in the `ApiResult.Error`, `ApiResult.NetworkError`, and device-approval code paths.androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthSingleFlightTest.kt (1)
112-135: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
matchingPathparameter is unused — recorder counts all requests, not just matching ones.
AuthRequestRecordernever filters bymatchingPathinaddHandler(Line 123 increments unconditionally). It happens to work now since each test's client only serves one endpoint, but the class implies path-scoped verification it doesn't actually perform.♻️ Proposed fix to actually filter by path
private class AuthRequestRecorder( - `@Suppress`("UNUSED_PARAMETER") matchingPath: String, + private val matchingPath: String, private val release: CompletableDeferred<Unit>, ) { var matchingRequestCount = 0 private set val firstRequestStarted = CompletableDeferred<Unit>() fun client(tokenManager: TokenManager) = HttpClient(MockEngine) { engine { addHandler { request -> - matchingRequestCount += 1 - firstRequestStarted.complete(Unit) - release.await() + if (request.url.encodedPath == matchingPath) { + matchingRequestCount += 1 + firstRequestStarted.complete(Unit) + release.await() + } respond(🤖 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 `@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthSingleFlightTest.kt` around lines 112 - 135, `AuthRequestRecorder` currently ignores `matchingPath`, so it records every request instead of only the intended endpoint. Update the `client(...)` MockEngine `addHandler` in `AuthRequestRecorder` to check the request path against `matchingPath` before incrementing `matchingRequestCount`, completing `firstRequestStarted`, and responding. If the path does not match, let the handler decline or fail that request so the recorder only tracks the scoped auth flow.androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchScreen.kt (1)
87-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winStale comment references the removed custom keyboard.
// and the custom keyboard's Search action still snaps focus into the grid.no longer applies — the custom keyboard was removed in this migration and the Search action is now the IME'sonSearch(pendingSearchFocus = true; viewModel.submitSearch()). Please update the comment so it doesn't mislead future readers.📝 Suggested comment update
- // and the custom keyboard's Search action still snaps focus into the grid. + // and the platform IME's Search action still snaps focus into the grid.🤖 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 `@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchScreen.kt` around lines 87 - 94, Update the stale focus-handling comment in TvSearchScreen so it matches the current search flow: the removed custom keyboard reference should be replaced with the IME onSearch behavior, where pendingSearchFocus is set and viewModel.submitSearch() is called. Keep the rest of the explanation about the deliberate no-auto-jump focus behavior and the focusProperties handoffs, but ensure the comment no longer mentions the custom keyboard or implies it still exists.androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginScreen.kt (1)
347-392: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winWrap the password-visibility toggle in
IconButton.The trailing icon uses a bare
Iconwith.clickable {}instead of Material'sIconButton. This is a deviation from idiomatic Compose/Material3 usage:IconButtonprovides correct minimum touch/focus target sizing, ripple, and semantics (Role.Button) that a raw clickableIconlacks, which matters for TV remote/D-pad focus traversal and TalkBack announcements on this exact toggle.As per coding guidelines, "Follow Compose idioms in Kotlin composable functions and UI code."♻️ Proposed fix using IconButton
trailingIcon = { - Icon( - imageVector = if (passwordVisible) { - Icons.Default.VisibilityOff - } else { - Icons.Default.Visibility - }, - contentDescription = if (passwordVisible) "Hide password" else "Show password", - modifier = Modifier - .clip(RoundedCornerShape(8.dp)) - .clickable { passwordVisible = !passwordVisible } - .padding(6.dp), - ) + IconButton(onClick = { passwordVisible = !passwordVisible }) { + Icon( + imageVector = if (passwordVisible) { + Icons.Default.VisibilityOff + } else { + Icons.Default.Visibility + }, + contentDescription = if (passwordVisible) "Hide password" else "Show password", + ) + } },Requires
import androidx.compose.material3.IconButton.🤖 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 `@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginScreen.kt` around lines 347 - 392, The password visibility toggle inside TvLoginScreen’s OutlinedTextField trailingIcon is using a clickable Icon directly instead of an IconButton. Replace that bare Icon click target with Material3 IconButton while keeping the existing visibility toggle state, icon selection, and contentDescription so the control gets proper touch size, focus semantics, and accessibility behavior for TV navigation.Source: Coding guidelines
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/collections/TvCreateCollectionDialog.kt (1)
65-72: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winFragile auto-focus/keyboard-show sequencing.
The fixed
delay(120)beforerequestFocus()is a heuristic wait for the dialog's enter animation; on slower Fire TV hardware this could still race the composition, andrunCatchingsilently swallows the failure with no retry, leaving the keyboard never shown. Given this PR's explicit goal of fixing TV keyboard reliability, a magic-number delay + silent-fail pattern is a regression risk on lower-end devices.Consider anchoring the focus request to composition readiness (e.g.
onGloballyPositioned) instead of a fixed delay, or retrying once ifrequestFocus()fails.🤖 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 `@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/collections/TvCreateCollectionDialog.kt` around lines 65 - 72, The auto-focus flow in TvCreateCollectionDialog is still relying on a fragile fixed delay and a silent runCatching around nameFocusRequester.requestFocus(), which can fail on slower devices and leave the keyboard hidden. Replace the magic-number delay in the LaunchedEffect with a composition-readiness trigger such as onGloballyPositioned, or add a visible retry path if requestFocus() returns false. Keep the keyboardController.show() call tied to a confirmed focus success so the dialog reliably brings up the TV keyboard.
🤖 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
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt`:
- Around line 291-325: The renewal retry path in
PlaybackSessionManager.startTranscodeFallbackRecoveringMissingSession leaks a
server-side session when startTranscodeFallback(session = renewed.data, ...)
fails after renewSession() succeeds. Update the success branch to capture the
result of the retry, and if it returns an error or network failure, invoke the
existing session cleanup/stop logic for renewed.data before returning the
failure. Add or adjust a test around
startTranscodeFallbackRecoveringMissingSession to verify stopSession (or
equivalent cleanup) is called when the post-renewal retry fails.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt`:
- Around line 602-610: The renewal fallback in PlayerViewModel’s recovery path
is dropping direct audio selection because StartParams defaults
preserveDirectAudioSelection to false. Update the StartParams construction in
this recovery branch to explicitly carry over direct audio selection the same
way the TV recovery flow does, using the existing
selectedAudioIndex/selectedSubtitleIndex values and setting
preserveDirectAudioSelection to true when rebuilding renewStartParams.
In
`@androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/auth/ServerSetupPersistenceTest.kt`:
- Around line 20-51: The ServerSetupPersistenceTest test invokes
ServerSetupViewModel.onConnectClick(), which uses viewModelScope and can fail on
the JVM without a Main dispatcher. Add test setup/teardown around the test class
to set and reset Dispatchers.Main, following the same pattern used in
TvServerSetupPersistenceTest, so the coroutine launched by onConnectClick() has
a valid main dispatcher during the test.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvAuroraChrome.kt`:
- Line 136: `AuroraPrimaryButton` currently uses `Modifier.clickable(enabled =
false, ...)`, which removes it from TV D-pad focus traversal when the button is
disabled. Update `AuroraPrimaryButton` in `TvAuroraChrome.kt` so its
focusability is preserved when `enabled` flips false, either by keeping the
clickable/focusable behavior active and gating `onClick` separately, or by
explicitly restoring focus after loading ends. Make sure the change works for
the `TvServerSetupScreen` and `TvLoginScreen` flows that bind this state to
submission/loading.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupViewModel.kt`:
- Around line 103-123: The TV server probe in TvServerSetupViewModel currently
exits early on ApiResult.Error, which prevents trying the next URL candidate
when the first https probe gets an HTTP error. Update the candidate loop in the
setup flow to mirror the phone-side behavior by continuing to the next candidate
on ApiResult.Error, and only set the error state once all candidates have been
exhausted; keep the existing ApiResult.NetworkError fallback logic in the same
loop.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.kt`:
- Around line 358-361: Route intro-skip through the room transport gate instead
of seeking the local controller directly. Update
TvPlayerScreen.handleSkipIntroNow() to mirror the existing skip/scrub flow by
checking tvRoomTransportGate(..., TvTransportIntent.Seek) and calling
roomController.onUserSeek(target) when in a room, then fall back to
mediaController?.seekTo(...) only for solo playback. Reuse the same pattern in
the other intro-skip call sites so D-pad Center and the banner cannot bypass
Watch Together sync.
In `@shared/src/commonMain/kotlin/org/siloserver/silo/network/api/AuthApi.kt`:
- Around line 50-61: The getSetupStatus and getSignupStatus overloads in AuthApi
are using the shared auth-enabled client for discovery probes, which can attach
bearer tokens to arbitrary serverUrl hosts. Update these methods to use a
no-auth client or otherwise bypass SiloAuthPlugin for these specific requests,
while keeping the existing safeApiCall flow and preserving the current API
surface.
---
Outside diff comments:
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt`:
- Around line 188-217: The `ManualEntryCard` content can exceed the fixed 300dp
chooser height once the shortcut row, field, button, and optional error text are
shown, especially at larger font scales. Update the layout in
`TvServerSetupScreen` so this section can grow or scroll instead of relying on a
hard fixed height, and keep the `ManualEntryCard`/chooser contents from being
clipped in error states.
---
Nitpick comments:
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/network/AndroidDeviceMetadataProvider.kt`:
- Around line 16-49: Cache the derived metadata in AndroidDeviceMetadataProvider
instead of recomputing it in current() on every request: compute the client name
once from platform via clientNameFor and compute appVersionName once from
PackageManager.getPackageInfo during initialization (or lazily on first use),
then reuse those values when building SiloDeviceMetadata. Keep current() focused
on reading/storing the deviceId and returning the already-cached name/version
fields.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginScreen.kt`:
- Around line 347-392: The password visibility toggle inside TvLoginScreen’s
OutlinedTextField trailingIcon is using a clickable Icon directly instead of an
IconButton. Replace that bare Icon click target with Material3 IconButton while
keeping the existing visibility toggle state, icon selection, and
contentDescription so the control gets proper touch size, focus semantics, and
accessibility behavior for TV navigation.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginViewModel.kt`:
- Around line 96-111: The `authCompleted` early-return paths in
`TvLoginViewModel` can leave the UI stuck loading if the winning auth flow
changes in the future. Update the guarded branches in the `tryCompleteAuth()`
result handling and in `handleDeviceLoginApproved` so they always clear
`isLoading` before returning, even when `authCompleted` is already true. Keep
the existing success path behavior intact, but make the spinner reset explicit
in the `ApiResult.Error`, `ApiResult.NetworkError`, and device-approval code
paths.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/collections/TvCreateCollectionDialog.kt`:
- Around line 65-72: The auto-focus flow in TvCreateCollectionDialog is still
relying on a fragile fixed delay and a silent runCatching around
nameFocusRequester.requestFocus(), which can fail on slower devices and leave
the keyboard hidden. Replace the magic-number delay in the LaunchedEffect with a
composition-readiness trigger such as onGloballyPositioned, or add a visible
retry path if requestFocus() returns false. Keep the keyboardController.show()
call tied to a confirmed focus success so the dialog reliably brings up the TV
keyboard.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt`:
- Around line 1089-1120: The renewal flow in TvPlayerViewModel duplicates the
same StartParams build and SessionState-to-ApiResult mapping used in the mobile
PlayerViewModel.onUnsupportedPlayback path, so it should be centralized. Extract
a shared helper near PlaybackSessionManager in android-shared that accepts
sessionLifecycle and StartParams, performs sessionLifecycle.start(...) and maps
SessionState.Active/Failed/other to ApiResult<PlaybackSessionResponse>, then
replace the inline renewSession lambda in TvPlayerViewModel with that helper to
keep both call sites in sync.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchScreen.kt`:
- Around line 87-94: Update the stale focus-handling comment in TvSearchScreen
so it matches the current search flow: the removed custom keyboard reference
should be replaced with the IME onSearch behavior, where pendingSearchFocus is
set and viewModel.submitSearch() is called. Keep the rest of the explanation
about the deliberate no-auto-jump focus behavior and the focusProperties
handoffs, but ensure the comment no longer mentions the custom keyboard or
implies it still exists.
In
`@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthSingleFlightTest.kt`:
- Around line 112-135: `AuthRequestRecorder` currently ignores `matchingPath`,
so it records every request instead of only the intended endpoint. Update the
`client(...)` MockEngine `addHandler` in `AuthRequestRecorder` to check the
request path against `matchingPath` before incrementing `matchingRequestCount`,
completing `firstRequestStarted`, and responding. If the path does not match,
let the handler decline or fail that request so the recorder only tracks the
scoped auth flow.
In
`@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.kt`:
- Around line 356-365: The manual subtitle selection test only checks the
ViewModel-side guard, so it can miss a broken screen-to-ViewModel wiring. Harden
TvPlayerControlsUsabilityTest by asserting the subtitle selection flow in the
player controls code path, specifically that applyTvSubtitleSelection still
calls viewModel.onManualSubtitleSelectionIntent() when a user picks a subtitle
track. Keep the existing manualSubtitleSelectionApplied assertions in the same
test, but add a source assertion on the selection block so the integration
regression is caught.
🪄 Autofix (Beta)
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: 287a48bb-9bef-4b60-b706-432baa5d511d
📒 Files selected for processing (57)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/network/AndroidDeviceMetadataProvider.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionManagerTranscodeFallbackTest.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/ServerSetupViewModel.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/auth/ServerSetupPersistenceTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelSharedCoordinatorTest.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvAnsiKeyboard.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvAuroraChrome.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvHeroActionPill.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvTextInputDialog.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/admin/TvAdminUserEditScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthInputRules.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvCredentialKeyboard.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvCredentialKeyboardState.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerUrlKeyboard.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerUrlKeyboardState.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvSetupScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvSetupViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvSignupScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvSignupViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/collections/TvCreateCollectionDialog.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/requests/TvRequestsScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchInputRules.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchKeyboard.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchScreen.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvAnsiKeyboardSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvStockKeyboardPolicyTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvTextInputDialogSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthFocusSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthInputRulesTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthSingleFlightSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthSingleFlightTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvCredentialKeyboardStateTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginViewModelRaceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginViewModelSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupPersistenceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupReadabilityTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupUrlProbeTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerUrlKeyboardStateTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModelSharedCoordinatorTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/requests/TvRequestsUsabilityTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchLayoutReadabilityTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/theme/TvDialogScalingTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/theme/TvSkylineTokenParityTest.ktshared/src/commonMain/kotlin/org/siloserver/silo/network/AuthInterceptorImpl.ktshared/src/commonMain/kotlin/org/siloserver/silo/network/DeviceMetadataProvider.ktshared/src/commonMain/kotlin/org/siloserver/silo/network/api/AuthApi.ktshared/src/commonMain/kotlin/org/siloserver/silo/repository/AuthRepository.ktshared/src/commonTest/kotlin/org/siloserver/silo/network/SiloAuthPluginPinTest.kt
💤 Files with no reviewable changes (9)
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerUrlKeyboardStateTest.kt
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvCredentialKeyboardStateTest.kt
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvAnsiKeyboardSourceTest.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchKeyboard.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerUrlKeyboardState.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvCredentialKeyboardState.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvCredentialKeyboard.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerUrlKeyboard.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvAnsiKeyboard.kt
|
Review-response update in 7afe721:
I intentionally did not fold the duplicated TV/mobile renewal lambdas into a shared helper in this stabilization PR. Both paths now have targeted regression coverage, and the extraction would broaden the blast radius without fixing a live bug. Verification run: |
Summary
This PR addresses the Fire TV / Google TV feedback branch against
Silo-Server/silo-android:main.Playback session not foundsource-error path.Testing
git diff --check upstream/main...HEAD./gradlew --no-build-cache :androidTvApp:testDebugUnitTest :androidApp:testDebugUnitTest :androidTvApp:assembleDebug :androidApp:assembleDebugandroidTvApp-armeabi-v7a-debug.apkon Google TV Streamer61071HFAG1FWQXand verified server URL text remains visible while typing with the stock platform keyboard.Notes
Silo-Server/silo-android:mainRXWatcher:fix/firetv-v0.2.3-feedbackupstream/main.Summary by CodeRabbit
New Features
Bug Fixes