[Navigation] Show Back when Sign in is opened from Profiles #103

Open
opened 2026-09-27 14:48:22 +02:00 by alexander · 0 comments
Owner

Problem

The same Sign-in screen is used for two different navigation contexts:

  1. Root onboarding — first install / no profile exists.
  2. Pushed flow — Add Profile or Sign In Again from Profiles.

Current SignInScreen always renders a TopAppBar with only the Sign-in title. When it was pushed from Profiles, Android/system Back can return to Profiles but the screen provides no visible Back affordance, so it visually reads like a root destination.

Reviewed against current main at f9f7feba8e7bb499c6001bf0cc19a38357b7494a on 2026-09-27.

Desired behavior

Root onboarding

When Sign in is the root/start destination:

  • show no Back arrow;
  • preserve the current forward onboarding flow.

Add profile / re-authentication

When Sign in was pushed from an existing app destination:

  • show a normal Back arrow;
  • Back returns to the calling screen, normally Profiles;
  • preserve entered/draft state according to the existing ViewModel/state contract;
  • successful sign-in continues to the correct post-auth destination without stacking obsolete credential screens.

The visible Back action, Android Back and predictive Back should agree.

Architecture

Do not infer context from UI text.

Pass explicit navigation capability/context from the NavHost/route into SignInRoute / SignInScreen, or use another clear navigation-owned signal.

Keep:

  • the existing sign-in stage Back/Change Server behavior inside the form;
  • the current successful sign-in stack cleanup;
  • reauthentication pre-filled server/username behavior.

The toolbar Back is route navigation. The in-form “change server/back to server” action remains wizard-stage navigation. Do not conflate the two.

Implementation starting points

  • app/src/main/kotlin/com/example/shelfplayer/navigation/ShelfPlayerNavHost.kt
  • app/src/main/kotlin/com/example/shelfplayer/feature/onboarding/SignInScreen.kt
  • focused navigation/screen tests

Acceptance

  • Fresh install/root Sign-in has no misleading Back arrow.
  • Add Profile Sign-in has a visible Back arrow and returns to Profiles.
  • Sign In Again has a visible Back arrow and returns without changing the existing profile merely by cancelling.
  • System Back and toolbar Back match.
  • Credential-stage internal Back/Change Server still works as designed.
  • Successful authentication does not leave stale Sign-in destinations underneath Home.
  • Verify TalkBack label, 48dp target, 320dp/large text, rotation and predictive Back where supported.
## Problem The same Sign-in screen is used for two different navigation contexts: 1. **Root onboarding** — first install / no profile exists. 2. **Pushed flow** — Add Profile or Sign In Again from Profiles. Current `SignInScreen` always renders a TopAppBar with only the Sign-in title. When it was pushed from Profiles, Android/system Back can return to Profiles but the screen provides no visible Back affordance, so it visually reads like a root destination. Reviewed against current `main` at `f9f7feba8e7bb499c6001bf0cc19a38357b7494a` on 2026-09-27. ## Desired behavior ### Root onboarding When Sign in is the root/start destination: - show no Back arrow; - preserve the current forward onboarding flow. ### Add profile / re-authentication When Sign in was pushed from an existing app destination: - show a normal Back arrow; - Back returns to the calling screen, normally Profiles; - preserve entered/draft state according to the existing ViewModel/state contract; - successful sign-in continues to the correct post-auth destination without stacking obsolete credential screens. The visible Back action, Android Back and predictive Back should agree. ## Architecture Do not infer context from UI text. Pass explicit navigation capability/context from the NavHost/route into `SignInRoute` / `SignInScreen`, or use another clear navigation-owned signal. Keep: - the existing sign-in stage Back/Change Server behavior inside the form; - the current successful sign-in stack cleanup; - reauthentication pre-filled server/username behavior. The toolbar Back is **route navigation**. The in-form “change server/back to server” action remains **wizard-stage navigation**. Do not conflate the two. ## Implementation starting points - `app/src/main/kotlin/com/example/shelfplayer/navigation/ShelfPlayerNavHost.kt` - `app/src/main/kotlin/com/example/shelfplayer/feature/onboarding/SignInScreen.kt` - focused navigation/screen tests ## Acceptance - Fresh install/root Sign-in has no misleading Back arrow. - Add Profile Sign-in has a visible Back arrow and returns to Profiles. - Sign In Again has a visible Back arrow and returns without changing the existing profile merely by cancelling. - System Back and toolbar Back match. - Credential-stage internal Back/Change Server still works as designed. - Successful authentication does not leave stale Sign-in destinations underneath Home. - Verify TalkBack label, 48dp target, 320dp/large text, rotation and predictive Back where supported.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alexander/Audiobookshelf-Manager-Claude#103
No description provided.