Back / Esc per surface
Step diagram
User triggers back
UserHardware back on Android, swipe-back on iOS, browser back on web, or Esc on desktop.
KoderBackScope intercepts
SDKSingle intent handler shared by every surface; no per-screen workarounds.
Pop one route
AppNavigation stack pops exactly one entry. Never an unrelated tab switch, never two pops at once.
User reaches the root
UserStack is now down to one entry — the root screen.
Next back exits the app
SDKConfigurable: enableSystemExitAtRoot=true closes the app; otherwise back at root is a no-op (often desktop windows).
Common pitfalls
- Re-implementing back per screen — every screen ends up with a slightly different rule and the user can't predict the result.
- Mapping back to logout — silently drops auth state when the user expected to navigate.