Repository navigation
feat(onboarding): redesign the first-run flow on Android phone and TV - #459
Conversation
Port of the Apple first-run redesign (Silo-Server/silo-apple#586): one brand-light backdrop behind server setup, sign-in, profiles and PIN on both apps, tinted to the server's accent and to the selected person. - Phone: address field with Advanced options and Recent servers, a "Sign in" screen with the server chip and branded subtitle, round profile avatars sized to the household, full-screen PIN keypad. - TV: phone-first setup with three picture steps, a separate address screen, sign-in with the code card on the right, restyled pairing, picker and PIN. - A saved server that still has a session goes straight to profiles. - After a sign-in, a one-profile household with no PIN skips the picker. - Branding (subtitle, accent, mark) is read from the public branding endpoint; asset URLs are accepted only on the server's own origin. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (53)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2327f3be7
ℹ️ 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".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
| fun resolveAsset(value: String?, serverUrl: String): String? { | ||
| val raw = value?.trim()?.takeIf { it.isNotEmpty() } ?: return null | ||
| val base = runCatching { URI(serverUrl.trimEnd('/') + "/") }.getOrNull() ?: return null | ||
| val resolved = runCatching { base.resolve(raw.removePrefix("/")) }.getOrNull() ?: return null |
There was a problem hiding this comment.
Incorrect URI resolution strips the leading slash from site-relative branding paths, causing a server configured as https://media.example.com/silo to resolve /branding/mark.png to /silo/branding/mark.png instead of /branding/mark.png. Preserve the leading slash so branded marks load on subpath deployments, and handle protocol-relative inputs separately if they must remain local paths.
val assetPath = if (raw.startsWith("//")) raw.removePrefix("/") else raw
val resolved = runCatching { base.resolve(assetPath) }.getOrNull() ?: return nullPrompt for LLM
File android-shared/src/androidMain/kotlin/org/siloserver/silo/common/ui/marquee/ServerBranding.kt:
Line 43:
Incorrect URI resolution strips the leading slash from site-relative branding paths, causing a server configured as https://media.example.com/silo to resolve /branding/mark.png to /silo/branding/mark.png instead of /branding/mark.png. Preserve the leading slash so branded marks load on subpath deployments, and handle protocol-relative inputs separately if they must remain local paths.
Suggested Code:
val assetPath = if (raw.startsWith("//")) raw.removePrefix("/") else raw
val resolved = runCatching { base.resolve(assetPath) }.getOrNull() ?: return null
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| // Cancelled with the screen, so a late answer can't retint the next one. | ||
| val fresh = loader.load(serverUrl) ?: return@LaunchedEffect | ||
| server.branding = fresh | ||
| if (tintsBackdrop) MarqueeScene.showServer(fresh) |
There was a problem hiding this comment.
Race condition identified in the shared MarqueeScene update: loader.load can return after cancellation, and the effect captures tintsBackdrop without using it as an effect key, allowing an obsolete screen to overwrite a replacement screen's tint. Key the effect on its changing inputs, check cancellation after loading, and revalidate current backdrop authority and the scene ownership generation before calling MarqueeScene.showServer(fresh).
Kody rule violation: Revalidate asynchronous ownership before publication, launch, and cleanup
Prompt for LLM
File android-shared/src/androidMain/kotlin/org/siloserver/silo/common/ui/marquee/SignInServer.kt:
Line 48:
Race condition identified in the shared MarqueeScene update: loader.load can return after cancellation, and the effect captures tintsBackdrop without using it as an effect key, allowing an obsolete screen to overwrite a replacement screen's tint. Key the effect on its changing inputs, check cancellation after loading, and revalidate current backdrop authority and the scene ownership generation before calling MarqueeScene.showServer(fresh).
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| autoCorrectEnabled = false, | ||
| showKeyboardOnFocus = false, | ||
| ), | ||
| keyboardActions = KeyboardActions(onAny = { onImeAction?.invoke() }), |
There was a problem hiding this comment.
Duplicate sign-in submission can occur because the IME callback invokes onImeAction without checking enabled, allowing an outstanding IME event to submit another attempt after the field is disabled. Guard the callback with enabled and bind enabled to the authoritative sign-in busy state at the call site; also check androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/LoginScreen.kt:318-318 and androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/marquee/MarqueeFields.kt:149-149.
Kody rule violation: Use one stable busy state for every sign-in entry point
Prompt for LLM
File androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/marquee/TvMarqueeField.kt:
Line 104:
Duplicate sign-in submission can occur because the IME callback invokes onImeAction without checking enabled, allowing an outstanding IME event to submit another attempt after the field is disabled. Guard the callback with enabled and bind enabled to the authoritative sign-in busy state at the call site; also check androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/LoginScreen.kt:318-318 and androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/marquee/MarqueeFields.kt:149-149.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| autoCorrectEnabled = false, | ||
| showKeyboardOnFocus = false, | ||
| ), | ||
| keyboardActions = KeyboardActions(onAny = { onImeAction?.invoke() }), |
There was a problem hiding this comment.
IME focus navigation fails because the unconditional onAny handler consumes Next without moving focus when onImeAction is null, including the Username and Email fields in TvSetupScreen (androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvSetupScreen.kt:97-104) and TvSignupScreen (androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvSignupScreen.kt:84-90). Preserve KeyboardActions.Default when no callback is supplied so the keyboard's Next action advances through these forms.
Prompt for LLM
File androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/marquee/TvMarqueeField.kt:
Line 104:
IME focus navigation fails because the unconditional onAny handler consumes Next without moving focus when onImeAction is null, including the Username and Email fields in TvSetupScreen (androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvSetupScreen.kt:97-104) and TvSignupScreen (androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvSignupScreen.kt:84-90). Preserve KeyboardActions.Default when no callback is supplied so the keyboard's Next action advances through these forms.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| onClick = onLoginClick, | ||
| isLoading = state.isLoading, | ||
| focusRequester = signInFocus, | ||
| enabled = !state.signingIn, |
There was a problem hiding this comment.
Focus loss and an invalid D-pad destination occur when a password attempt disables the waiting Sign in button while, without a network alternative, the secondary actions still point upward to it through aboveSecondary. Keep the password Sign in button focusable during its own pending request and reject repeat submissions through the busy guard, but continue disabling it during network sign-in, when Continue as is the waiting action.
Kody rule violation: Keep TV sign-in alternatives reachable and prioritize recovery focus
Prompt for LLM
File androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginScreen.kt:
Line 932:
Focus loss and an invalid D-pad destination occur when a password attempt disables the waiting Sign in button while, without a network alternative, the secondary actions still point upward to it through aboveSecondary. Keep the password Sign in button focusable during its own pending request and reject repeat submissions through the busy guard, but continue disabling it during network sign-in, when Continue as is the waiting action.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| Row( | ||
| Modifier | ||
| .fillMaxWidth() | ||
| .padding(top = 20.dp), | ||
| horizontalArrangement = Arrangement.spacedBy(11.dp), | ||
| ) { |
There was a problem hiding this comment.
Button overflow truncates the later phone/server actions because the password screen places up to four unweighted buttons in TvMarqueeScreen's fixed 450dp copy column, exceeding its width with labels, 40dp per-button padding, and gaps. Keep Sign in on its own row and wrap or split the secondary actions into additional rows.
Prompt for LLM
File androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginScreen.kt:
Line 921 to 926:
Button overflow truncates the later phone/server actions because the password screen places up to four unweighted buttons in TvMarqueeScreen's fixed 450dp copy column, exceeding its width with labels, 40dp per-button padding, and gaps. Keep Sign in on its own row and wrap or split the secondary actions into additional rows.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
Problem
Related: Silo-Server/silo-apple#586 (the same redesign on Apple)
Validation tasks: changes #332 C1–C3; changes #333 C1–C3, C5; changes #337 C1, C3, C4 (none passed yet)
The Android first-run screens (server address, sign-in, Who's watching, PIN) still use the old Aurora look, which no longer matches the rest of Silo or the redesigned Apple apps. A few behaviors also differ from Apple: picking a saved server you're still signed in to sends you to sign-in again, a one-profile household sees a one-person picker after every sign-in, and the server's branding (subtitle, accent, mark) isn't shown before sign-in.
Approach
One look for every first-run screen, on phone and TV.
android-shared(common/ui/marquee), phone ones inandroidApp/.../components/marquee, TV ones inandroidTvApp/.../components/marquee. The Aurora pieces these screens used are removed. The onboarding tour and profile create/edit keep theirs, as on Apple.Phone.
LoginViewModel. With two or more providers, the password form folds behind "Sign in with a password". A rejected password shakes the grouped fields.ProfilePickerLayout), "Signed in as", lock and KIDS badges, and Change server, Sign out and Manage below.Android TV.
Behavior changes.
GET /api/v2/theme/branding(existing endpoint, new optional fieldslogin_subtitle,accent_color,mark_url,wordmark_url). It's cached per server so screens don't flash. Asset URLs are accepted only on the server's own origin.Deliberate differences from Apple.
Validation
./gradlew test --continue: 9,343 tests, 0 failures. New tests:ProfilePickerLayoutTest(1–20 profiles on four screen sizes) andServerBrandingTest(same-origin asset rule).lintDebugandlintVitalReleasefor both apps: no new issues.:androidApp:assembleDebugand:androidTvApp:assembleDebugbuild.check-build-supply-chain.shdidn't run on this machine (no Ruby). This change touches no build or dependency files.main, with a four-profile account (one with a PIN, one kids profile) and a one-profile account:Evidence: https://evidence.siloserver.org/r/silo-android/signin-redesign/
Risks
Checklist
AI Disclosure
Harness: Claude Code in T3 Code
Tool(s): Claude Code
Model(s): claude-opus-5-5
Involvement: Fully AI-generated, not yet human verified
Adversarial review: A separate Claude Code review agent (claude-opus-5-5, feature-dev code reviewer) compared the rewritten screens with
mainand looked for lost behavior and new bugs. It found 13 issues, 12 fixed:One note is left open: a server mark served as SVG would fall back to the initial.
🤖 Generated with Claude Code
Note
Redesign first-run onboarding flow with shared Marquee UI on Android phone and TV
BrandingApi.getBrandingv2 endpoint client plusServerBrandingmodel, cached per server URL inSharedPreferences, with same-origin asset URL validation and accent-color clamping; branding drives server chips and scene tintingProfilesdestination when the active server already has a session, and sign-in completes viaSignInHandoffto auto-open a household's single PIN-less profile without showing the pickerProfilePickerLayout) with unit-test coverageMacroscope summarized 451975c.